Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

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 Methods

 TAO_Target_Specification (void)
 Ctor. More...

void target_specifier (const TAO_ObjectKey &key)
 Set the target specification by giving the object key. More...

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

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


Private Attributes

union {
   TAO_ObjectKey *   object_key_
   IOP::TaggedProfile *   profile_
   IOP::IOR *   ior_
u_
TAO_Target_Address specifier_
 The enum identifier. More...

CORBA::ULong profile_index_
 The profile index. More...


Detailed Description

A class to encapsulate all the ways of specifying targets.

@ Bala: do we have examples of how other protocols map object keys? @ Carlos: The way HTTP-NG does is not quite intuitive. But they too have a sequnce of Octet which more or less fits this model. You are also allowed to specify is a Cache Index (14 bits). I think that can also be worked out and shouldn't be a big deal. @ Bala:What if they pass something around that does not fit this model? @ Carlos:As long as we dont know it is ok. But then if we get to some point where we have something floating around, obviously we would have well defined data structure in TAO. BTW, in IMHO it is not possible for me to think the myriad data structures that a designer can come up with. So, I can look ahead possibily a couple of days but not a life time :-) But you have a good question though. Please sont remove these discussions. It could be useful for someone someday.

Definition at line 50 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 72 of file target_specification.h.

00073   {
00074     // Note that this could be extended for other protocols
00075     Key_Addr = 0,
00076     Profile_Addr,
00077     Reference_Addr
00078   };


Constructor & Destructor Documentation

ACE_INLINE TAO_Target_Specification::TAO_Target_Specification void   
 

Ctor.

Definition at line 6 of file target_specification.i.

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


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 70 of file target_specification.i.

References profile_index_, Reference_Addr, specifier_, and u_.

Referenced by TAO_GIOP_Message_Generator_Parser_12::marshall_target_spec.

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

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 52 of file target_specification.i.

References Key_Addr, specifier_, and u_.

Referenced by TAO_GIOP_Message_Generator_Parser_12::marshall_target_spec, TAO_GIOP_Message_Generator_Parser_10::write_locate_request_header, and TAO_GIOP_Message_Generator_Parser_10::write_request_header.

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

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 61 of file target_specification.i.

References Profile_Addr, specifier_, and u_.

Referenced by TAO_GIOP_Message_Generator_Parser_12::marshall_target_spec.

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

ACE_INLINE TAO_Target_Specification::TAO_Target_Address TAO_Target_Specification::specifier void   
 

Access the TArget_Address specifier.

Definition at line 83 of file target_specification.i.

References specifier_.

Referenced by TAO_GIOP_Message_Generator_Parser_12::marshall_target_spec.

00084 {
00085   return this->specifier_;
00086 }

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 profile_index_, Reference_Addr, specifier_, and u_.

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

ACE_INLINE void TAO_Target_Specification::target_specifier IOP::TaggedProfile   profile
 

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

Definition at line 31 of file target_specification.i.

References Profile_Addr, specifier_, and u_.

00033 {
00034   this->specifier_ = TAO_Target_Specification::Profile_Addr;
00035   this->u_.profile_ = ACE_const_cast (IOP::TaggedProfile *,
00036                                       &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 14 of file target_specification.i.

References Key_Addr, specifier_, and u_.

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


Member Data Documentation

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

Definition at line 129 of file target_specification.h.

TAO_ObjectKey* TAO_Target_Specification::object_key_ [private]
 

Definition at line 127 of file target_specification.h.

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

Definition at line 128 of file target_specification.h.

CORBA::ULong TAO_Target_Specification::profile_index_ [private]
 

The profile index.

Definition at line 137 of file target_specification.h.

Referenced by iop_ior, and target_specifier.

TAO_Target_Address TAO_Target_Specification::specifier_ [private]
 

The enum identifier.

Definition at line 134 of file target_specification.h.

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

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

Referenced by iop_ior, object_key, profile, and target_specifier.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 15:42:00 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002