2 * @file SyncScope_Setup.cpp
4 * @author Carlos O'Ryan <coryan@uci.edu>
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
);
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
,
30 CORBA::PolicyList
policy_list (1);
31 policy_list
.length (1);
33 CORBA::Any sync_scope
;
36 // @@ We need a helper class that automatically calls the
37 // destroy() method on each policy...
39 orb
->create_policy (Messaging::SYNC_SCOPE_POLICY_TYPE
,
41 policy_manager
->set_policy_overrides (policy_list
,
44 policy_list
[0]->destroy ();
47 SyncScope_Setup::~SyncScope_Setup ()