Public Member Functions | Protected Member Functions | Private Member Functions

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_LF_Invocation_Event::TAO_LF_Invocation_Event ( void   ) 

Constructor.

Definition at line 10 of file LF_Invocation_Event.cpp.

  : TAO_LF_Event ()
{
}

TAO_LF_Invocation_Event::~TAO_LF_Invocation_Event ( void   )  [virtual]

Destructor.

Definition at line 15 of file LF_Invocation_Event.cpp.

{
}


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.

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.

{
  if (this->state_ == TAO_LF_Event::LFS_TIMEOUT ||
      this->state_ == TAO_LF_Event::LFS_FAILURE)
    return 1;

  return 0;
}

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.

{
  if (this->state_ == new_state)
    return;

  // Validate the state change
  if (this->state_ == TAO_LF_Event::LFS_IDLE)
    {
      // From the LFS_IDLE state we can only become active.
      if (new_state == TAO_LF_Event::LFS_ACTIVE
          || new_state == TAO_LF_Event::LFS_CONNECTION_CLOSED)
        this->state_ = new_state;
      return;
    }
  else if (this->state_ == TAO_LF_Event::LFS_ACTIVE)
    {
      // From LFS_ACTIVE we can only move to a few states
      if (new_state != TAO_LF_Event::LFS_IDLE)
        {
          if (new_state == TAO_LF_Event::LFS_CONNECTION_CLOSED)
            {
              this->state_ = TAO_LF_Event::LFS_FAILURE;
            }
          else
            {
              this->state_ = new_state;
            }
        }
      return;
    }
  else if (this->state_ == TAO_LF_Event::LFS_SUCCESS
           || this->state_ == TAO_LF_Event::LFS_CONNECTION_CLOSED)
    {
      // From the two states above we can go back to ACTIVE, as when a
      // request is restarted.
      if (new_state == TAO_LF_Event::LFS_ACTIVE)
        {
          this->state_ = new_state;
        }
      return;
    }
  else/* if (this->state_ == TAO_LF_Event::LFS_TIMEOUT || FAILURE */
    {
      // Other states are final..
    }

}

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.

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


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines