TAO_LF_Invocation_Event Class Reference

Use the Leader/Follower loop to wait for one specific event in the invocation path. More...

#include <LF_Invocation_Event.h>

Inheritance diagram for TAO_LF_Invocation_Event:

Inheritance graph
[legend]
Collaboration diagram for TAO_LF_Invocation_Event:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_LF_Invocation_Event (void)
 Constructor.

virtual ~TAO_LF_Invocation_Event (void)
 Destructor.

int successful (void) const
int error_detected (void) const

Protected Member Functions

virtual void state_changed_i (int new_state)
 Validate and perform the state change.


Private Member Functions

int is_state_final (void)
 Check whether we have reached the final state..


Detailed Description

Use the Leader/Follower loop to wait for one specific event in the invocation path.

Concrete event types and manipulation class through which the invocation data path would flow. Typically state changes of interest include whether a message has arrived, or timedout waiting for a message or if the cionnection is closed waiting for a message. Details of the states are documented within the class.

Definition at line 39 of file LF_Invocation_Event.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_LF_Invocation_Event::TAO_LF_Invocation_Event void   ) 
 

Constructor.

Definition at line 10 of file LF_Invocation_Event.cpp.

00011   : TAO_LF_Event ()
00012 {
00013 }

TAO_LF_Invocation_Event::~TAO_LF_Invocation_Event void   )  [virtual]
 

Destructor.

Definition at line 15 of file LF_Invocation_Event.cpp.

00016 {
00017 }


Member Function Documentation

int TAO_LF_Invocation_Event::error_detected void   )  const [virtual]
 

Return 1 if an error was detected while waiting for the event

Implements TAO_LF_Event.

Definition at line 75 of file LF_Invocation_Event.cpp.

Referenced by TAO_Wait_On_Read::wait(), and TAO_Wait_On_Reactor::wait().

00076 {
00077   return (this->state_ == TAO_LF_Event::LFS_FAILURE
00078           || this->state_ == TAO_LF_Event::LFS_TIMEOUT
00079           || this->state_ == TAO_LF_Event::LFS_CONNECTION_CLOSED);
00080 }

int TAO_LF_Invocation_Event::is_state_final void   )  [private, virtual]
 

Check whether we have reached the final state..

Implements TAO_LF_Event.

Definition at line 83 of file LF_Invocation_Event.cpp.

00084 {
00085   if (this->state_ == TAO_LF_Event::LFS_TIMEOUT ||
00086       this->state_ == TAO_LF_Event::LFS_FAILURE)
00087     return 1;
00088 
00089   return 0;
00090 }

void TAO_LF_Invocation_Event::state_changed_i int  new_state  )  [protected, virtual]
 

Validate and perform the state change.

Implements TAO_LF_Event.

Definition at line 20 of file LF_Invocation_Event.cpp.

Referenced by TAO_Synch_Queued_Message::bytes_transferred(), TAO_Asynch_Queued_Message::bytes_transferred(), and TAO_Synch_Reply_Dispatcher::TAO_Synch_Reply_Dispatcher().

00021 {
00022   if (this->state_ == new_state)
00023     return;
00024 
00025   // Validate the state change
00026   if (this->state_ == TAO_LF_Event::LFS_IDLE)
00027     {
00028       // From the LFS_IDLE state we can only become active.
00029       if (new_state == TAO_LF_Event::LFS_ACTIVE
00030           || new_state == TAO_LF_Event::LFS_CONNECTION_CLOSED)
00031         this->state_ = new_state;
00032       return;
00033     }
00034   else if (this->state_ == TAO_LF_Event::LFS_ACTIVE)
00035     {
00036       // From LFS_ACTIVE we can only move to a few states
00037       if (new_state != TAO_LF_Event::LFS_IDLE)
00038         {
00039           if (new_state == TAO_LF_Event::LFS_CONNECTION_CLOSED)
00040             {
00041               this->state_ = TAO_LF_Event::LFS_FAILURE;
00042             }
00043           else
00044             {
00045               this->state_ = new_state;
00046             }
00047         }
00048       return;
00049     }
00050   else if (this->state_ == TAO_LF_Event::LFS_SUCCESS
00051            || this->state_ == TAO_LF_Event::LFS_CONNECTION_CLOSED)
00052     {
00053       // From the two states above we can go back to ACTIVE, as when a
00054       // request is restarted.
00055       if (new_state == TAO_LF_Event::LFS_ACTIVE)
00056         {
00057           this->state_ = new_state;
00058         }
00059       return;
00060     }
00061   else/* if (this->state_ == TAO_LF_Event::LFS_TIMEOUT || FAILURE */
00062     {
00063       // Other states are final..
00064     }
00065 
00066 }

int TAO_LF_Invocation_Event::successful void   )  const [virtual]
 

Return 1 if the condition was satisfied successfully, 0 if it has not

Implements TAO_LF_Event.

Definition at line 69 of file LF_Invocation_Event.cpp.

Referenced by TAO_Wait_On_Read::wait(), and TAO_Wait_On_Reactor::wait().

00070 {
00071   return this->state_ == TAO_LF_Event::LFS_SUCCESS;
00072 }


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 12:22:18 2006 for TAO by doxygen 1.3.6