TAO_Target_Specification Class Reference

A class to encapsulate all the ways of specifying targets. More...

#include <target_specification.h>

Collaboration diagram for TAO_Target_Specification:

Collaboration graph
[legend]
List of all members.

Public Types

enum  TAO_Target_Address { Key_Addr = 0, Profile_Addr, Reference_Addr }

Public Member Functions

 TAO_Target_Specification (void)
 Ctor.

void target_specifier (const TAO::ObjectKey &key)
 Set the target specification by giving the object key.

void target_specifier (IOP::TaggedProfile &profile)
 Set the target specification by passing in an IOP::TaggedProfile.

void target_specifier (IOP::IOR &ior, CORBA::ULong prof_index)
const TAO::ObjectKeyobject_key (void)
const IOP::TaggedProfileprofile (void)
CORBA::ULong iop_ior (IOP::IOR *&ior)
TAO_Target_Address specifier (void)
 Access the TArget_Address specifier.


Private Attributes

union {
   TAO::ObjectKey *   object_key_
   IOP::TaggedProfile *   profile_
   IOP::IOR *   ior_
u_
 The union of all the possibilities.

TAO_Target_Address specifier_
 The enum identifier.

CORBA::ULong profile_index_
 The profile index.


Detailed Description

A class to encapsulate all the ways of specifying targets.

Definition at line 57 of file target_specification.h.


Member Enumeration Documentation

enum TAO_Target_Specification::TAO_Target_Address
 

Enumeration values:
Key_Addr 
Profile_Addr 
Reference_Addr 

Definition at line 63 of file target_specification.h.

00064   {
00065     // Note that this could be extended for other protocols
00066     Key_Addr = 0,
00067     Profile_Addr,
00068     Reference_Addr
00069   };


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE TAO_Target_Specification::TAO_Target_Specification void   ) 
 

Ctor.

Definition at line 8 of file target_specification.i.

00009   :specifier_ (TAO_Target_Specification::Key_Addr),
00010    profile_index_ (0)
00011 {
00012   //no-op
00013 }


Member Function Documentation

ACE_INLINE CORBA::ULong TAO_Target_Specification::iop_ior IOP::IOR *&  ior  ) 
 

Returns a pointer to IOP::IOR through the parameters and the index of the selected profile as a return parameter after a check of the stored specifier. If the stored specifier is not of the right type then this would return a NULL.

Definition at line 69 of file target_specification.i.

References Reference_Addr, and specifier_.

Referenced by TAO_GIOP_Message_Generator_Parser_12::marshall_target_spec().

00070 {
00071   if (this->specifier_ == TAO_Target_Specification::Reference_Addr)
00072     {
00073       ior = this->u_.ior_;
00074       return this->profile_index_;
00075     }
00076 
00077   ior = 0;
00078   return 0;
00079 }

ACE_INLINE const TAO::ObjectKey * TAO_Target_Specification::object_key void   ) 
 

Returns the object key after a check of the stored specifier. If the stored specifier is not of the right type then this would return a NULL

Definition at line 51 of file target_specification.i.

References Key_Addr, and specifier_.

Referenced by TAO_GIOP_Message_Generator_Parser_12::marshall_target_spec(), TAO_GIOP_Message_Lite::write_locate_request_header(), TAO_GIOP_Message_Generator_Parser_10::write_locate_request_header(), TAO_GIOP_Message_Lite::write_request_header(), and TAO_GIOP_Message_Generator_Parser_10::write_request_header().

00052 {
00053   if (this->specifier_ == TAO_Target_Specification::Key_Addr)
00054     return this->u_.object_key_;
00055 
00056   return 0;
00057 }

ACE_INLINE const IOP::TaggedProfile * TAO_Target_Specification::profile void   ) 
 

Returns the IOP::TaggedProfile after a check of the stored specifier. If the stored specifier is not of the right type then this would return a NULL

Definition at line 60 of file target_specification.i.

References Profile_Addr, and specifier_.

Referenced by TAO_GIOP_Message_Generator_Parser_12::marshall_target_spec().

00061 {
00062   if (this->specifier_ == TAO_Target_Specification::Profile_Addr)
00063     return this->u_.profile_;
00064 
00065   return 0;
00066 }

ACE_INLINE TAO_Target_Specification::TAO_Target_Address TAO_Target_Specification::specifier void   ) 
 

Access the TArget_Address specifier.

Definition at line 82 of file target_specification.i.

References specifier_.

Referenced by TAO_GIOP_Message_Generator_Parser_12::marshall_target_spec().

00083 {
00084   return this->specifier_;
00085 }

ACE_INLINE void TAO_Target_Specification::target_specifier IOP::IOR ior,
CORBA::ULong  prof_index
 

Specify the target by passing in the IOP::IOR with a profile index. Please see the header file IOPC.h on why a profile index is required.

Definition at line 41 of file target_specification.i.

References Reference_Addr, and specifier_.

00043 {
00044   this->specifier_ = TAO_Target_Specification::Reference_Addr;
00045   this->u_.ior_ = const_cast<IOP::IOR *> (&ior);
00046   this->profile_index_ = prof_index;
00047 
00048 }

ACE_INLINE void TAO_Target_Specification::target_specifier IOP::TaggedProfile profile  ) 
 

Set the target specification by passing in an IOP::TaggedProfile.

Definition at line 32 of file target_specification.i.

References Profile_Addr, and specifier_.

00034 {
00035   this->specifier_ = TAO_Target_Specification::Profile_Addr;
00036   this->u_.profile_ = const_cast<IOP::TaggedProfile *> (&profile);
00037 
00038 }

ACE_INLINE void TAO_Target_Specification::target_specifier const TAO::ObjectKey key  ) 
 

Set the target specification by giving the object key.

Definition at line 16 of file target_specification.i.

References Key_Addr, and specifier_.

00017 {
00018   this->specifier_ = TAO_Target_Specification::Key_Addr;
00019   // @@ Bala: this is a good recipe for a crash, if the <key> was on
00020   //    the stack or is otherwise destroyed then you are in big
00021   //    trouble.
00022   // @@ Carlos: As suggested by you I have documented that in the
00023   //    headerfile.
00024   // @@ Bala: beware, documentation is good, code that works in
00025   // general is better....  but you are probably right in this case, i
00026   // suspect this stuff goes right in the critical path, right? So
00027   // making a copy of the object key would be too expensive..
00028   this->u_.object_key_ = const_cast<TAO::ObjectKey *> (&key);
00029 }


Member Data Documentation

IOP::IOR* TAO_Target_Specification::ior_ [private]
 

Definition at line 121 of file target_specification.h.

TAO::ObjectKey* TAO_Target_Specification::object_key_ [private]
 

Definition at line 119 of file target_specification.h.

IOP::TaggedProfile* TAO_Target_Specification::profile_ [private]
 

Definition at line 120 of file target_specification.h.

CORBA::ULong TAO_Target_Specification::profile_index_ [private]
 

The profile index.

Definition at line 128 of file target_specification.h.

TAO_Target_Address TAO_Target_Specification::specifier_ [private]
 

The enum identifier.

Definition at line 125 of file target_specification.h.

Referenced by iop_ior(), object_key(), profile(), specifier(), and target_specifier().

union { ... } TAO_Target_Specification::u_ [private]
 

The union of all the possibilities.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 12:23:53 2006 for TAO by doxygen 1.3.6