diff options
Diffstat (limited to 'TAO/tao/PolicyS.cpp')
-rw-r--r-- | TAO/tao/PolicyS.cpp | 458 |
1 files changed, 102 insertions, 356 deletions
diff --git a/TAO/tao/PolicyS.cpp b/TAO/tao/PolicyS.cpp index 079873eade6..cad124b75a8 100644 --- a/TAO/tao/PolicyS.cpp +++ b/TAO/tao/PolicyS.cpp @@ -1,6 +1,7 @@ -/* -*- C++ -*- */ // $Id$ +/* -*- C++ -*- */ + // ****** Code generated by the The ACE ORB (TAO) IDL Compiler ******* // TAO ORB and the TAO IDL Compiler have been developed by Washington // University Computer Science's Distributed Object Computing Group. @@ -12,176 +13,142 @@ #include "tao/Operation_Table.h" #include "tao/Server_Request.h" #include "tao/POA_CORBA.h" -#include "tao/Environment.h" -#include "tao/Typecode.h" -#include "tao/ORB.h" ACE_RCSID(tao, PolicyS, "$Id$") -#if !defined (TAO_HAS_LOCALITY_CONSTRAINT_POLICIES) -class TAO_CORBA_Policy_Perfect_Hash_OpTable : public TAO_Perfect_Hash_OpTable -{ -private: - unsigned int hash (const char *str, unsigned int len); -public: - const TAO_operation_db_entry * lookup (const char *str, unsigned int len); +static const TAO_operation_db_entry CORBA_Policy_operations [] = { + {"_get_policy_type", &POA_CORBA::Policy::_get_policy_type_skel}, + {"copy", &POA_CORBA::Policy::copy_skel}, + {"destroy", &POA_CORBA::Policy::destroy_skel}, + {"_is_a", &POA_CORBA::Policy::_is_a_skel} }; -/* starting time is 17:16:21 */ -/* C++ code produced by gperf version 2.7 (GNU C++ version) */ -/* Command-line: /project/macarena/coryan/head/ACE_wrappers/bin/gperf -m -M -J -c -C -D -E -T -f 0 -a -o -t -p -K opname_ -L C++ -Z TAO_CORBA_Policy_Perfect_Hash_OpTable -N lookup */ -unsigned int -TAO_CORBA_Policy_Perfect_Hash_OpTable::hash (const char *str, unsigned int len) -{ - static const unsigned char asso_values[] = - { - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 0, 17, 0, 17, 0, - 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 0, 17, 17, 17, - 17, 0, 17, 17, 17, 17, 17, 17, - }; - return len + asso_values[str[len - 1]] + asso_values[str[0]]; -} - -const class TAO_operation_db_entry * -TAO_CORBA_Policy_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len) -{ - enum - { - TOTAL_KEYWORDS = 5, - MIN_WORD_LENGTH = 4, - MAX_WORD_LENGTH = 16, - MIN_HASH_VALUE = 4, - MAX_HASH_VALUE = 16, - HASH_VALUE_RANGE = 13, - DUPLICATES = 0 - }; - - static const class TAO_operation_db_entry wordlist[] = - { - {"",}, {"",}, {"",}, {"",}, - {"copy", &POA_CORBA::Policy::copy_skel}, - {"_is_a", &POA_CORBA::Policy::_is_a_skel}, - {"",}, - {"destroy", &POA_CORBA::Policy::destroy_skel}, - {"",}, {"",}, {"",}, {"",}, {"",}, - {"_non_existent", &POA_CORBA::Policy::_non_existent_skel}, - {"",}, {"",}, - {"_get_policy_type", &POA_CORBA::Policy::_get_policy_type_skel}, - }; - - if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) - { - unsigned int key = hash (str, len); - - if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE) - { - const char *s = wordlist[key].opname_; - - if (*str == *s && !strncmp (str + 1, s + 1, len - 1)) - return &wordlist[key]; - } - } - return 0; -} -/* ending time is 17:16:21 */ -TAO_CORBA_Policy_Perfect_Hash_OpTable tao_CORBA_Policy_optable; -#endif /* !TAO_HAS_LOCALITY_CONSTRAINT_POLICIES */ +static const CORBA::Long _tao_CORBA_Policy_optable_size = sizeof (ACE_Hash_Map_Entry<const char *, TAO_Skeleton>) * (12); +static char _tao_CORBA_Policy_optable_pool [_tao_CORBA_Policy_optable_size]; +static ACE_Static_Allocator_Base _tao_CORBA_Policy_allocator (_tao_CORBA_Policy_optable_pool, _tao_CORBA_Policy_optable_size); +TAO_Dynamic_Hash_OpTable tao_CORBA_Policy_optable (CORBA_Policy_operations, 4, 8, &_tao_CORBA_Policy_allocator); // skeleton constructor POA_CORBA::Policy::Policy (void) { -#if !defined (TAO_HAS_LOCALITY_CONSTRAINT_POLICIES) this->optable_ = &tao_CORBA_Policy_optable; -#endif /* !TAO_HAS_LOCALITY_CONSTRAINT_POLICIES */ } -// copy ctor -POA_CORBA::Policy::Policy (const Policy& rhs) - : TAO_ServantBase (rhs) -{} // skeleton destructor POA_CORBA::Policy::~Policy (void) { } - -#if !defined (TAO_HAS_LOCALITY_CONSTRAINT_POLICIES) void POA_CORBA::Policy::_get_policy_type_skel ( CORBA::ServerRequest &_tao_server_request, void *_tao_object_reference, void * /* context */, - CORBA::Environment &ACE_TRY_ENV + CORBA::Environment &_tao_orb_environment ) { + // CORBA::Environment _tao_skel_environment; + static const TAO_Param_Data_Skel _get_CORBA_Policy_policy_type_paramdata [] = + { + {CORBA::_tc_PolicyType, 0, 0} + }; // CORBA_Policy_policy_type_paramdata + + static const TAO_Call_Data_Skel _get_CORBA_Policy_policy_type_calldata = + {"_get_policy_type", 1, 1, _get_CORBA_Policy_policy_type_paramdata}; + POA_CORBA::Policy *_tao_impl = (POA_CORBA::Policy *)_tao_object_reference; CORBA::PolicyType _tao_retval = 0; + _tao_server_request.demarshal ( + _tao_orb_environment, + &_get_CORBA_Policy_policy_type_calldata, + &_tao_retval + ); + if (_tao_orb_environment.exception ()) return; _tao_retval = _tao_impl->policy_type ( - ACE_TRY_ENV + _tao_orb_environment + ); + _tao_server_request.marshal ( + _tao_orb_environment, + // _tao_orb_environment, + &_get_CORBA_Policy_policy_type_calldata, + &_tao_retval ); - ACE_CHECK; - _tao_server_request.init_reply (ACE_TRY_ENV); - ACE_CHECK; - TAO_OutputCDR &_tao_out = _tao_server_request.outgoing (); - if (!( - (_tao_out << _tao_retval) - )) - ACE_THROW (CORBA::MARSHAL () ); - } void POA_CORBA::Policy::copy_skel ( CORBA::ServerRequest &_tao_server_request, void *_tao_object_reference, void * /* context */, - CORBA::Environment &ACE_TRY_ENV + CORBA::Environment &_tao_orb_environment ) { + // CORBA::Environment _tao_skel_environment; + static const TAO_Param_Data_Skel CORBA_Policy_copy_paramdata [] = + { + {CORBA::_tc_Policy, 0, 0} + }; // CORBA_Policy_copy_paramdata + + static const TAO_Call_Data_Skel CORBA_Policy_copy_calldata = + {"copy", 1, 1, CORBA_Policy_copy_paramdata}; + POA_CORBA::Policy *_tao_impl = (POA_CORBA::Policy *)_tao_object_reference; - CORBA::Policy_var _tao_retval; + CORBA::Object_ptr _tao_retval = CORBA::Object::_nil (); + _tao_server_request.demarshal ( + _tao_orb_environment, + &CORBA_Policy_copy_calldata, + &_tao_retval + ); + if (_tao_orb_environment.exception ()) return; _tao_retval = _tao_impl->copy ( - ACE_TRY_ENV + _tao_orb_environment + ); + _tao_server_request.marshal ( + _tao_orb_environment, + // _tao_skel_environment, + &CORBA_Policy_copy_calldata, + &_tao_retval ); - ACE_CHECK; - _tao_server_request.init_reply (ACE_TRY_ENV); - ACE_CHECK; - TAO_OutputCDR &_tao_out = _tao_server_request.outgoing (); - if (!( - (_tao_out << _tao_retval.in ()) - )) - ACE_THROW (CORBA::MARSHAL () ); - } void POA_CORBA::Policy::destroy_skel ( CORBA::ServerRequest &_tao_server_request, void *_tao_object_reference, void * /* context */, - CORBA::Environment &ACE_TRY_ENV + CORBA::Environment &_tao_orb_environment ) { + // CORBA::Environment _tao_skel_environment; + static const TAO_Param_Data_Skel CORBA_Policy_destroy_paramdata [] = + { + {CORBA::_tc_void, 0, 0} + }; // CORBA_Policy_destroy_paramdata + + static const TAO_Call_Data_Skel CORBA_Policy_destroy_calldata = + {"destroy", 1, 1, CORBA_Policy_destroy_paramdata}; + POA_CORBA::Policy *_tao_impl = (POA_CORBA::Policy *)_tao_object_reference; + _tao_server_request.demarshal ( + _tao_orb_environment, + &CORBA_Policy_destroy_calldata, + 0 + ); + if (_tao_orb_environment.exception ()) return; _tao_impl->destroy ( - ACE_TRY_ENV + _tao_orb_environment + ); + _tao_server_request.marshal ( + _tao_orb_environment, + // _tao_skel_environment, + &CORBA_Policy_destroy_calldata, + 0 ); - ACE_CHECK; - _tao_server_request.init_reply (ACE_TRY_ENV); } void POA_CORBA::Policy::_is_a_skel ( CORBA::ServerRequest &_tao_server_request, void * _tao_object_reference, void * /*context*/, - CORBA::Environment &ACE_TRY_ENV + CORBA::Environment &_tao_orb_environment ) { + // CORBA::Environment _tao_skel_environment; static const TAO_Param_Data_Skel CORBA_Policy_is_a_paramdata [] = { {CORBA::_tc_boolean, 0, 0}, @@ -191,54 +158,33 @@ void POA_CORBA::Policy::_is_a_skel ( {"_is_a", 1, 2, CORBA_Policy_is_a_paramdata}; POA_CORBA::Policy_ptr _tao_impl = (POA_CORBA::Policy_ptr) _tao_object_reference; CORBA::Boolean _tao_retval; - CORBA::String_var _tao_value; + char *_tao_value = 0; _tao_server_request.demarshal ( - ACE_TRY_ENV, + _tao_orb_environment, &CORBA_Policy_is_a_calldata, &_tao_retval, - &_tao_value.inout () + &_tao_value ); - ACE_CHECK; - _tao_retval = _tao_impl->_is_a (_tao_value.in (), ACE_TRY_ENV); - ACE_CHECK; + if (_tao_orb_environment.exception () != 0) return; + _tao_retval = _tao_impl->_is_a (_tao_value, _tao_orb_environment); _tao_server_request.marshal ( - ACE_TRY_ENV, + _tao_orb_environment, + // _tao_skel_environment, &CORBA_Policy_is_a_calldata, &_tao_retval, - &_tao_value.inout () - ); -} - -void POA_CORBA::Policy::_non_existent_skel ( - CORBA::ServerRequest &_tao_server_request, - void * /* _tao_object_reference */ , - void * /*context*/, - CORBA::Environment &ACE_TRY_ENV - ) -{ - static const TAO_Param_Data_Skel CORBA_Policy_non_existent_paramdata [] = - { - {CORBA::_tc_boolean, 0, 0} - }; - static const TAO_Call_Data_Skel CORBA_Policy_non_existent_calldata = - {"_non_existent", 1, 1, CORBA_Policy_non_existent_paramdata}; - CORBA::Boolean _tao_retval = 0; - _tao_server_request.marshal ( - ACE_TRY_ENV, - &CORBA_Policy_non_existent_calldata, - &_tao_retval + &_tao_value ); + CORBA::string_free (_tao_value); } -#endif /* !TAO_HAS_LOCALITY_CONSTRAINT_POLICIES */ CORBA::Boolean POA_CORBA::Policy::_is_a ( const char* value, - CORBA::Environment &ACE_TRY_ENV + CORBA::Environment &_tao_orb_environment ) { if ( - (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/Policy:1.0")) || - (!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (ACE_TRY_ENV)))) + (!ACE_OS::strcmp ((char *)value, "IDL:CORBA/Policy:1.0")) || + (!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (_tao_orb_environment)))) return 1; else return 0; @@ -248,7 +194,7 @@ void* POA_CORBA::Policy::_downcast ( const char* logical_type_id ) { - if (ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/Policy:1.0") == 0) + if (ACE_OS::strcmp (logical_type_id, "IDL:CORBA/Policy:1.0") == 0) return ACE_static_cast (POA_CORBA::Policy_ptr, this); if (ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/Object:1.0") == 0) return ACE_static_cast(PortableServer::Servant, this); @@ -262,7 +208,7 @@ void POA_CORBA::Policy::_dispatch (CORBA::ServerRequest &req, void *context, COR // find the skeleton corresponding to this opname if (this->_find (opname, skel) == -1) { - env.exception (new CORBA_BAD_OPERATION ()); + env.exception (new CORBA_BAD_OPERATION (CORBA::COMPLETED_NO)); ACE_ERROR ((LM_ERROR, "Bad operation <%s>\n", opname)); } else @@ -274,11 +220,9 @@ const char* POA_CORBA::Policy::_interface_repository_id (void) const return "IDL:CORBA/Policy:1.0"; } -// **************************************************************** - POA_CORBA::_tao_collocated_Policy::_tao_collocated_Policy ( POA_CORBA::Policy_ptr servant, - TAO_Stub *stub + STUB_Object *stub ) : CORBA_Policy (stub, servant, 1), CORBA_Object (stub, servant, 1), @@ -329,210 +273,12 @@ void POA_CORBA::_tao_collocated_Policy::destroy ( ); } + CORBA::Policy* POA_CORBA::Policy::_this (CORBA_Environment &TAO_IN_ENV) { - TAO_Stub *stub = this->_create_stub (TAO_IN_ENV); - ACE_CHECK_RETURN (0); + STUB_Object *stub = this->_create_stub (TAO_IN_ENV); + if (TAO_IN_ENV.exception () != 0) + return 0; return new POA_CORBA::_tao_collocated_Policy (this, stub); } - -// **************************************************************** - -POA_CORBA::PolicyManager::PolicyManager (void) -{ -} - -POA_CORBA::PolicyManager::PolicyManager (const PolicyManager& rhs) - : TAO_ServantBase (rhs) -{} - -POA_CORBA::PolicyManager::~PolicyManager (void) -{ -} - -CORBA::Boolean POA_CORBA::PolicyManager::_is_a ( - const char* value, - CORBA::Environment &ACE_TRY_ENV - ) -{ - if ( - (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/PolicyManager:1.0")) || - (!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (ACE_TRY_ENV)))) - return 1; - else - return 0; -} - -void* POA_CORBA::PolicyManager::_downcast ( - const char* logical_type_id - ) -{ - if (ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/PolicyManager:1.0") == 0) - return ACE_static_cast (POA_CORBA::PolicyManager_ptr, this); - if (ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/Object:1.0") == 0) - return ACE_static_cast(PortableServer::Servant, this); - return 0; -} - -void POA_CORBA::PolicyManager::_dispatch (CORBA::ServerRequest &req, void *context, CORBA::Environment &ACE_TRY_ENV) -{ - // @@ TODO - ACE_THROW (CORBA_BAD_OPERATION ()); -} - -const char* POA_CORBA::PolicyManager::_interface_repository_id (void) const -{ - return "IDL:omg.org/CORBA/PolicyManager:1.0"; -} - -CORBA::PolicyManager* -POA_CORBA::PolicyManager::_this (CORBA_Environment &ACE_TRY_ENV) -{ - TAO_Stub *stub = this->_create_stub (ACE_TRY_ENV); - ACE_CHECK_RETURN (0); - return new POA_CORBA::_tao_collocated_PolicyManager (this, stub); -} - -POA_CORBA::_tao_collocated_PolicyManager::_tao_collocated_PolicyManager ( - POA_CORBA::PolicyManager_ptr servant, - TAO_Stub *stub - ) - : ACE_CORBA_1 (PolicyManager) (), - CORBA_Object (stub, servant, 1), - servant_ (servant) -{ -} - -POA_CORBA::PolicyManager_ptr POA_CORBA::_tao_collocated_PolicyManager::_get_servant (void) const -{ - return this->servant_; -} - -CORBA::Boolean POA_CORBA::_tao_collocated_PolicyManager::_is_a ( - const char* logical_type_id, - CORBA::Environment &ACE_TRY_ENV - ) -{ - return this->servant_->_is_a ( - logical_type_id, - ACE_TRY_ENV - ); -} - -CORBA::PolicyList * POA_CORBA::_tao_collocated_PolicyManager::get_policy_overrides ( - const CORBA::PolicyTypeSeq & ts, - CORBA::Environment &ACE_TRY_ENV - ) -{ - return this->servant_->get_policy_overrides ( - ts, - ACE_TRY_ENV - ); -} - -void POA_CORBA::_tao_collocated_PolicyManager::set_policy_overrides ( - const CORBA::PolicyList & policies, - CORBA::SetOverrideType set_add, - CORBA::Environment &ACE_TRY_ENV - ) -{ - this->servant_->set_policy_overrides ( - policies, - set_add, - ACE_TRY_ENV - ); -} - -// **************************************************************** - -POA_CORBA::PolicyCurrent::PolicyCurrent (void) -{ -} - -// copy ctor -POA_CORBA::PolicyCurrent::PolicyCurrent (const PolicyCurrent& rhs) - : ACE_NESTED_CLASS (POA_CORBA,PolicyManager) (rhs), - ACE_NESTED_CLASS (POA_CORBA,Current) (rhs), - TAO_ServantBase (rhs) -{} -// skeleton destructor -POA_CORBA::PolicyCurrent::~PolicyCurrent (void) -{ -} - -CORBA::Boolean POA_CORBA::PolicyCurrent::_is_a ( - const char* value, - CORBA::Environment &ACE_TRY_ENV - ) -{ - if ( - (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/PolicyCurrent:1.0")) || - (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/PolicyManager:1.0")) || - (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/Current:1.0")) || - (!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (ACE_TRY_ENV)))) - return 1; - else - return 0; -} - -void* POA_CORBA::PolicyCurrent::_downcast ( - const char* logical_type_id - ) -{ - if (ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/PolicyCurrent:1.0") == 0) - return ACE_static_cast (POA_CORBA::PolicyCurrent_ptr, this); - if (ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/PolicyManager:1.0") == 0) - return ACE_static_cast (POA_CORBA::PolicyManager_ptr, this); - if (ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/Current:1.0") == 0) - return ACE_static_cast (POA_CORBA::Current_ptr, this); - if (ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/Object:1.0") == 0) - return ACE_static_cast(PortableServer::Servant, this); - return 0; -} - -void POA_CORBA::PolicyCurrent::_dispatch (CORBA::ServerRequest &req, void *context, CORBA::Environment &ACE_TRY_ENV) -{ - ACE_THROW (CORBA_BAD_OPERATION ()); -} - -const char* POA_CORBA::PolicyCurrent::_interface_repository_id (void) const -{ - return "IDL:omg.org/CORBA/PolicyCurrent:1.0"; -} - -CORBA::PolicyCurrent* -POA_CORBA::PolicyCurrent::_this (CORBA_Environment &ACE_TRY_ENV) -{ - TAO_Stub *stub = this->_create_stub (ACE_TRY_ENV); - ACE_CHECK_RETURN (0); - return new POA_CORBA::_tao_collocated_PolicyCurrent (this, stub); -} - -POA_CORBA::_tao_collocated_PolicyCurrent::_tao_collocated_PolicyCurrent ( - POA_CORBA::PolicyCurrent_ptr servant, - TAO_Stub *stub - ) - : ACE_CORBA_1 (PolicyCurrent) (), - ACE_NESTED_CLASS (POA_CORBA,_tao_collocated_PolicyManager) (servant, stub), - ACE_NESTED_CLASS (POA_CORBA,_tao_collocated_Current) (servant, stub), - CORBA_Object (stub, servant, 1), - servant_ (servant) -{ -} - -POA_CORBA::PolicyCurrent_ptr POA_CORBA::_tao_collocated_PolicyCurrent::_get_servant (void) const -{ - return this->servant_; -} - -CORBA::Boolean POA_CORBA::_tao_collocated_PolicyCurrent::_is_a ( - const char* logical_type_id, - CORBA::Environment &ACE_TRY_ENV - ) -{ - return this->servant_->_is_a ( - logical_type_id, - ACE_TRY_ENV - ); -} |