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)
 Schedule the transport argument to be flushed.

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 ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_TRY, ACE_TRY_CHECK, 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   ACE_DECLARE_NEW_CORBA_ENV;
00051   ACE_TRY
00052     {
00053       TAO_ORB_Core *orb_core = transport->orb_core ();
00054 
00055       while (!transport->queue_is_empty ())
00056         {
00057           int result = orb_core->run (0, 1 ACE_ENV_ARG_PARAMETER);
00058           ACE_TRY_CHECK;
00059 
00060           if (result == -1)
00061             return -1;
00062         }
00063     }
00064   ACE_CATCHANY
00065     {
00066       return -1;
00067     }
00068   ACE_ENDTRY;
00069 
00070   return 0;
00071 }

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

Schedule the transport argument to be flushed.

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 Thu Nov 9 12:21:58 2006 for TAO by doxygen 1.3.6