Public Member Functions | Private Member Functions | Private Attributes | Friends

TAO_Tagged_Profile Class Reference

This class is used to manipulate and access the target address field of a GIOP 1.2 request. More...

#include <Tagged_Profile.h>

Collaboration diagram for TAO_Tagged_Profile:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TAO_Tagged_Profile (TAO_ORB_Core *orb_core)
 Ctor.
CORBA::Boolean unmarshall_target_address (TAO_InputCDR &cdr)
 Unmarshal the GIOP 1.2 target address field.
CORBA::Boolean unmarshall_object_key (TAO_InputCDR &cdr)
 Unmarshals the received object key for GIOP 1.0/1.1.
TAO::ObjectKey & object_key (void)
 Return the object key.
void object_key (TAO::ObjectKey &object_key)
 Save the object key.
const TAO::ObjectKey & object_key (void) const
 Return a const object key.
const IOP::TaggedProfile & tagged_profile (void) const
 Get the tagged_profile.
CORBA::ULong profile_index (void) const
const char * type_id (void) const
CORBA::Short discriminator (void) const

Private Member Functions

CORBA::Boolean extract_object_key (IOP::TaggedProfile &profile)
CORBA::Boolean unmarshall_object_key_i (TAO_InputCDR &cdr)
 Unmarshals the received object key.
CORBA::Boolean unmarshall_iop_profile_i (TAO_InputCDR &cdr)
 Unmarshall the IOP::TaggedProfile.
CORBA::Boolean unmarshall_ref_addr_i (TAO_InputCDR &cdr)
 Unmarshalls the GIOP::IORAddressingInfo.

Private Attributes

TAO_ORB_Coreorb_core_
 Our ORB Core.
CORBA::Short discriminator_
 Keep track of which kind of target profile that was extracted.
CORBA::Boolean object_key_extracted_
 Flag to denote whether the object key has been extracted yet.
TAO::ObjectKey object_key_
 The object key.
IOP::TaggedProfile profile_
 The Tagged profile. This class would have the Tagged Profile.
CORBA::ULong profile_index_
const char * type_id_

Friends

class TAO::CSD::FW_Server_Request_Wrapper

Detailed Description

This class is used to manipulate and access the target address field of a GIOP 1.2 request.

Definition at line 44 of file Tagged_Profile.h.


Constructor & Destructor Documentation

TAO_Tagged_Profile::TAO_Tagged_Profile ( TAO_ORB_Core orb_core  ) 

Ctor.

Definition at line 8 of file Tagged_Profile.inl.

  : orb_core_ (orb_core),
    discriminator_ (0),
    object_key_extracted_ (false),
    object_key_ (),
    profile_ (),
    profile_index_ (0),
    type_id_ (0)
{

}


Member Function Documentation

CORBA::Short TAO_Tagged_Profile::discriminator ( void   )  const

Definition at line 63 of file Tagged_Profile.inl.

{
  return this->discriminator_;
}

CORBA::Boolean TAO_Tagged_Profile::extract_object_key ( IOP::TaggedProfile &  profile  )  [private]

Extract the object key from the TaggedProfile and store it in <object_key_>

Definition at line 23 of file Tagged_Profile.cpp.

{
  // Get our Acceptor registry
  TAO_Acceptor_Registry &acceptor_registry =
    this->orb_core_->lane_resources ().acceptor_registry ();

  // Get the right acceptor for the tag in the TaggedProfile
  TAO_Acceptor *acceptor = acceptor_registry.get_acceptor (profile.tag);

  if (acceptor)
    {
      // Get the object key
      if (acceptor->object_key (profile, this->object_key_) == -1)
        {
          return false;
        }
    }
  else
    {
      if (TAO_debug_level)
        {
          ACE_ERROR ((LM_ERROR,
                      ACE_TEXT ("(%P|%t)TAO_Tagged_Profile\n")));
        }

      return false;
    }

  return true;
}

void TAO_Tagged_Profile::object_key ( TAO::ObjectKey &  object_key  ) 

Save the object key.

Definition at line 30 of file Tagged_Profile.inl.

{
  this->object_key_.replace (object_key.length (),
                             object_key.length (),
                             object_key.get_buffer ());
  this->object_key_extracted_ = true;
}

TAO::ObjectKey & TAO_Tagged_Profile::object_key ( void   ) 

Return the object key.

Definition at line 21 of file Tagged_Profile.inl.

{
  if (!this->object_key_extracted_)
    this->object_key_extracted_ = this->extract_object_key (this->profile_);

  return this->object_key_;
}

const TAO::ObjectKey & TAO_Tagged_Profile::object_key ( void   )  const

Return a const object key.

Definition at line 39 of file Tagged_Profile.inl.

{
  return const_cast<TAO_Tagged_Profile *> (this)->object_key ();
}

CORBA::ULong TAO_Tagged_Profile::profile_index ( void   )  const

Get the profile index, that needs to be used in the sequnce of TaggedProfiles contained IOP::IOR that is received from the client.

Definition at line 51 of file Tagged_Profile.inl.

{
  return this->profile_index_;
}

const IOP::TaggedProfile & TAO_Tagged_Profile::tagged_profile ( void   )  const

Get the tagged_profile.

Definition at line 45 of file Tagged_Profile.inl.

{
  return this->profile_;
}

const char * TAO_Tagged_Profile::type_id ( void   )  const

Accessor to the type_id contained in the IOP::IOR received from the client.

Definition at line 57 of file Tagged_Profile.inl.

