3 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
6 TAO_Target_Specification::TAO_Target_Specification ()
7 :specifier_ (TAO_Target_Specification::Key_Addr),
14 TAO_Target_Specification::target_specifier (const TAO::ObjectKey &key)
16 this->specifier_ = TAO_Target_Specification::Key_Addr;
17 // @@ Bala: this is a good recipe for a crash, if the <key> was on
18 // the stack or is otherwise destroyed then you are in big
20 // @@ Carlos: As suggested by you I have documented that in the
22 // @@ Bala: beware, documentation is good, code that works in
23 // general is better.... but you are probably right in this case, i
24 // suspect this stuff goes right in the critical path, right? So
25 // making a copy of the object key would be too expensive..
26 this->u_.object_key_ = const_cast<TAO::ObjectKey *> (&key);
30 TAO_Target_Specification::target_specifier (IOP::TaggedProfile &profile)
33 this->specifier_ = TAO_Target_Specification::Profile_Addr;
34 this->u_.profile_ = const_cast<IOP::TaggedProfile *> (&profile);
39 TAO_Target_Specification::target_specifier (IOP::IOR &ior,
40 CORBA::ULong prof_index)
42 this->specifier_ = TAO_Target_Specification::Reference_Addr;
43 this->u_.ior_ = const_cast<IOP::IOR *> (&ior);
44 this->profile_index_ = prof_index;
48 ACE_INLINE const TAO::ObjectKey*
49 TAO_Target_Specification::object_key ()
51 if (this->specifier_ == TAO_Target_Specification::Key_Addr)
52 return this->u_.object_key_;
57 ACE_INLINE const IOP::TaggedProfile *
58 TAO_Target_Specification::profile ()
60 if (this->specifier_ == TAO_Target_Specification::Profile_Addr)
61 return this->u_.profile_;
66 ACE_INLINE CORBA::ULong
67 TAO_Target_Specification::iop_ior (IOP::IOR *& ior)
69 if (this->specifier_ == TAO_Target_Specification::Reference_Addr)
72 return this->profile_index_;
79 ACE_INLINE TAO_Target_Specification::TAO_Target_Address
80 TAO_Target_Specification::specifier ()
82 return this->specifier_;
85 TAO_END_VERSIONED_NAMESPACE_DECL