#include <PortableServer_PolicyFactory.h>
Inheritance diagram for TAO_PortableServer_PolicyFactory:
Public Member Functions | |
CORBA::Policy_ptr | create_policy (CORBA::PolicyType type, const CORBA::Any &value) |
Definition at line 29 of file PortableServer_PolicyFactory.h.
TAO_BEGIN_VERSIONED_NAMESPACE_DECL CORBA::Policy_ptr TAO_PortableServer_PolicyFactory::create_policy | ( | CORBA::PolicyType | type, | |
const CORBA::Any & | value | |||
) |
Definition at line 21 of file PortableServer_PolicyFactory.cpp.
References CORBA::BAD_POLICY_TYPE, and TAO::Portable_Server::create_policy().
00024 { 00025 #if !defined (CORBA_E_MICRO) 00026 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) 00027 00028 if (type == ::PortableServer::THREAD_POLICY_ID) 00029 { 00030 TAO::Portable_Server::ThreadPolicy *thread_policy = 0; 00031 PortableServer::ThreadPolicyValue thr_value; 00032 00033 TAO::Portable_Server::create_policy (thread_policy, thr_value, value); 00034 00035 return thread_policy; 00036 } 00037 00038 #endif /* TAO_HAS_MINIMUM_POA == 0 */ 00039 if (type == PortableServer::LIFESPAN_POLICY_ID) 00040 { 00041 TAO::Portable_Server::LifespanPolicy *lifespan_policy = 0; 00042 PortableServer::LifespanPolicyValue lifespan_value; 00043 00044 TAO::Portable_Server::create_policy (lifespan_policy, lifespan_value, value); 00045 00046 return lifespan_policy; 00047 } 00048 00049 if (type == PortableServer::ID_UNIQUENESS_POLICY_ID) 00050 { 00051 TAO::Portable_Server::IdUniquenessPolicy *id_uniqueness_policy = 0; 00052 PortableServer::IdUniquenessPolicyValue id_uniqueness_value; 00053 00054 TAO::Portable_Server::create_policy (id_uniqueness_policy, id_uniqueness_value, value); 00055 00056 return id_uniqueness_policy; 00057 } 00058 00059 if (type == PortableServer::ID_ASSIGNMENT_POLICY_ID) 00060 { 00061 TAO::Portable_Server::IdAssignmentPolicy *id_assignment_policy = 0; 00062 PortableServer::IdAssignmentPolicyValue id_assignment_value; 00063 00064 TAO::Portable_Server::create_policy (id_assignment_policy, id_assignment_value, value); 00065 00066 return id_assignment_policy; 00067 } 00068 00069 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) 00070 00071 if (type == PortableServer::IMPLICIT_ACTIVATION_POLICY_ID) 00072 { 00073 TAO::Portable_Server::ImplicitActivationPolicy *implicit_activatation_policy = 0; 00074 PortableServer::ImplicitActivationPolicyValue implicit_activation_value; 00075 00076 TAO::Portable_Server::create_policy (implicit_activatation_policy, implicit_activation_value, value); 00077 00078 return implicit_activatation_policy; 00079 } 00080 00081 if (type == PortableServer::SERVANT_RETENTION_POLICY_ID) 00082 { 00083 TAO::Portable_Server::ServantRetentionPolicy *servant_retention_policy = 0; 00084 PortableServer::ServantRetentionPolicyValue servant_retention_value; 00085 00086 TAO::Portable_Server::create_policy (servant_retention_policy, servant_retention_value, value); 00087 00088 return servant_retention_policy; 00089 } 00090 00091 if (type == PortableServer::REQUEST_PROCESSING_POLICY_ID) 00092 { 00093 TAO::Portable_Server::RequestProcessingPolicy *request_processing_policy = 0; 00094 PortableServer::RequestProcessingPolicyValue request_processing_value; 00095 00096 TAO::Portable_Server::create_policy (request_processing_policy, request_processing_value, value); 00097 00098 return request_processing_policy; 00099 } 00100 00101 #endif /* TAO_HAS_MINIMUM_POA == 0 */ 00102 00103 throw ::CORBA::PolicyError (CORBA::BAD_POLICY_TYPE); 00104 #else 00105 ACE_UNUSED_ARG (value); 00106 ACE_UNUSED_ARG (type); 00107 00108 throw ::CORBA::PolicyError (CORBA::BAD_POLICY_TYPE); 00109 #endif 00110 }