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

TAO_Resume_Handle Class Reference

A utility class that helps in resuming handlers if TAO uses a TP Reactor from ACE. More...

#include <Resume_Handle.h>

Collaboration diagram for TAO_Resume_Handle:

Collaboration graph
[legend]
List of all members.

Public Types

enum  TAO_Handle_Resume_Flag { TAO_HANDLE_RESUMABLE = 0, TAO_HANDLE_ALREADY_RESUMED, TAO_HANDLE_LEAVE_SUSPENDED }

Public Methods

 TAO_Resume_Handle (TAO_ORB_Core *orb_core=0, ACE_HANDLE h=ACE_INVALID_HANDLE)
 Ctor. More...

 ~TAO_Resume_Handle (void)
 Dtor. More...

void set_flag (TAO_Handle_Resume_Flag fl)
 Allow the users of this class to change the underlying flag. More...

TAO_Resume_Handle & operator= (const TAO_Resume_Handle &rhs)
 Equal to operator.. More...

void resume_handle (void)
 Resume the handle in the reactor only if the ORB uses a TP reactor. Else we dont resume the handle. More...


Private Attributes

TAO_ORB_Coreorb_core_
 Our ORB Core. More...

ACE_HANDLE handle_
 The actual handle that needs resumption.. More...

TAO_Handle_Resume_Flag flag_
 Th flag for indicating whether the handle has been resumed or not. A value of '0' indicates that the handle needs resumption. More...


Detailed Description

A utility class that helps in resuming handlers if TAO uses a TP Reactor from ACE.

Please read the documentation in the bugzilla #575 in the bugzilla database what we mean by handler resumption.

When TAO uses a TP reactor, it takes care of resuming the handler once it makes sure that it has read the whole message out of the socket. During the process of reading the transport object would have to deal with errors in 'read' from the socket, or errors in the messages that has been received. Instead of calling resume_handler () on the reactor at every point in the code, we use this utility class to take care of the resumption.

Definition at line 44 of file Resume_Handle.h.


Member Enumeration Documentation

enum TAO_Resume_Handle::TAO_Handle_Resume_Flag
 

Enumeration values:
TAO_HANDLE_RESUMABLE 
TAO_HANDLE_ALREADY_RESUMED 
TAO_HANDLE_LEAVE_SUSPENDED 

Definition at line 55 of file Resume_Handle.h.


Constructor & Destructor Documentation

ACE_INLINE TAO_Resume_Handle::TAO_Resume_Handle TAO_ORB_Core   orb_core = 0,
ACE_HANDLE    h = ACE_INVALID_HANDLE
 

Ctor.

Definition at line 5 of file Resume_Handle.inl.

00007   : orb_core_ (orb_core),
00008     handle_ (h),
00009     flag_ (TAO_HANDLE_RESUMABLE)
00010 {
00011 }

ACE_INLINE TAO_Resume_Handle::~TAO_Resume_Handle void   
 

Dtor.

Definition at line 14 of file Resume_Handle.inl.

References flag_, handle_, orb_core_, resume_handle, and TAO_HANDLE_RESUMABLE.

00015 {
00016   if (this->flag_ == TAO_HANDLE_RESUMABLE)
00017     this->resume_handle ();
00018 
00019   this->orb_core_ = 0;
00020   this->handle_ = ACE_INVALID_HANDLE;
00021 }


Member Function Documentation

ACE_INLINE TAO_Resume_Handle & TAO_Resume_Handle::operator= const TAO_Resume_Handle &    rhs
 

Equal to operator..

Definition at line 31 of file Resume_Handle.inl.

References flag_, handle_, and orb_core_.

00032 {
00033   this->orb_core_ = rhs.orb_core_;
00034   this->handle_ = rhs.handle_;
00035   this->flag_ = rhs.flag_;
00036 
00037   return *this;
00038 }

void TAO_Resume_Handle::resume_handle void   
 

Resume the handle in the reactor only if the ORB uses a TP reactor. Else we dont resume the handle.

Definition at line 13 of file Resume_Handle.cpp.

References flag_, handle_, orb_core_, TAO_ORB_Core::reactor, ACE_Reactor::resumable_handler, ACE_Reactor::resume_handler, TAO_HANDLE_ALREADY_RESUMED, and TAO_HANDLE_RESUMABLE.

Referenced by TAO_Transport::process_parsed_messages, and ~TAO_Resume_Handle.

00014 {
00015   // If we have a complete message, just resume the handler
00016   // Resume the handler.
00017   if (this->orb_core_ &&
00018       this->orb_core_->reactor ()->resumable_handler () &&
00019       this->flag_ == TAO_HANDLE_RESUMABLE &&
00020       this->handle_ != ACE_INVALID_HANDLE)
00021     this->orb_core_->reactor ()->resume_handler (this->handle_);
00022 
00023   // Set the flag, so that we dont resume again..
00024   this->flag_ = TAO_HANDLE_ALREADY_RESUMED;
00025 }

ACE_INLINE void TAO_Resume_Handle::set_flag TAO_Handle_Resume_Flag    fl
 

Allow the users of this class to change the underlying flag.

Definition at line 25 of file Resume_Handle.inl.

References flag_.

Referenced by TAO_Connection_Handler::handle_input_eh, TAO_Connection_Handler::handle_output_eh, and TAO_Transport::process_queue_head.

00026 {
00027   this->flag_ = fl;
00028 }


Member Data Documentation

TAO_Handle_Resume_Flag TAO_Resume_Handle::flag_ [private]
 

Th flag for indicating whether the handle has been resumed or not. A value of '0' indicates that the handle needs resumption.

Definition at line 82 of file Resume_Handle.h.

Referenced by operator=, resume_handle, set_flag, and ~TAO_Resume_Handle.

ACE_HANDLE TAO_Resume_Handle::handle_ [private]
 

The actual handle that needs resumption..

Definition at line 78 of file Resume_Handle.h.

Referenced by operator=, resume_handle, and ~TAO_Resume_Handle.

TAO_ORB_Core* TAO_Resume_Handle::orb_core_ [private]
 

Our ORB Core.

Definition at line 75 of file Resume_Handle.h.

Referenced by operator=, resume_handle, and ~TAO_Resume_Handle.


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