Policy factory for all Messaging related policies. More...
#include <BiDir_PolicyFactory.h>


Public Member Functions | |
| virtual CORBA::Policy_ptr | create_policy (CORBA::PolicyType type, const CORBA::Any &value) |
Policy factory for all Messaging related policies.
Definition at line 37 of file BiDir_PolicyFactory.h.
| CORBA::Policy_ptr TAO_BiDir_PolicyFactory::create_policy | ( | CORBA::PolicyType | type, | |
| const CORBA::Any & | value | |||
| ) | [virtual] |
Definition at line 17 of file BiDir_PolicyFactory.cpp.
{
CORBA::Policy_ptr policy = CORBA::Policy_ptr ();
if (type == BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE)
{
BiDirPolicy::BidirectionalPolicyValue val;
// Extract the value from the any.
if ((value >>= val) == 0)
{
throw ::CORBA::PolicyError (CORBA::BAD_POLICY_VALUE);
}
ACE_NEW_THROW_EX (policy,
TAO_BidirectionalPolicy (val),
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
return policy;
}
throw ::CORBA::PolicyError (CORBA::BAD_POLICY_TYPE);
}
1.7.0