本文整理汇总了C++中portableserver::IdAssignmentPolicy_var::value方法的典型用法代码示例。如果您正苦于以下问题:C++ IdAssignmentPolicy_var::value方法的具体用法?C++ IdAssignmentPolicy_var::value怎么用?C++ IdAssignmentPolicy_var::value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类portableserver::IdAssignmentPolicy_var
的用法示例。
在下文中一共展示了IdAssignmentPolicy_var::value方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
TAO_POA_Default_Policy_Validator::validate_impl (TAO_Policy_Set &policies)
{
#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
CORBA::Policy_var policy =
policies.get_cached_policy (TAO_CACHED_POLICY_SERVANT_RETENTION);
PortableServer::ServantRetentionPolicy_var srp =
PortableServer::ServantRetentionPolicy::_narrow (policy.in ());
PortableServer::ServantRetentionPolicyValue servant_retention =
srp->value ();
policy = policies.get_cached_policy (TAO_CACHED_POLICY_REQUEST_PROCESSING);
PortableServer::RequestProcessingPolicy_var rpp =
PortableServer::RequestProcessingPolicy::_narrow (policy.in ());
PortableServer::RequestProcessingPolicyValue request_processing =
rpp->value ();
// The NON_RETAIN policy requires either the USE_DEFAULT_SERVANT or
// USE_SERVANT_MANAGER policies.
if (servant_retention == PortableServer::NON_RETAIN)
if (request_processing != PortableServer::USE_SERVANT_MANAGER &&
request_processing != PortableServer::USE_DEFAULT_SERVANT)
throw PortableServer::POA::InvalidPolicy ();
// USE_ACTIVE_OBJECT_MAP_ONLY requires the RETAIN policy.
if (request_processing == PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY)
if (servant_retention != PortableServer::RETAIN)
throw PortableServer::POA::InvalidPolicy ();
policy = policies.get_cached_policy (TAO_CACHED_POLICY_ID_UNIQUENESS);
PortableServer::IdUniquenessPolicy_var iup =
PortableServer::IdUniquenessPolicy::_narrow (policy.in ());
PortableServer::IdUniquenessPolicyValue id_uniqueness =
iup->value ();
policy =
policies.get_cached_policy (TAO_CACHED_POLICY_IMPLICIT_ACTIVATION);
PortableServer::ImplicitActivationPolicy_var iap =
PortableServer::ImplicitActivationPolicy::_narrow (policy.in ());
PortableServer::ImplicitActivationPolicyValue implicit_activation =
iap->value ();
policy = policies.get_cached_policy (TAO_CACHED_POLICY_ID_ASSIGNMENT);
PortableServer::IdAssignmentPolicy_var idap =
PortableServer::IdAssignmentPolicy::_narrow (policy.in ());
PortableServer::IdAssignmentPolicyValue id_assignment =
idap->value ();
// USE_DEFAULT_SERVANT requires the MULTIPLE_ID policy.
if (request_processing == PortableServer::USE_DEFAULT_SERVANT)
if (id_uniqueness != PortableServer::MULTIPLE_ID)
throw PortableServer::POA::InvalidPolicy ();
// IMPLICIT_ACTIVATION requires the SYSTEM_ID and RETAIN policies.
if (implicit_activation == PortableServer::IMPLICIT_ACTIVATION)
if (servant_retention != PortableServer::RETAIN ||
id_assignment != PortableServer::SYSTEM_ID)
throw PortableServer::POA::InvalidPolicy ();
#else /* TAO_HAS_MINIMUM_POA == 0 */
ACE_UNUSED_ARG (policies);
#endif /* TAO_HAS_MINIMUM_POA == 0 */
}