TAO_ClientProtocolPolicy Class Reference

RTCORBA::ClientProtocolPolicy implementation. More...

#include <RT_Policy_i.h>

Inheritance diagram for TAO_ClientProtocolPolicy:

Inheritance graph
[legend]
Collaboration diagram for TAO_ClientProtocolPolicy:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_ClientProtocolPolicy (const RTCORBA::ProtocolList &protocols)
 Constructor.
 TAO_ClientProtocolPolicy (const TAO_ClientProtocolPolicy &rhs)
 Copy constructor.
RTCORBA::ProtocolList & protocols_rep (void)
RTCORBA::ProtocolList * protocols (void)
CORBA::PolicyType policy_type (void)
CORBA::Policy_ptr copy (void)
void destroy (void)
CORBA::Boolean _tao_encode (TAO_OutputCDR &out_cdr)
 This method writes a CDR representation of the current object.
CORBA::Boolean _tao_decode (TAO_InputCDR &in_cdr)
 This method reads the object state from a CDR representation.
TAO_Cached_Policy_Type _tao_cached_type (void) const
TAO_Policy_Scope _tao_scope (void) const

Static Public Member Functions

static CORBA::Policy_ptr create (const CORBA::Any &val)

Protected Member Functions

virtual ~TAO_ClientProtocolPolicy (void)
 TAO_ClientProtocolPolicy (void)

Private Attributes

RTCORBA::ProtocolList protocols_
 Attribute.

Friends

class TAO_RT_PolicyFactory

Detailed Description

RTCORBA::ClientProtocolPolicy implementation.

This policy controls selection and configuration of communication protocols on the client-side of the RT ORB.

Definition at line 349 of file RT_Policy_i.h.


Constructor & Destructor Documentation

TAO_ClientProtocolPolicy::TAO_ClientProtocolPolicy ( const RTCORBA::ProtocolList &  protocols  ) 

Constructor.

Definition at line 506 of file RT_Policy_i.cpp.

00507   : ::CORBA::Object ()
00508   , ::CORBA::Policy ()
00509   , RTCORBA::ClientProtocolPolicy ()
00510   , ::CORBA::LocalObject ()
00511   , protocols_ (protocols)
00512 {
00513 }

TAO_ClientProtocolPolicy::TAO_ClientProtocolPolicy ( const TAO_ClientProtocolPolicy rhs  ) 

Copy constructor.

Definition at line 515 of file RT_Policy_i.cpp.

00516   : ::CORBA::Object ()
00517   , ::CORBA::Policy ()
00518   , RTCORBA::ClientProtocolPolicy ()
00519   , ::CORBA::LocalObject ()
00520   , protocols_ (rhs.protocols_)
00521 {
00522 }

TAO_ClientProtocolPolicy::~TAO_ClientProtocolPolicy ( void   )  [protected, virtual]

Protected destructor to enforce proper memory management of this reference counted object.

Definition at line 524 of file RT_Policy_i.cpp.

00525 {
00526 }

TAO_ClientProtocolPolicy::TAO_ClientProtocolPolicy ( void   )  [protected]

Definition at line 501 of file RT_Policy_i.cpp.

00502 {
00503 }


Member Function Documentation

TAO_Cached_Policy_Type TAO_ClientProtocolPolicy::_tao_cached_type ( void   )  const

Definition at line 580 of file RT_Policy_i.cpp.

References TAO_CACHED_POLICY_RT_CLIENT_PROTOCOL.

00581 {
00582   return TAO_CACHED_POLICY_RT_CLIENT_PROTOCOL;
00583 }

CORBA::Boolean TAO_ClientProtocolPolicy::_tao_decode ( TAO_InputCDR in_cdr  ) 

This method reads the object state from a CDR representation.

Definition at line 613 of file RT_Policy_i.cpp.

References TAO_Protocol_Properties_Factory::create_orb_protocol_property(), TAO_Protocol_Properties_Factory::create_transport_protocol_property(), TAO_InputCDR::orb_core(), and protocols_.

00614 {
00615   CORBA::ULong length;
00616   CORBA::Boolean is_read_ok = in_cdr >> length;
00617 
00618   this->protocols_.length (length);
00619 
00620   for (CORBA::ULong i = 0; (i < length) && is_read_ok; i++)
00621     {
00622       is_read_ok = in_cdr >> this->protocols_[i].protocol_type;
00623 
00624       this->protocols_[i].orb_protocol_properties =
00625         TAO_Protocol_Properties_Factory::create_orb_protocol_property
00626         (this->protocols_[i].protocol_type);
00627 
00628       this->protocols_[i].transport_protocol_properties =
00629         TAO_Protocol_Properties_Factory::create_transport_protocol_property
00630         (this->protocols_[i].protocol_type, in_cdr.orb_core ());
00631 
00632       if (is_read_ok
00633           && (this->protocols_[i].orb_protocol_properties.ptr () != 0))
00634         is_read_ok =
00635           this->protocols_[i].orb_protocol_properties->_tao_decode (in_cdr);
00636 
00637       if (is_read_ok
00638           && (this->protocols_[i].transport_protocol_properties.ptr () != 0))
00639         is_read_ok =
00640           this->protocols_[i].transport_protocol_properties->_tao_decode (in_cdr);
00641 
00642     }
00643 
00644   return is_read_ok;
00645 }

