Problem
- Product : VBC 4.x, 5.x, 6.x & later
- Platform : All
- Product Component : ORB
How to print QoS values returned by get_policy_overrides?
Resolution
You can write a function similar to the sample one shown below to query and print the values returned by get_policy_overrides:
>>>>>
CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
CORBA::Object_var obj = orb->resolve_initial_references("ORBPolicyManager");
CORBA::PolicyManager_var policy_mgr = CORBA::PolicyManager::_narrow(obj);
CORBA::PolicyTypeSeq types;
types.length(0);
CORBA::PolicyList_var policies(policy_mgr->get_policy_overrides(types));
for (CORBA::ULong i = 0; i < policies->length(); i ) {
CORBA::PolicyType type = policies->policy_type();
if (type == QoSExt::DEFER_BIND_POLICY_TYPE) {
QoSExt::DeferBindPolicy_var defer = QoSExt::DeferBindPolicy::_narrow(policies);
defer_bind = defer->value();
} else if (type == Messaging::REBIND_POLICY_TYPE) {
Messaging::RebindPolicy_var rebind(Messaging::RebindPolicy::_narrow(policies));
if (rebind->rebind_mode() == Messaging::TRANSPARENT)
enable_rebind = 1UL;
else
enable_rebind = 0UL;
}
}
>>>
#Security
#get_policy_overrides
#VisiBroker
#QOS




