Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / orbsvcs / performance-tests / RTEvent / lib / RTPOA_Setup.cpp
blob5ba0b8bf411917f1f5884fabf96a7196b853fd27
1 /**
2 * @file RTPOA_Setup.cpp
4 * @author Carlos O'Ryan <coryan@uci.edu>
5 */
7 #include "RTPOA_Setup.h"
8 #include "RIR_Narrow.h"
9 #include "RTCORBA_Setup.h"
10 #include "tao/RTCORBA/RTCORBA.h"
12 #include "ace/Log_Msg.h"
14 #if !defined(__ACE_INLINE__)
15 #include "RTPOA_Setup.inl"
16 #endif /* __ACE_INLINE__ */
18 RTPOA_Setup::RTPOA_Setup (CORBA::ORB_ptr orb,
19 const RTCORBA_Setup &rtcorba_setup)
21 RTPortableServer::POA_var root_poa =
22 RIR_Narrow<RTPortableServer::POA>::resolve (orb,
23 "RootPOA");
25 RTCORBA::RTORB_var rtorb =
26 RIR_Narrow<RTCORBA::RTORB>::resolve (orb,
27 "RTORB");
29 const CORBA::ULong stacksize = 1024 * 1024; // 1 Mb
30 const RTCORBA::ThreadpoolLanes &lanes = rtcorba_setup.lanes ();
31 const CORBA::Boolean allow_borrowing = 0;
32 const CORBA::Boolean allow_request_buffering = 0;
33 const CORBA::ULong max_buffered_requests = 0; // dummy value
34 const CORBA::ULong max_request_buffer_size = 0; // dummy value
36 RTCORBA::ThreadpoolId pool_id =
37 rtorb->create_threadpool_with_lanes (stacksize,
38 lanes,
39 allow_borrowing,
40 allow_request_buffering,
41 max_buffered_requests,
42 max_request_buffer_size);
44 // @@ We need an 'auto_ptr for thread pools' here!
45 CORBA::PolicyList policies (4); policies.length (4);
46 policies[0] =
47 rtorb->create_priority_model_policy (RTCORBA::CLIENT_PROPAGATED,
48 rtcorba_setup.process_priority ());
50 policies[1] =
51 root_poa->create_id_assignment_policy (PortableServer::SYSTEM_ID);
53 policies[2] =
54 root_poa->create_implicit_activation_policy (PortableServer::IMPLICIT_ACTIVATION);
56 #if 0
57 policies.length (3);
58 #else
59 policies[3] =
60 rtorb->create_threadpool_policy (pool_id);
61 #endif /* 0 */
63 PortableServer::POAManager_var poa_manager =
64 root_poa->the_POAManager ();
66 this->poa_ =
67 root_poa->create_POA ("RTEC_Perf",
68 poa_manager.in (),
69 policies);
71 for (CORBA::ULong i = 0; i != policies.length (); ++i)
73 policies[i]->destroy ();