{
  return this->type_id_ == 0 ? "" : this->type_id_;
}

CORBA::Boolean TAO_Tagged_Profile::unmarshall_iop_profile_i ( TAO_InputCDR cdr  )  [private]

Unmarshall the IOP::TaggedProfile.

Definition at line 117 of file Tagged_Profile.cpp.

{
  CORBA::Boolean hdr_status = (CORBA::Boolean) input.good_bit ();

  // Extract into the IOP::Tagged profile.
  hdr_status &= input >> this->profile_;

  return hdr_status;
}

CORBA::Boolean TAO_Tagged_Profile::unmarshall_object_key ( TAO_InputCDR cdr  ) 

Unmarshals the received object key for GIOP 1.0/1.1.

Definition at line 85 of file Tagged_Profile.cpp.

{
  this->discriminator_ = TAO_Target_Specification::Key_Addr;

  return this->unmarshall_object_key_i (input);
}

CORBA::Boolean TAO_Tagged_Profile::unmarshall_object_key_i ( TAO_InputCDR cdr  )  [private]

Unmarshals the received object key.

Definition at line 94 of file Tagged_Profile.cpp.

{
  CORBA::Boolean hdr_status = (CORBA::Boolean) input.good_bit ();

  CORBA::Long key_length = 0;
  hdr_status = hdr_status && input.read_long (key_length);

  if (hdr_status)
    {
      this->object_key_.replace (key_length,
                                 key_length,
                                 (CORBA::Octet*)input.rd_ptr (),
                                 0);
      input.skip_bytes (key_length);

      this->object_key_extracted_ = true;
    }

  return hdr_status;
}

CORBA::Boolean TAO_Tagged_Profile::unmarshall_ref_addr_i ( TAO_InputCDR cdr  )  [private]

Unmarshalls the GIOP::IORAddressingInfo.

Definition at line 128 of file Tagged_Profile.cpp.

{
  CORBA::Boolean hdr_status = (CORBA::Boolean) input.good_bit ();

  /*
   * The GIOP::IORAddressingInfo is defined as follows
   *   struct IORAddressingInfo
   *     {
   *       unsigned long selected_profile_index;
   *       IOP::IOR ior;
   *     };
   *
   * and the IOP::IOR is defined to be
   *   struct IOR
   *      {
   *        string type_id;
   *        sequence<TaggedProfile>   profiles;
   *      };
   */

  // First read the profile index
  CORBA::ULong prof_index =  0;

  hdr_status = hdr_status && input.read_ulong (prof_index);

  // Set the value in TAO_Tagged_Profile
  if (hdr_status)
    {
      this->profile_index_ = prof_index;
    }

  // Get the length of the type_id
  CORBA::Long id_length = 0;
  hdr_status = hdr_status && input.read_long (id_length);

  if (hdr_status)
    {
      // Set the type_id (it is not owned by this object)
      this->type_id_ = input.rd_ptr ();

      input.skip_bytes (id_length);
    }

  // Unmarshall the sequnce of TaggedProfiles
  IOP::TaggedProfileSeq ior_profiles;

  hdr_status &= input >> ior_profiles;

  // Get the right TaggedProfile from the <ior_profiles>
  if (hdr_status)
    {
      this->profile_ = ior_profiles [prof_index];
    }

  return hdr_status;
}

CORBA::Boolean TAO_Tagged_Profile::unmarshall_target_address ( TAO_InputCDR cdr  ) 

Unmarshal the GIOP 1.2 target address field.

Definition at line 55 of file Tagged_Profile.cpp.

{
  CORBA::Boolean hdr_status = cdr.read_short (this->discriminator_);

  if (hdr_status)
    {
      switch (this->discriminator_)
        {
        case TAO_Target_Specification::Key_Addr:
          hdr_status = this->unmarshall_object_key_i (cdr);
          break;

        case TAO_Target_Specification::Profile_Addr:
          hdr_status = this->unmarshall_iop_profile_i (cdr);
          break;

        case TAO_Target_Specification::Reference_Addr:
          hdr_status = this->unmarshall_ref_addr_i (cdr);
          break;

        default:
          hdr_status = false;
          break;
        }
    }

  return hdr_status;
}


Friends And Related Function Documentation

friend class TAO::CSD::FW_Server_Request_Wrapper [friend]

Declare FW_Server_Request_Wrapper a friend This friendship makes the FW_Server_Request_Wrapper be able to clone the TAO_Tagged_Profile data member in TAO_ServerRequest.

Definition at line 51 of file Tagged_Profile.h.


Member Data Documentation

Keep track of which kind of target profile that was extracted.

Definition at line 104 of file Tagged_Profile.h.

TAO::ObjectKey TAO_Tagged_Profile::object_key_ [private]

The object key.

Definition at line 110 of file Tagged_Profile.h.

Flag to denote whether the object key has been extracted yet.

Definition at line 107 of file Tagged_Profile.h.

Our ORB Core.

Definition at line 101 of file Tagged_Profile.h.

IOP::TaggedProfile TAO_Tagged_Profile::profile_ [private]

The Tagged profile. This class would have the Tagged Profile.

Definition at line 113 of file Tagged_Profile.h.

The profile index incase we receive a GIOP::IORAddressingInfo information

Definition at line 139 of file Tagged_Profile.h.

const char* TAO_Tagged_Profile::type_id_ [private]

The type_id in the IOP::IOR in case we receive the GIOP::IORAddressingInfo information.

Definition at line 143 of file Tagged_Profile.h.


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