3 //=============================================================================
5 * @file target_specification.h
7 * A class that encapsulates the target identification details.
9 * @author Balachandran Natarajan <bala@cs.wustl.edu>
11 //=============================================================================
13 #ifndef TAO_TARGET_SPECIFICATION_H
14 #define TAO_TARGET_SPECIFICATION_H
16 #include /**/ "ace/pre.h"
18 #include /**/ "tao/TAO_Export.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 #include "tao/Basic_Types.h"
26 #if !defined (ACE_LACKS_PRAGMA_ONCE)
28 #endif /* ACE_LACKS_PRAGMA_ONCE */
30 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
44 * @class TAO_Target_Specification
46 * @brief A class to encapsulate all the ways of specifying targets.
48 class TAO_Export TAO_Target_Specification
52 TAO_Target_Specification ();
53 enum TAO_Target_Address
55 // Note that this could be extended for other protocols
61 /// Set the target specification by giving the object key.
62 /// @note Please do not pass in a identifiers that is allocated on
63 /// stack. These methods does not make a copy but holds the pointer
65 void target_specifier (const TAO::ObjectKey
&key
);
67 /// Set the target specification by passing in an IOP::TaggedProfile.
68 void target_specifier (IOP::TaggedProfile
&profile
);
71 * Specify the target by passing in the IOP::IOR with a profile
72 * index. Please see the header file IOPC.h on why a profile index
75 void target_specifier (IOP::IOR
&ior
, CORBA::ULong prof_index
);
78 * Returns the object key after a check of the stored specifier. If
79 * the stored specifier is not of the right type then this would
82 const TAO::ObjectKey
* object_key ();
85 * Returns the IOP::TaggedProfile after a check of the stored specifier. If
86 * the stored specifier is not of the right type then this would
89 const IOP::TaggedProfile
*profile ();
92 * Returns a pointer to IOP::IOR through the parameters and the
93 * index of the selected profile as a return parameter after a check
94 * of the stored specifier. If the stored specifier is not of the
95 * right type then this would return a NULL.
97 CORBA::ULong
iop_ior (IOP::IOR
*&ior
);
99 /// Access the TArget_Address specifier
100 TAO_Target_Address
specifier ();
103 /// The union of all the possibilities
106 TAO::ObjectKey
*object_key_
;
107 IOP::TaggedProfile
*profile_
;
111 /// The enum identifier
112 TAO_Target_Address specifier_
;
114 /// The profile index
115 CORBA::ULong profile_index_
;
118 TAO_END_VERSIONED_NAMESPACE_DECL
120 #if defined (__ACE_INLINE__)
121 #include "tao/target_specification.inl"
122 #endif /* defined INLINE */
124 #include /**/ "ace/post.h"
126 #endif /*TAO_TARGET_SPECIFICATION_H*/