Base class for TAO_Asynch_Reply_Dispatcher and TAO_DII_Deferred_Reply_Dispatcher. More...
#include <Asynch_Reply_Dispatcher_Base.h>
Public Member Functions | |
TAO_Asynch_Reply_Dispatcher_Base (TAO_ORB_Core *orb_core, ACE_Allocator *allocator=0) | |
Default constructor. | |
void | transport (TAO_Transport *t) |
Sets the transport for this invocation. | |
virtual long | schedule_timer (CORBA::ULong, const ACE_Time_Value &)=0 |
Install the timeout handler. | |
bool | try_dispatch_reply (void) |
A helper method that can be used by the subclasses. | |
Protected Member Functions | |
virtual | ~TAO_Asynch_Reply_Dispatcher_Base (void) |
Destructor. | |
Protected Attributes | |
IOP::ServiceContextList | reply_service_info_ |
The service context list. | |
char | buf_ [ACE_CDR::DEFAULT_BUFSIZE] |
The buffer that is used to initialise the data block. | |
ACE_Data_Block | db_ |
TAO_InputCDR | reply_cdr_ |
TAO_Transport * | transport_ |
This invocation is using this transport, may change... | |
Private Member Functions | |
void | operator= (const TAO_Asynch_Reply_Dispatcher_Base &) |
TAO_Asynch_Reply_Dispatcher_Base (const TAO_Asynch_Reply_Dispatcher_Base &) | |
Private Attributes | |
ACE_Lock * | lock_ |
Lock to protect is_reply_dispatched_ flag. | |
bool | is_reply_dispatched_ |
Has the reply been dispatched? |
Base class for TAO_Asynch_Reply_Dispatcher and TAO_DII_Deferred_Reply_Dispatcher.
Definition at line 45 of file Asynch_Reply_Dispatcher_Base.h.
TAO_Asynch_Reply_Dispatcher_Base::TAO_Asynch_Reply_Dispatcher_Base | ( | TAO_ORB_Core * | orb_core, | |
ACE_Allocator * | allocator = 0 | |||
) |
Default constructor.
Definition at line 20 of file Asynch_Reply_Dispatcher_Base.cpp.
: TAO_Reply_Dispatcher (allocator) , db_ (sizeof buf_, ACE_Message_Block::MB_DATA, this->buf_, orb_core->input_cdr_buffer_allocator (), orb_core->locking_strategy (), ACE_Message_Block::DONT_DELETE, orb_core->input_cdr_dblock_allocator ()), reply_cdr_ (&db_, ACE_Message_Block::MB_DATA, TAO_ENCAP_BYTE_ORDER, TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR, orb_core) , transport_ (0) , lock_ (0) , is_reply_dispatched_ (false) { // @@ NOTE: Need a seperate option for this.. this->lock_ = orb_core->resource_factory ()->create_cached_connection_lock (); }
TAO_Asynch_Reply_Dispatcher_Base::~TAO_Asynch_Reply_Dispatcher_Base | ( | void | ) | [protected, virtual] |
Destructor.
Definition at line 47 of file Asynch_Reply_Dispatcher_Base.cpp.
{ // Release the transport that we own if (this->transport_ != 0) this->transport_->remove_reference (); if (this->lock_) delete this->lock_; }
TAO_Asynch_Reply_Dispatcher_Base::TAO_Asynch_Reply_Dispatcher_Base | ( | const TAO_Asynch_Reply_Dispatcher_Base & | ) | [private] |
void TAO_Asynch_Reply_Dispatcher_Base::operator= | ( | const TAO_Asynch_Reply_Dispatcher_Base & | ) | [private] |
virtual long TAO_Asynch_Reply_Dispatcher_Base::schedule_timer | ( | CORBA::ULong | , | |
const ACE_Time_Value & | ||||
) | [pure virtual] |
Install the timeout handler.
Implemented in TAO_DII_Deferred_Reply_Dispatcher, and TAO_Asynch_Reply_Dispatcher.
void TAO_Asynch_Reply_Dispatcher_Base::transport | ( | TAO_Transport * | t | ) |
Sets the transport for this invocation.
Definition at line 58 of file Asynch_Reply_Dispatcher_Base.cpp.
{ if (this->transport_ != 0) this->transport_->remove_reference (); this->transport_ = t; this->transport_->add_reference (); }
bool TAO_Asynch_Reply_Dispatcher_Base::try_dispatch_reply | ( | void | ) |
A helper method that can be used by the subclasses.
The semantics of this helper method needs careful attention. A call to this method will do the following
Why are we clumping everything in one method. Answer is we need atomicity?
Definition at line 69 of file Asynch_Reply_Dispatcher_Base.cpp.
{ if (this->is_reply_dispatched_) { return false; } else { ACE_GUARD_RETURN (ACE_Lock, mutex, *this->lock_, false); if (!this->is_reply_dispatched_) { this->is_reply_dispatched_ = true; return true; } } return false; }
char TAO_Asynch_Reply_Dispatcher_Base::buf_[ACE_CDR::DEFAULT_BUFSIZE] [protected] |
The buffer that is used to initialise the data block.
Reimplemented in TAO_DII_Asynch_Reply_Dispatcher.
Definition at line 97 of file Asynch_Reply_Dispatcher_Base.h.
ACE_Data_Block TAO_Asynch_Reply_Dispatcher_Base::db_ [protected] |
Datablock that is created on the stack to initialise the CDR stream underneath.
Reimplemented in TAO_DII_Asynch_Reply_Dispatcher.
Definition at line 101 of file Asynch_Reply_Dispatcher_Base.h.
bool TAO_Asynch_Reply_Dispatcher_Base::is_reply_dispatched_ [private] |
Has the reply been dispatched?
Definition at line 115 of file Asynch_Reply_Dispatcher_Base.h.
ACE_Lock* TAO_Asynch_Reply_Dispatcher_Base::lock_ [private] |
Lock to protect is_reply_dispatched_
flag.
Definition at line 112 of file Asynch_Reply_Dispatcher_Base.h.
CDR stream which has the reply information that needs to be demarshalled by the stubs
Reimplemented in TAO_DII_Asynch_Reply_Dispatcher.
Definition at line 105 of file Asynch_Reply_Dispatcher_Base.h.
IOP::ServiceContextList TAO_Asynch_Reply_Dispatcher_Base::reply_service_info_ [protected] |
The service context list.
Note, that this is not a reference as in the synchronous case. We own the reply_service_info because our TAO_Asynch_Invocation or TAO_DII_Deferred_Invocation will go out of scope before we are done.
Definition at line 94 of file Asynch_Reply_Dispatcher_Base.h.
This invocation is using this transport, may change...
Definition at line 108 of file Asynch_Reply_Dispatcher_Base.h.