Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / TransportCurrent / Current_ORBInitializer_Base.cpp
blob4a73c4c664172fb709215acf60ad02aa45ff83fe
2 #include "tao/PI/ORBInitInfo.h"
3 #include "tao/TransportCurrent/Current_ORBInitializer_Base.h"
5 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
7 namespace TAO
9 namespace Transport
11 Current_ORBInitializer_Base::Current_ORBInitializer_Base(const ACE_TCHAR* id)
12 : id_ (id)
14 // do nothing
17 Current_ORBInitializer_Base::~Current_ORBInitializer_Base()
19 // do nothing
23 void
24 Current_ORBInitializer_Base::pre_init (
25 PortableInterceptor::ORBInitInfo_ptr info)
27 // Narrow to a TAO_ORBInitInfo object to get access to the
28 // allocate_tss_slot_id() TAO extension.
29 TAO_ORBInitInfo_var tao_info =
30 TAO_ORBInitInfo::_narrow (info);
32 if (CORBA::is_nil (tao_info.in ()))
34 if (TAO_debug_level > 0)
35 TAOLIB_ERROR ((LM_ERROR,
36 "TAO (%P|%t) TAO::Transport::ORBInitializer::pre_init - "
37 "Panic: unable to narrow the ORBInitInfo_ptr\n"));
39 throw ::CORBA::INTERNAL ();
42 // Reserve a TSS slot in the ORB core internal TSS resources for the
43 // thread-specific portion of the Current object.
44 size_t tss_slot = tao_info->allocate_tss_slot_id (0);
46 // Create the Current
47 Current_var current (this->make_current_instance (tao_info->orb_core (),
48 tss_slot));
50 info->register_initial_reference (ACE_TEXT_ALWAYS_CHAR (this->id_.fast_rep ()),
51 current.in ());
54 void
55 Current_ORBInitializer_Base::post_init (
56 PortableInterceptor::ORBInitInfo_ptr)
58 // do nothing
65 TAO_END_VERSIONED_NAMESPACE_DECL