TAO_RT_PolicyFactory Class Reference

Policy factory for all RTCORBA related policies. More...

#include <RT_PolicyFactory.h>

Inheritance diagram for TAO_RT_PolicyFactory:

Inheritance graph
[legend]
Collaboration diagram for TAO_RT_PolicyFactory:

Collaboration graph
[legend]
List of all members.

Public Member Functions

CORBA::Policy_ptr create_policy (CORBA::PolicyType type, const CORBA::Any &value)
CORBA::Policy_ptr _create_policy (CORBA::PolicyType type)

Detailed Description

Policy factory for all RTCORBA related policies.

Definition at line 43 of file RT_PolicyFactory.h.


Member Function Documentation

CORBA::Policy_ptr TAO_RT_PolicyFactory::_create_policy ( CORBA::PolicyType  type  ) 

Definition at line 43 of file RT_PolicyFactory.cpp.

References CORBA::SystemException::_tao_minor_code(), ACE_NEW_THROW_EX, CORBA::BAD_POLICY_TYPE, CORBA::COMPLETED_NO, and TAO::VMCID.

00044 {
00045   CORBA::Policy_ptr policy = CORBA::Policy_ptr ();
00046 
00047   if (type == RTCORBA::PRIORITY_MODEL_POLICY_TYPE)
00048     {
00049       ACE_NEW_THROW_EX (policy,
00050                         TAO_PriorityModelPolicy,
00051                         CORBA::NO_MEMORY (
00052                           CORBA::SystemException::_tao_minor_code (
00053                             TAO::VMCID,
00054                             ENOMEM),
00055                           CORBA::COMPLETED_NO));
00056 
00057       return policy;
00058     }
00059 
00060   if (type == RTCORBA::PRIORITY_BANDED_CONNECTION_POLICY_TYPE)
00061     {
00062       ACE_NEW_THROW_EX (policy,
00063                         TAO_PriorityBandedConnectionPolicy,
00064                         CORBA::NO_MEMORY (
00065                           CORBA::SystemException::_tao_minor_code (
00066                             TAO::VMCID,
00067                             ENOMEM),
00068                           CORBA::COMPLETED_NO));
00069 
00070       return policy;
00071     }
00072 
00073   if (type == RTCORBA::CLIENT_PROTOCOL_POLICY_TYPE)
00074     {
00075       ACE_NEW_THROW_EX (policy,
00076                         TAO_ClientProtocolPolicy,
00077                         CORBA::NO_MEMORY (
00078                           CORBA::SystemException::_tao_minor_code (
00079                             TAO::VMCID,
00080                             ENOMEM),
00081                           CORBA::COMPLETED_NO));
00082 
00083       return policy;
00084     }
00085 
00086   throw ::CORBA::PolicyError (CORBA::BAD_POLICY_TYPE);
00087 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL CORBA::Policy_ptr TAO_RT_PolicyFactory::create_policy ( CORBA::PolicyType  type,
const CORBA::Any &  value 
)

Definition at line 17 of file RT_PolicyFactory.cpp.

References CORBA::BAD_POLICY_TYPE, TAO_PriorityBandedConnectionPolicy::create(), TAO_PrivateConnectionPolicy::create(), TAO_ClientProtocolPolicy::create(), TAO_ServerProtocolPolicy::create(), TAO_ThreadpoolPolicy::create(), and TAO_PriorityModelPolicy::create().

00020 {
00021   if (type == RTCORBA::PRIORITY_MODEL_POLICY_TYPE)
00022     return TAO_PriorityModelPolicy::create (value);
00023 
00024   if (type == RTCORBA::THREADPOOL_POLICY_TYPE)
00025     return TAO_ThreadpoolPolicy::create (value);
00026 
00027   if (type == RTCORBA::SERVER_PROTOCOL_POLICY_TYPE)
00028     return TAO_ServerProtocolPolicy::create (value);
00029 
00030   if (type == RTCORBA::CLIENT_PROTOCOL_POLICY_TYPE)
00031     return TAO_ClientProtocolPolicy::create (value);
00032 
00033   if (type == RTCORBA::PRIVATE_CONNECTION_POLICY_TYPE)
00034     return TAO_PrivateConnectionPolicy::create (value);
00035 
00036   if (type == RTCORBA::PRIORITY_BANDED_CONNECTION_POLICY_TYPE)
00037     return TAO_PriorityBandedConnectionPolicy::create (value);
00038 
00039   throw ::CORBA::PolicyError (CORBA::BAD_POLICY_TYPE);
00040 }


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:43:00 2010 for TAO_RTCORBA by  doxygen 1.4.7