TAO_Reactive_Flushing_Strategy Class Reference

Implement a flushing strategy that uses the reactor. More...

#include <Reactive_Flushing_Strategy.h>

Inheritance diagram for TAO_Reactive_Flushing_Strategy:

Inheritance graph
[legend]
Collaboration diagram for TAO_Reactive_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 reactor.

Definition at line 31 of file Reactive_Flushing_Strategy.h.


Member Function Documentation

int TAO_Reactive_Flushing_Strategy::cancel_output TAO_Transport transport  )  [virtual]
 

Cancel all scheduled output for the transport argument.

Implements TAO_Flushing_Strategy.

Definition at line 23 of file Reactive_Flushing_Strategy.cpp.

References TAO_Transport::cancel_output_i().

00024 {
00025   return transport->cancel_output_i ();
00026 }

int TAO_Reactive_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 29 of file Reactive_Flushing_Strategy.cpp.

References TAO_Queued_Message::all_data_sent(), TAO_Transport::orb_core(), and TAO_ORB_Core::run().

00032 {
00033   int result = 0;
00034 
00035   // @@ Should we pass this down?  Can we?
00036   try
00037     {
00038       TAO_ORB_Core * const orb_core = transport->orb_core ();
00039 
00040       while (!msg->all_data_sent () && result >= 0)
00041         {
00042           result = orb_core->run (max_wait_time, 1);
00043         }
00044     }
00045   catch (const ::CORBA::Exception&)
00046     {
00047       return -1;
00048     }
00049 
00050   return result;
00051 }

int TAO_Reactive_Flushing_Strategy::flush_transport TAO_Transport transport  )  [virtual]
 

Wait until the transport has no messages queued.

Implements TAO_Flushing_Strategy.

Definition at line 54 of file Reactive_Flushing_Strategy.cpp.

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

00055 {
00056   // @@ Should we pass this down?  Can we?
00057   try
00058     {
00059       TAO_ORB_Core * const orb_core = transport->orb_core ();
00060 
00061       while (!transport->queue_is_empty ())
00062         {
00063           if (orb_core->run (0, 1) == -1)
00064             return -1;
00065         }
00066     }
00067   catch (const ::CORBA::Exception&)
00068     {
00069       return -1;
00070     }
00071 
00072   return 0;
00073 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL int TAO_Reactive_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 17 of file Reactive_Flushing_Strategy.cpp.

References TAO_Transport::schedule_output_i().

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


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