=default for generated implementation copy ctor
[ACE_TAO.git] / TAO / tests / Object_Loader / Loader.cpp
blob582381f75db9af5d4e2fdd4eb7b22253441457bf
1 #include "Loader.h"
2 #include "Test_i.h"
4 Loader::Loader ()
8 CORBA::Object_ptr
9 Loader::create_object (CORBA::ORB_ptr orb,
10 int,
11 ACE_TCHAR *[])
13 try
15 CORBA::Object_var obj =
16 orb->resolve_initial_references ("RootPOA");
18 PortableServer::POA_var poa =
19 PortableServer::POA::_narrow (obj.in ());
21 PortableServer::POAManager_var mgr =
22 poa->the_POAManager ();
24 mgr->activate ();
26 Test_i *test = 0;
27 ACE_NEW_RETURN (test, Test_i (poa.in ()),
28 CORBA::Object::_nil ());
30 PortableServer::ObjectId_var id =
31 poa->activate_object (test);
33 PortableServer::ServantBase_var tmp = test;
34 obj = test->_this ();
36 return obj._retn ();
38 catch (const CORBA::Exception&)
41 return CORBA::Object::_nil ();
44 // ****************************************************************
46 #if 0
47 ACE_STATIC_SVC_DEFINE (Loader,
48 ACE_TEXT ("TAO_Object_Loader"),
49 ACE_SVC_OBJ_T,
50 &ACE_SVC_NAME (Loader),
51 ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
53 #endif /* 0 */
55 ACE_FACTORY_DEFINE (OLT, Loader)