CORBA::Boolean TAO_ClientProtocolPolicy::_tao_encode ( TAO_OutputCDR out_cdr  ) 

This method writes a CDR representation of the current object.

Definition at line 593 of file RT_Policy_i.cpp.

References protocols_.

00594 {
00595   CORBA::Boolean is_write_ok = out_cdr << this->protocols_.length ();
00596 
00597   for (CORBA::ULong i = 0;
00598        (i < this->protocols_.length ()) && is_write_ok;
00599        i++)
00600     {
00601       is_write_ok =
00602         (out_cdr << this->protocols_[i].protocol_type)
00603         &&
00604         this->protocols_[i].orb_protocol_properties->_tao_encode (out_cdr)
00605         &&
00606         this->protocols_[i].transport_protocol_properties->_tao_encode (out_cdr);
00607     }
00608 
00609   return is_write_ok;
00610 }

TAO_Policy_Scope TAO_ClientProtocolPolicy::_tao_scope ( void   )  const

Definition at line 586 of file RT_Policy_i.cpp.

References TAO_POLICY_CLIENT_EXPOSED, and TAO_POLICY_DEFAULT_SCOPE.

00587 {
00588   return static_cast<TAO_Policy_Scope> (TAO_POLICY_DEFAULT_SCOPE |
00589                           TAO_POLICY_CLIENT_EXPOSED);
00590 }

CORBA::Policy_ptr TAO_ClientProtocolPolicy::copy ( void   ) 

Definition at line 563 of file RT_Policy_i.cpp.

References ACE_NEW_THROW_EX, CORBA::COMPLETED_NO, and TAO::VMCID.

00564 {
00565   TAO_ClientProtocolPolicy* tmp = 0;
00566   ACE_NEW_THROW_EX (tmp,
00567                     TAO_ClientProtocolPolicy (*this),
00568                     CORBA::NO_MEMORY (TAO::VMCID,
00569                                       CORBA::COMPLETED_NO));
00570 
00571   return tmp;
00572 }

CORBA::Policy_ptr TAO_ClientProtocolPolicy::create ( const CORBA::Any &  val  )  [static]

Helper method for the implementation of CORBA::ORB::create_policy.

Definition at line 529 of file RT_Policy_i.cpp.

References ACE_NEW_THROW_EX, CORBA::BAD_POLICY_VALUE, CORBA::COMPLETED_NO, and TAO::VMCID.

Referenced by TAO_RT_PolicyFactory::create_policy().

00530 {
00531   RTCORBA::ProtocolList *value = 0;
00532   if ((val >>= value) == 0)
00533     throw ::CORBA::PolicyError (CORBA::BAD_POLICY_VALUE);
00534 
00535   TAO_ClientProtocolPolicy *tmp = 0;
00536   ACE_NEW_THROW_EX (tmp,
00537                     TAO_ClientProtocolPolicy (*value),
00538                     CORBA::NO_MEMORY (TAO::VMCID,
00539                                       CORBA::COMPLETED_NO));
00540 
00541   return tmp;
00542 }

void TAO_ClientProtocolPolicy::destroy ( void   ) 

Definition at line 575 of file RT_Policy_i.cpp.

00576 {
00577 }

CORBA::PolicyType TAO_ClientProtocolPolicy::policy_type ( void   ) 

Definition at line 557 of file RT_Policy_i.cpp.

00558 {
00559   return RTCORBA::CLIENT_PROTOCOL_POLICY_TYPE;
00560 }

RTCORBA::ProtocolList * TAO_ClientProtocolPolicy::protocols ( void   ) 

Definition at line 545 of file RT_Policy_i.cpp.

References ACE_NEW_THROW_EX, CORBA::COMPLETED_NO, and TAO::VMCID.

00546 {
00547   RTCORBA::ProtocolList *tmp = 0;
00548   ACE_NEW_THROW_EX (tmp,
00549                     RTCORBA::ProtocolList (this->protocols_),
00550                     CORBA::NO_MEMORY (TAO::VMCID,
00551                                       CORBA::COMPLETED_NO));
00552 
00553   return tmp;
00554 }

RTCORBA::ProtocolList & TAO_ClientProtocolPolicy::protocols_rep ( void   ) 

Accessor to the underlying protocols list of the policy (does not make a copy like the idl accessor <protocols> implementation below.)

Definition at line 648 of file RT_Policy_i.cpp.

References protocols_.

Referenced by TAO_RT_Protocols_Hooks::client_protocol_properties().

00649 {
00650   return protocols_;
00651 }


Friends And Related Function Documentation

friend class TAO_RT_PolicyFactory [friend]

This constructor is used by TAO_RT_PolicyFactory when decoding policies from tagged components in an IOR.

Definition at line 402 of file RT_Policy_i.h.


Member Data Documentation

RTCORBA::ProtocolList TAO_ClientProtocolPolicy::protocols_ [private]

Attribute.

Definition at line 408 of file RT_Policy_i.h.

Referenced by _tao_decode(), _tao_encode(), and protocols_rep().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:42:56 2010 for TAO_RTCORBA by  doxygen 1.4.7