2 * @file PriorityBand_Setup.cpp
4 * @author Carlos O'Ryan <coryan@uci.edu>
7 #include "PriorityBand_Setup.h"
8 #include "RTCORBA_Setup.h"
9 #include "RIR_Narrow.h"
10 #include "tao/Policy_ManagerC.h"
12 PriorityBand_Setup::PriorityBand_Setup (CORBA::ORB_ptr orb
,
13 const RTCORBA_Setup
&rtcorba_setup
)
15 CORBA::PolicyManager_var policy_manager
=
16 RIR_Narrow
<CORBA::PolicyManager
>::resolve (orb
, "ORBPolicyManager");
18 RTCORBA::RTORB_var rtorb
=
19 RIR_Narrow
<RTCORBA::RTORB
>::resolve (orb
, "RTORB");
21 const RTCORBA::ThreadpoolLanes
&lanes
= rtcorba_setup
.lanes ();
23 RTCORBA::PriorityBands
priority_bands (3); priority_bands
.length (3);
24 for (CORBA::ULong i
= 0; i
!= lanes
.length (); ++i
)
26 priority_bands
[i
].low
= lanes
[i
].lane_priority
;
27 priority_bands
[i
].high
= lanes
[i
].lane_priority
;
30 CORBA::PolicyList
policy_list (1); policy_list
.length (1);
33 rtorb
->create_priority_banded_connection_policy (priority_bands
);
34 policy_manager
->set_policy_overrides (policy_list
,
37 policy_list
[0]->destroy ();
40 PriorityBand_Setup::~PriorityBand_Setup ()