Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / orbsvcs / performance-tests / RTEvent / lib / SyncScope_Setup.cpp
blobc45d24df28d5fab5fb07ade7e83fd9a0f5d8c7da
1 /**
2 * @file SyncScope_Setup.cpp
4 * @author Carlos O'Ryan <coryan@uci.edu>
5 */
7 #include "SyncScope_Setup.h"
8 #include "RIR_Narrow.h"
9 #include "tao/AnyTypeCode/Any.h"
11 SyncScope_Setup::SyncScope_Setup (CORBA::ORB_ptr orb,
12 Messaging::SyncScope value)
14 this->init (orb, value);
17 SyncScope_Setup::SyncScope_Setup (CORBA::ORB_ptr orb)
19 this->init (orb, Messaging::SYNC_WITH_TARGET);
22 void
23 SyncScope_Setup::init (CORBA::ORB_ptr orb,
24 Messaging::SyncScope value)
26 CORBA::PolicyManager_var policy_manager =
27 RIR_Narrow<CORBA::PolicyManager>::resolve (orb,
28 "ORBPolicyManager");
30 CORBA::PolicyList policy_list (1);
31 policy_list.length (1);
33 CORBA::Any sync_scope;
34 sync_scope <<= value;
36 // @@ We need a helper class that automatically calls the
37 // destroy() method on each policy...
38 policy_list[0] =
39 orb->create_policy (Messaging::SYNC_SCOPE_POLICY_TYPE,
40 sync_scope);
41 policy_manager->set_policy_overrides (policy_list,
42 CORBA::ADD_OVERRIDE);
44 policy_list[0]->destroy ();
47 SyncScope_Setup::~SyncScope_Setup ()