TAO_Leader_Follower_Flushing_Strategy Class Reference

Implement a flushing strategy that uses the Leader/Follower set. More...

#include <Leader_Follower_Flushing_Strategy.h>

Inheritance diagram for TAO_Leader_Follower_Flushing_Strategy:

Inheritance graph
[legend]
Collaboration diagram for TAO_Leader_Follower_Flushing_Strategy:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual int schedule_output (TAO_Transport *transport)
virtual int cancel_output (TAO_Transport *transport)
 Cancel all scheduled output for the transport argument.

virtual int flush_message (TAO_Transport *transport, TAO_Queued_Message *msg, ACE_Time_Value *max_wait_time)
virtual int flush_transport (TAO_Transport *transport)
 Wait until the transport has no messages queued.


Detailed Description

Implement a flushing strategy that uses the Leader/Follower set.

Definition at line 32 of file Leader_Follower_Flushing_Strategy.h.


Member Function Documentation

int TAO_Leader_Follower_Flushing_Strategy::cancel_output TAO_Transport transport  )  [virtual]
 

Cancel all scheduled output for the transport argument.

Implements TAO_Flushing_Strategy.

Definition at line 24 of file Leader_Follower_Flushing_Strategy.cpp.

References TAO_Transport::cancel_output_i().

00027 {
00028   return transport->cancel_output_i ();
00029 }

int TAO_Leader_Follower_Flushing_Strategy::flush_message TAO_Transport transport,
TAO_Queued_Message msg,
ACE_Time_Value max_wait_time
[virtual]
 

Wait until msg is sent out. Potentially other messages are flushed too, for example, because there are ahead in the queue.

Implements TAO_Flushing_Strategy.

Definition at line 32 of file Leader_Follower_Flushing_Strategy.cpp.

References TAO_ORB_Core::leader_follower(), TAO_Transport::orb_core(), and TAO_Leader_Follower::wait_for_event().

00037 {
00038   TAO_Leader_Follower &leader_follower =
00039     transport->orb_core ()->leader_follower ();
00040   return leader_follower.wait_for_event (msg, transport, max_wait_time);
00041 }

int TAO_Leader_Follower_Flushing_Strategy::flush_transport TAO_Transport transport  )  [virtual]
 

Wait until the transport has no messages queued.

Implements TAO_Flushing_Strategy.

Definition at line 44 of file Leader_Follower_Flushing_Strategy.cpp.

References TAO_Transport::orb_core(), TAO_Transport::queue_is_empty(), and TAO_ORB_Core::run().

00047 {
00048   // @todo This is not the right way to do this....
00049 
00050   try
00051     {
00052       TAO_ORB_Core * const orb_core = transport->orb_core ();
00053 
00054       while (!transport->queue_is_empty ())
00055         {
00056           if (orb_core->run (0, 1) == -1)
00057             return -1;
00058         }
00059     }
00060   catch (const ::CORBA::Exception&)
00061     {
00062       return -1;
00063     }
00064 
00065   return 0;
00066 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL int TAO_Leader_Follower_Flushing_Strategy::schedule_output TAO_Transport transport  )  [virtual]
 

Schedule the transport argument to be flushed If -2 is returned then the caller must call one of the flush_* methods. If -1 is returned then there was an error. If 0 is returned then the flush was scheduled successfully.

Implements TAO_Flushing_Strategy.

Definition at line 18 of file Leader_Follower_Flushing_Strategy.cpp.

References TAO_Transport::schedule_output_i().

00019 {
00020   return transport->schedule_output_i ();
00021 }


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 13:15:06 2008 for TAO by doxygen 1.3.6