Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

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 Methods

 TAO_LF_Invocation_Event (void)
 Constructor. More...

virtual ~TAO_LF_Invocation_Event (void)
 Destructor. More...

int successful (void) const
 Return 1 if the condition was satisfied successfully, 0 if it has not. More...

int error_detected (void) const
 Return 1 if an error was detected while waiting for the event. More...


Protected Methods

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


Private Methods

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


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 36 of file LF_Invocation_Event.h.


Constructor & Destructor Documentation

TAO_LF_Invocation_Event::TAO_LF_Invocation_Event void   
 

Constructor.

Definition at line 14 of file LF_Invocation_Event.cpp.

00015   : TAO_LF_Event ()
00016 {
00017 }

TAO_LF_Invocation_Event::~TAO_LF_Invocation_Event void    [virtual]
 

Destructor.

Definition at line 19 of file LF_Invocation_Event.cpp.

00020 {
00021 }


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 79 of file LF_Invocation_Event.cpp.

References TAO_LF_Event::LFS_CONNECTION_CLOSED, TAO_LF_Event::LFS_FAILURE, TAO_LF_Event::LFS_TIMEOUT, and TAO_LF_Event::state_.

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

00080 {
00081   return (this->state_ == TAO_LF_Event::LFS_FAILURE
00082           || this->state_ == TAO_LF_Event::LFS_TIMEOUT
00083           || this->state_ == TAO_LF_Event::LFS_CONNECTION_CLOSED);
00084 }

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 87 of file LF_Invocation_Event.cpp.

References TAO_LF_Event::LFS_FAILURE, TAO_LF_Event::LFS_TIMEOUT, and TAO_LF_Event::state_.

00088 {
00089   if (this->state_ == TAO_LF_Event::LFS_TIMEOUT ||
00090       this->state_ == TAO_LF_Event::LFS_FAILURE)
00091     return 1;
00092 
00093   return 0;
00094 }

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 24 of file LF_Invocation_Event.cpp.

References TAO_LF_Event::LFS_ACTIVE, TAO_LF_Event::LFS_CONNECTION_CLOSED, TAO_LF_Event::LFS_FAILURE, TAO_LF_Event::LFS_IDLE, TAO_LF_Event::LFS_SUCCESS, and TAO_LF_Event::state_.

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

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

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 73 of file LF_Invocation_Event.cpp.

References TAO_LF_Event::LFS_SUCCESS, and TAO_LF_Event::state_.

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

00074 {
00075   return this->state_ == TAO_LF_Event::LFS_SUCCESS;
00076 }


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 15:27:44 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002