#include <Leader_Follower_Flushing_Strategy.h>
Inheritance diagram for TAO_Leader_Follower_Flushing_Strategy:
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, ACE_Time_Value *max_wait_time) |
Wait until the transport has no messages queued. |
Definition at line 32 of file Leader_Follower_Flushing_Strategy.h.
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().
00026 { 00027 return transport->cancel_output_i (); 00028 }
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 31 of file Leader_Follower_Flushing_Strategy.cpp.
References TAO_ORB_Core::leader_follower(), TAO_Transport::orb_core(), and TAO_Leader_Follower::wait_for_event().
00035 { 00036 TAO_Leader_Follower &leader_follower = 00037 transport->orb_core ()->leader_follower (); 00038 return leader_follower.wait_for_event (msg, transport, max_wait_time); 00039 }
int TAO_Leader_Follower_Flushing_Strategy::flush_transport | ( | TAO_Transport * | transport, | |
ACE_Time_Value * | max_wait_time | |||
) | [virtual] |
Wait until the transport has no messages queued.
Implements TAO_Flushing_Strategy.
Definition at line 42 of file Leader_Follower_Flushing_Strategy.cpp.
References TAO_Transport::orb_core(), TAO_Transport::queue_is_empty(), TAO_ORB_Core::run(), and ACE_Time_Value::zero.
00045 { 00046 try 00047 { 00048 TAO_ORB_Core * const orb_core = transport->orb_core (); 00049 00050 while (!transport->queue_is_empty ()) 00051 { 00052 if (orb_core->run (max_wait_time, 1) == -1) 00053 return -1; 00054 00055 if (max_wait_time != 0) { 00056 if (*max_wait_time <= ACE_Time_Value::zero) { 00057 errno = ETIME; 00058 return -1; 00059 } 00060 } 00061 } 00062 } 00063 catch (const ::CORBA::Exception&) 00064 { 00065 return -1; 00066 } 00067 00068 return 0; 00069 }
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.
00019 { 00020 return transport->schedule_output_i (); 00021 }