diff options
-rw-r--r-- | TAO/ChangeLogs/ChangeLog-02a | 9 | ||||
-rw-r--r-- | TAO/tao/RT_Policy_i.cpp | 71 | ||||
-rw-r--r-- | TAO/tao/RT_Policy_i.h | 71 |
3 files changed, 96 insertions, 55 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index 6f75fc62513..3a2e08f2e1d 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,12 @@ +Tue Aug 29 20:09:44 2000 Angelo Corsaro <corsaro@cs.wustl.edu> + + * tao/RT_Policies.cpp: + * tao/RT_Policies.h: + + Added support for CDR encoding/decoding of TAO specific + Protocol Properties <TAO_Unix_Domain_Properties> + and <TAO_SMEM_Properties>. + Tue Aug 29 19:15:00 2000 Kirthika Parameswaran <kirthika@cs.wustl.edu> * tests/Portable_Interceptors/Benchmark/interceptors.cpp: diff --git a/TAO/tao/RT_Policy_i.cpp b/TAO/tao/RT_Policy_i.cpp index a8729f68bf4..8a33d01efd0 100644 --- a/TAO/tao/RT_Policy_i.cpp +++ b/TAO/tao/RT_Policy_i.cpp @@ -85,29 +85,13 @@ TAO_PriorityModelPolicy::_tao_encode (TAO_OutputCDR &out_cdr) // the order specified in the RTCORBA 1.0 spec (ptc/99-05-03) // section 4.7.3. - // @@ Angelo: how is the temporary useful? What is wrong with - // - // if ((out_cdr << XXX) && (out_cdr << YYY)) - // - // ???? - CORBA::Boolean b = (out_cdr << priority_model_); - if (b && (out_cdr << server_priority_)) - return 1; - - return 0; + return ((out_cdr << priority_model_) && (out_cdr << server_priority_)); } CORBA::Boolean TAO_PriorityModelPolicy::_tao_decode (TAO_InputCDR &in_cdr) { - CORBA::Boolean b = (in_cdr >> priority_model_); - if (b && (in_cdr >> server_priority_)) - return 1; - - priority_model_ = RTCORBA::SERVER_DECLARED; - server_priority_ = 0; - - return 0; + return ((in_cdr >> priority_model_) && (in_cdr >> server_priority_)); } // **************************************************************** @@ -455,6 +439,21 @@ TAO_Unix_Domain_Properties::recv_buffer_size (CORBA::Long recv_buffer_size, this->recv_buffer_size_ = recv_buffer_size; } + +CORBA::Boolean +TAO_Unix_Domain_Properties::_tao_encode (TAO_OutputCDR &out_cdr) +{ + return ((out_cdr << this->send_buffer_size_) + && (out_cdr << this->recv_buffer_size_)); +} + +CORBA::Boolean +TAO_Unix_Domain_Properties::_tao_decode (TAO_InputCDR &in_cdr) +{ + return ((in_cdr >> this->send_buffer_size_) + && (in_cdr >> this->recv_buffer_size_)); +} + // **************************************************************** TAO_SMEM_Properties::TAO_SMEM_Properties (void) @@ -514,6 +513,26 @@ TAO_SMEM_Properties::mmap_lockname (const char * mmap_lockname, this->mmap_lockname_.set (mmap_lockname); } +CORBA::Boolean +TAO_SMEM_Properties::_tao_encode (TAO_OutputCDR &out_cdr) +{ + return ((out_cdr << this->preallocate_buffer_size_) + && + (out_cdr << this->mmap_filename_) + && + (out_cdr << this->mmap_lockname_)); +} + +CORBA::Boolean +TAO_SMEM_Properties::_tao_decode (TAO_InputCDR &in_cdr) +{ + return ((in_cdr >> this->preallocate_buffer_size_) + && + (in_cdr >> this->mmap_filename_) + && + (in_cdr >> this->mmap_lockname_)); +} + // **************************************************************** TAO_ServerProtocolPolicy::TAO_ServerProtocolPolicy (const @@ -687,12 +706,12 @@ TAO_ClientProtocolPolicy::_tao_decode (TAO_InputCDR &in_cdr) (this->protocols_[i].protocol_type); if (is_read_ok - && (this->protocols_[i].orb_protocol_properties.ptr () == 0)) + && (this->protocols_[i].orb_protocol_properties.ptr () != 0)) is_read_ok = this->protocols_[i].orb_protocol_properties->_tao_decode (in_cdr); if (is_read_ok - && (this->protocols_[i].transport_protocol_properties.ptr () == 0)) + && (this->protocols_[i].transport_protocol_properties.ptr () != 0)) is_read_ok = this->protocols_[i].transport_protocol_properties->_tao_decode (in_cdr); @@ -728,11 +747,14 @@ TAO_GIOP_Properties::_tao_decode (TAO_InputCDR &in_cdr) RTCORBA::ProtocolProperties* TAO_Protocol_Properties_Factory::create_transport_protocol_property (IOP::ProfileId id) -{ +{ RTCORBA::ProtocolProperties* property = 0; if (id == IOP::TAG_INTERNET_IOP) - ACE_NEW_RETURN (property, TAO_TCP_Properties, 0); + + ACE_NEW_RETURN (property, + TAO_TCP_Properties, + 0); return property; } @@ -743,7 +765,10 @@ TAO_Protocol_Properties_Factory::create_orb_protocol_property (IOP::ProfileId id RTCORBA::ProtocolProperties* property = 0; if (id == IOP::TAG_INTERNET_IOP) - ACE_NEW_RETURN (property, TAO_GIOP_Properties, 0); + ACE_NEW_RETURN (property, + TAO_GIOP_Properties, + 0); + return property; } diff --git a/TAO/tao/RT_Policy_i.h b/TAO/tao/RT_Policy_i.h index a8a96674f3c..c089f6c8d22 100644 --- a/TAO/tao/RT_Policy_i.h +++ b/TAO/tao/RT_Policy_i.h @@ -42,11 +42,7 @@ class Policy_Factory; -// @@ Angelo: ACE's automatic documentation tools need to have all the -// base classes in the same line, I hate it too, so just fix it. -class TAO_Export TAO_PriorityModelPolicy : - public RTCORBA::PriorityModelPolicy, - public TAO_Local_RefCounted_Object +class TAO_Export TAO_PriorityModelPolicy : public RTCORBA::PriorityModelPolicy, public TAO_Local_RefCounted_Object { // = TITLE // RTCORBA::PriorityModelPolicy implementation @@ -117,9 +113,7 @@ private: //************************************************************************* -class TAO_Export TAO_ThreadpoolPolicy : - public RTCORBA::ThreadpoolPolicy, - public TAO_Local_RefCounted_Object +class TAO_Export TAO_ThreadpoolPolicy : public RTCORBA::ThreadpoolPolicy, public TAO_Local_RefCounted_Object { // = TITLE // RTCORBA::ThreadpoolPolicy implementation @@ -163,9 +157,7 @@ private: //************************************************************************* -class TAO_Export TAO_PrivateConnectionPolicy : - public RTCORBA::PrivateConnectionPolicy, - public TAO_Local_RefCounted_Object +class TAO_Export TAO_PrivateConnectionPolicy : public RTCORBA::PrivateConnectionPolicy, public TAO_Local_RefCounted_Object { // = TITLE // RTCORBA::PrivateConnectionPolicy implementation @@ -201,9 +193,7 @@ public: //************************************************************************* -class TAO_Export TAO_PriorityBandedConnectionPolicy : - public RTCORBA::PriorityBandedConnectionPolicy, - public TAO_Local_RefCounted_Object +class TAO_Export TAO_PriorityBandedConnectionPolicy : public RTCORBA::PriorityBandedConnectionPolicy, public TAO_Local_RefCounted_Object { // = TITLE // RTCORBA::PriorityBandedConnectionPolicy implementation @@ -270,9 +260,7 @@ private: //************************************************************************* -class TAO_Export TAO_ServerProtocolPolicy : - public RTCORBA::ServerProtocolPolicy, - public TAO_Local_RefCounted_Object +class TAO_Export TAO_ServerProtocolPolicy : public RTCORBA::ServerProtocolPolicy, public TAO_Local_RefCounted_Object { // = TITLE // RTCORBA::ServerProtocolPolicy implementation @@ -322,9 +310,7 @@ private: //************************************************************************* -class TAO_Export TAO_ClientProtocolPolicy : - public RTCORBA::ClientProtocolPolicy, - public TAO_Local_RefCounted_Object +class TAO_Export TAO_ClientProtocolPolicy : public RTCORBA::ClientProtocolPolicy, public TAO_Local_RefCounted_Object { // = TITLE // RTCORBA::ClientProtocolPolicy implementation @@ -389,9 +375,7 @@ private: //************************************************************************* -class TAO_Export TAO_TCP_Properties : - public RTCORBA::TCPProtocolProperties, - public TAO_Local_RefCounted_Object +class TAO_Export TAO_TCP_Properties : public RTCORBA::TCPProtocolProperties, public TAO_Local_RefCounted_Object { // = TITLE @@ -479,9 +463,7 @@ private: //************************************************************************* -class TAO_Export TAO_Unix_Domain_Properties : - public RTCORBA::UnixDomainProtocolProperties, - public TAO_Local_RefCounted_Object +class TAO_Export TAO_Unix_Domain_Properties : public RTCORBA::UnixDomainProtocolProperties, public TAO_Local_RefCounted_Object { // = TITLE // RTCORBA::UnixDomainProtocolProperties implementation. @@ -521,6 +503,21 @@ public: TAO_default_environment ()) ACE_THROW_SPEC (()); + virtual CORBA::Boolean _tao_encode (TAO_OutputCDR &out_cdr); + // This method writes the CDR encapsulation of an instance of + // UnixDomainProperties. This Protocol Property in TAO specific, + // so there is no order of encapsulation specified in the + // RT CORBA Spec. The current implementation encodes the field + // according to the order of declaration (i.e. first is encoded + // send_buffer_size and then recv_buffer_size). + + virtual CORBA::Boolean _tao_decode (TAO_InputCDR &in_cdr); + // This method reads an instance of UnixDomainProperties from + // a CDR encapsulation. This Protocol Property in TAO specific, + // so there is no order of encapsulation specified in the + // RT CORBA Spec. The current implementation expect the field + // according to the order of declaration. + private: // = Attributes. @@ -530,9 +527,7 @@ private: //************************************************************************* -class TAO_Export TAO_SMEM_Properties : - public RTCORBA::SharedMemoryProtocolProperties, - public TAO_Local_RefCounted_Object +class TAO_Export TAO_SMEM_Properties : public RTCORBA::SharedMemoryProtocolProperties, public TAO_Local_RefCounted_Object { // = TITLE // RTCORBA::SharedMemoryProtocolProperties implementation. @@ -580,6 +575,20 @@ public: TAO_default_environment ()) ACE_THROW_SPEC (()); + virtual CORBA::Boolean _tao_encode (TAO_OutputCDR &out_cdr); + // This method writes the CDR encapsulation of an instance of + // SMEMProperties. This Protocol Property in TAO specific, + // so there is no order of encapsulation specified in the + // RT CORBA Spec. The current implementation encodes the field + // according to the order of declaration. + + virtual CORBA::Boolean _tao_decode (TAO_InputCDR &in_cdr); + // This method reads an instance of SMEMProperties from + // a CDR encapsulation. This Protocol Property in TAO specific, + // so there is no order of encapsulation specified in the + // RT CORBA Spec. The current implementation expect the field + // according to the order of declaration. + private: // = Attributes. @@ -590,9 +599,7 @@ private: //************************************************************************* -class TAO_Export TAO_GIOP_Properties : - public RTCORBA::GIOPProtocolProperties, - public TAO_Local_RefCounted_Object +class TAO_Export TAO_GIOP_Properties : public RTCORBA::GIOPProtocolProperties, public TAO_Local_RefCounted_Object { public: virtual ~TAO_GIOP_Properties (); |