Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | Friends

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 348 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.

  : ::CORBA::Object ()
  , ::CORBA::Policy ()
  , RTCORBA::ClientProtocolPolicy ()
  , ::CORBA::LocalObject ()
  , protocols_ (protocols)
{
}

TAO_ClientProtocolPolicy::TAO_ClientProtocolPolicy ( const TAO_ClientProtocolPolicy rhs  ) 

Copy constructor.

Definition at line 515 of file RT_Policy_i.cpp.

  : ::CORBA::Object ()
  , ::CORBA::Policy ()
  , RTCORBA::ClientProtocolPolicy ()
  , ::CORBA::LocalObject ()
  , protocols_ (rhs.protocols_)
{
}

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.

{
}

TAO_ClientProtocolPolicy::TAO_ClientProtocolPolicy ( void   )  [protected]

Definition at line 501 of file RT_Policy_i.cpp.

{
}


Member Function Documentation

TAO_Cached_Policy_Type TAO_ClientProtocolPolicy::_tao_cached_type ( void   )  const

Definition at line 580 of file RT_Policy_i.cpp.

{
  return TAO_CACHED_POLICY_RT_CLIENT_PROTOCOL;
}

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.

{
  CORBA::ULong length;
  CORBA::Boolean is_read_ok = in_cdr >> length;

  this->protocols_.length (length);

  for (CORBA::ULong i = 0; (i < length) && is_read_ok; i++)
    {
      is_read_ok = in_cdr >> this->protocols_[i].protocol_type;

      this->protocols_[i].orb_protocol_properties =
        TAO_Protocol_Properties_Factory::create_orb_protocol_property
        (this->protocols_[i].protocol_type);

      this->protocols_[i].transport_protocol_properties =
        TAO_Protocol_Properties_Factory::create_transport_protocol_property
        (this->protocols_[i].protocol_type, in_cdr.orb_core ());

      if (is_read_ok
          && (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))
        is_read_ok =
          this->protocols_[i].transport_protocol_properties->_tao_decode (in_cdr);

    }

  return is_read_ok;
}

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.

{
  CORBA::Boolean is_write_ok = out_cdr << this->protocols_.length ();

  for (CORBA::ULong i = 0;
       (i < this->protocols_.length ()) && is_write_ok;
       i++)
    {
      is_write_ok =
        (out_cdr << this->protocols_[i].protocol_type)
        &&
        this->protocols_[i].orb_protocol_properties->_tao_encode (out_cdr)
        &&
        this->protocols_[i].transport_protocol_properties->_tao_encode (out_cdr);
    }

  return is_write_ok;
}

TAO_Policy_Scope TAO_ClientProtocolPolicy::_tao_scope ( void   )  const

Definition at line 586 of file RT_Policy_i.cpp.

{
  return static_cast<TAO_Policy_Scope> (TAO_POLICY_DEFAULT_SCOPE |
                          TAO_POLICY_CLIENT_EXPOSED);
}

CORBA::Policy_ptr TAO_ClientProtocolPolicy::copy ( void   ) 

Definition at line 563 of file RT_Policy_i.cpp.

{
  TAO_ClientProtocolPolicy* tmp = 0;
  ACE_NEW_THROW_EX (tmp,
                    TAO_ClientProtocolPolicy (*this),
                    CORBA::NO_MEMORY (TAO::VMCID,
                                      CORBA::COMPLETED_NO));

  return tmp;
}

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.

{
  RTCORBA::ProtocolList *value = 0;
  if (!(val >>= value))
    throw ::CORBA::PolicyError (CORBA::BAD_POLICY_VALUE);

  TAO_ClientProtocolPolicy *tmp = 0;
  ACE_NEW_THROW_EX (tmp,
                    TAO_ClientProtocolPolicy (*value),
                    CORBA::NO_MEMORY (TAO::VMCID,
                                      CORBA::COMPLETED_NO));

  return tmp;
}

void TAO_ClientProtocolPolicy::destroy ( void   ) 

Definition at line 575 of file RT_Policy_i.cpp.

{
}

CORBA::PolicyType TAO_ClientProtocolPolicy::policy_type ( void   ) 

Definition at line 557 of file RT_Policy_i.cpp.

{
  return RTCORBA::CLIENT_PROTOCOL_POLICY_TYPE;
}

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

Definition at line 545 of file RT_Policy_i.cpp.

{
  RTCORBA::ProtocolList *tmp = 0;
  ACE_NEW_THROW_EX (tmp,
                    RTCORBA::ProtocolList (this->protocols_),
                    CORBA::NO_MEMORY (TAO::VMCID,
                                      CORBA::COMPLETED_NO));

  return tmp;
}

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.

{
  return protocols_;
}


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 400 of file RT_Policy_i.h.


Member Data Documentation

RTCORBA::ProtocolList TAO_ClientProtocolPolicy::protocols_ [private]

Attribute.

Definition at line 406 of file RT_Policy_i.h.


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