diff options
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/FtRtEvent/Utils')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp | 523 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.h | 82 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.inl | 16 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.cpp | 29 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.h | 48 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.inl | 51 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.cpp | 9 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.h | 40 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.inl | 23 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/ScopeGuard.h | 300 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.cpp | 167 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.h | 123 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.inl | 58 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/activate_with_id.h | 43 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/ftrtevent_export.h | 73 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/resolve_init.h | 73 |
16 files changed, 0 insertions, 1658 deletions
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp deleted file mode 100644 index afbbaf3d051..00000000000 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp +++ /dev/null @@ -1,523 +0,0 @@ -#include "orbsvcs/FtRtEvent/Utils/FTEC_Gateway.h" -#include "orbsvcs/FtRtEvent/Utils/activate_with_id.h" -#include "orbsvcs/FtRtEvent/Utils/UUID.h" -#include "orbsvcs/FtRtEvent/Utils/resolve_init.h" -#include "orbsvcs/FtRtecEventCommS.h" -#include "tao/ORB_Core.h" - -ACE_RCSID (Utils, - FTEC_Gateway, - "$Id$") - -#if !defined(__ACE_INLINE__) -#include "orbsvcs/FtRtEvent/Utils/FTEC_Gateway.inl" -#endif /* __ACE_INLINE__ */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO_FTRTEC { -class FTEC_Gateway_ConsumerAdmin - : public POA_RtecEventChannelAdmin::ConsumerAdmin -{ -public: - FTEC_Gateway_ConsumerAdmin(FTEC_Gateway_Impl* impl); - ~FTEC_Gateway_ConsumerAdmin(); - // = The RtecEventChannelAdmin::ConsumerAdmin methods... - virtual RtecEventChannelAdmin::ProxyPushSupplier_ptr - obtain_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - FTEC_Gateway_Impl* impl_; -}; - -class FTEC_Gateway_SupplierAdmin - : public POA_RtecEventChannelAdmin::SupplierAdmin -{ -public: - FTEC_Gateway_SupplierAdmin(FTEC_Gateway_Impl* impl); - ~FTEC_Gateway_SupplierAdmin(); - // = The RtecEventChannelAdmin::SupplierAdmin methods... - virtual RtecEventChannelAdmin::ProxyPushConsumer_ptr - obtain_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - FTEC_Gateway_Impl* impl_; -}; - -class FTEC_Gateway_ProxyPushSupplier - : public POA_RtecEventChannelAdmin::ProxyPushSupplier -{ -public: - FTEC_Gateway_ProxyPushSupplier(FTEC_Gateway_Impl* impl); - ~FTEC_Gateway_ProxyPushSupplier(); - // = The RtecEventChannelAdmin::ProxyPushSupplier methods... - virtual void connect_push_consumer ( - RtecEventComm::PushConsumer_ptr push_consumer, - const RtecEventChannelAdmin::ConsumerQOS &qos - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - RtecEventChannelAdmin::AlreadyConnected, - RtecEventChannelAdmin::TypeError)); - virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - virtual void suspend_connection (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - virtual void resume_connection (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - FTEC_Gateway_Impl* impl_; -}; - -class FTEC_Gateway_ProxyPushConsumer - : public POA_RtecEventChannelAdmin::ProxyPushConsumer -{ -public: - FTEC_Gateway_ProxyPushConsumer(FTEC_Gateway_Impl* impl); - ~FTEC_Gateway_ProxyPushConsumer(); - - virtual void push (const RtecEventComm::EventSet & data - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - // = The RtecEventChannelAdmin::ProxyPushConsumer methods... - virtual void connect_push_supplier ( - RtecEventComm::PushSupplier_ptr push_supplier, - const RtecEventChannelAdmin::SupplierQOS& qos - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - RtecEventChannelAdmin::AlreadyConnected)); - virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - - FTEC_Gateway_Impl* impl_; -}; - -class PushConsumerHandler : public POA_FtRtecEventComm::AMI_PushConsumerHandler -{ -public: - PushConsumerHandler(); - ~PushConsumerHandler(); - virtual void push (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void push_excep (::Messaging::ExceptionHolder * excep_holder ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; - -/** - * This is used for remove the interceptors registered in the ORB. - */ -class Interceptor_Destoryer : public TAO_ORB_Core -{ -public: - inline static void execute(CORBA::ORB_ptr orb ACE_ENV_ARG_DECL) { - static_cast<Interceptor_Destoryer*> (orb->orb_core())->do_it(ACE_ENV_SINGLE_ARG_PARAMETER); - } -private: - Interceptor_Destoryer(); - inline void do_it(ACE_ENV_SINGLE_ARG_DECL) { - destroy_interceptors(ACE_ENV_SINGLE_ARG_PARAMETER); - }; -}; - -struct FTEC_Gateway_Impl -{ - CORBA::ORB_var orb; - PortableServer::POA_var poa; - FtRtecEventChannelAdmin::EventChannel_var ftec; - RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin; - RtecEventChannelAdmin::SupplierAdmin_var supplier_admin; - FTEC_Gateway_ConsumerAdmin consumer_admin_servant; - FTEC_Gateway_SupplierAdmin supplier_admin_servant; - FTEC_Gateway_ProxyPushSupplier proxy_supplier_servant; - FTEC_Gateway_ProxyPushConsumer proxy_consumer_servant; - PushConsumerHandler push_handler_servant; - FtRtecEventComm::AMI_PushConsumerHandler_var push_handler; - bool local_orb; - FTEC_Gateway_Impl(); -}; - -FTEC_Gateway_Impl::FTEC_Gateway_Impl() -: consumer_admin_servant(this), - supplier_admin_servant(this), - proxy_supplier_servant(this), - proxy_consumer_servant(this) -{ -} - -FTEC_Gateway::FTEC_Gateway(CORBA::ORB_ptr orb, FtRtecEventChannelAdmin::EventChannel_ptr ftec) -: impl_(new FTEC_Gateway_Impl) -{ - impl_->local_orb = CORBA::is_nil(orb); - if (!impl_->local_orb) - impl_->orb = CORBA::ORB::_duplicate(orb); - impl_->ftec = FtRtecEventChannelAdmin::EventChannel::_duplicate(ftec); -} - -FTEC_Gateway::~FTEC_Gateway() -{ - if (impl_->local_orb) - impl_->orb->shutdown(); - delete impl_; -} - -RtecEventChannelAdmin::EventChannel_ptr -FTEC_Gateway::activate(PortableServer::POA_ptr root_poa ACE_ENV_ARG_DECL) -{ - PortableServer::POA_var poa; - PortableServer::POAManager_var mgr; - - if (impl_->local_orb) { - int argc = 0; - char** argv = 0; - impl_->orb = CORBA::ORB_init(argc, argv, "FTEC_GatewayORB" - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(0); - - Interceptor_Destoryer::execute(impl_->orb.in() ACE_ENV_ARG_PARAMETER); - - poa = resolve_init<PortableServer::POA>(impl_->orb.in(), "RootPOA" - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(0); - - mgr = poa->the_POAManager(ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN(0); - - mgr->activate(ACE_ENV_SINGLE_ARG_PARAMETER); - } - else { - poa = PortableServer::POA::_duplicate(root_poa); - mgr = poa->the_POAManager(ACE_ENV_SINGLE_ARG_PARAMETER); - } - ACE_CHECK_RETURN(0); - - PortableServer::IdUniquenessPolicy_var id_uniqueness_policy = - poa->create_id_uniqueness_policy(PortableServer::MULTIPLE_ID - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(0); - - PortableServer::LifespanPolicy_var lifespan = - poa->create_lifespan_policy(PortableServer::PERSISTENT - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(0); - - // create a USER_ID IdAssignmentPolicy object - PortableServer::IdAssignmentPolicy_var assign = - poa->create_id_assignment_policy(PortableServer::USER_ID - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(0); - - CORBA::PolicyList policy_list; - policy_list.length(3); - - policy_list[0] = PortableServer::IdUniquenessPolicy::_duplicate( - id_uniqueness_policy.in()); - policy_list[1]= - PortableServer::LifespanPolicy::_duplicate(lifespan.in()); - policy_list[2]= - PortableServer::IdAssignmentPolicy::_duplicate(assign.in()); - - impl_->poa = poa->create_POA("gateway_poa", mgr.in(), policy_list - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(0); - - id_uniqueness_policy->destroy(); - lifespan->destroy(); - assign->destroy(); - - FtRtecEventComm::ObjectId oid; - oid.length(16); - UUID::create(oid.get_buffer()); - - RtecEventChannelAdmin::EventChannel_var gateway; - - activate_object_with_id(gateway.out(), impl_->poa.in(), this, oid ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(0); - ++oid[9]; - activate_object_with_id(impl_->consumer_admin.out(), - impl_->poa.in(), - &impl_->consumer_admin_servant, - oid ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(0); - ++oid[9]; - activate_object_with_id(impl_->supplier_admin.out(), - impl_->poa.in(), - &impl_->supplier_admin_servant, - oid ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(0); - - return gateway._retn(); -} - -//= The RtecEventChannelAdmin::EventChannel methods -RtecEventChannelAdmin::ConsumerAdmin_ptr -FTEC_Gateway::for_consumers (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) -ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return RtecEventChannelAdmin::ConsumerAdmin::_duplicate(impl_->consumer_admin.in()); -} - -RtecEventChannelAdmin::SupplierAdmin_ptr -FTEC_Gateway::for_suppliers (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) -ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG((LM_DEBUG, "FTEC_Gateway::for_suppliers\n")); - return RtecEventChannelAdmin::SupplierAdmin::_duplicate(impl_->supplier_admin.in()); -} - -void FTEC_Gateway::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) -ACE_THROW_SPEC ((CORBA::SystemException)) -{ - impl_->ftec->destroy(); -} - -RtecEventChannelAdmin::Observer_Handle -FTEC_Gateway::append_observer (RtecEventChannelAdmin::Observer_ptr observer - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( - CORBA::SystemException, - RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR, - RtecEventChannelAdmin::EventChannel::CANT_APPEND_OBSERVER)) -{ - return impl_->ftec->append_observer(observer ACE_ENV_ARG_PARAMETER); -} - -void FTEC_Gateway::remove_observer (RtecEventChannelAdmin::Observer_Handle handle - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( - CORBA::SystemException, - RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR, - RtecEventChannelAdmin::EventChannel::CANT_REMOVE_OBSERVER)) -{ - impl_->ftec->remove_observer(handle ACE_ENV_ARG_PARAMETER); -} - -void FTEC_Gateway::push(RtecEventChannelAdmin::ProxyPushConsumer_ptr proxy_consumer, - const RtecEventComm::EventSet & data - ACE_ENV_ARG_DECL) -{ - PortableServer::ObjectId_var object_id = - impl_->poa->reference_to_id(proxy_consumer ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - FtRtecEventComm::ObjectId** result; - memcpy(&result, &object_id[0], sizeof(FtRtecEventComm::ObjectId**)); - - impl_->ftec->push(**result, data ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - - -/// FTEC_Gateway_ConsumerAdmin - -FTEC_Gateway_ConsumerAdmin::FTEC_Gateway_ConsumerAdmin(FTEC_Gateway_Impl* impl) -: impl_(impl) -{ -} - -FTEC_Gateway_ConsumerAdmin::~FTEC_Gateway_ConsumerAdmin() -{ -} - -RtecEventChannelAdmin::ProxyPushSupplier_ptr -FTEC_Gateway_ConsumerAdmin::obtain_push_supplier (ACE_ENV_SINGLE_ARG_DECL) -ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - FtRtecEventComm::ObjectId** remote_proxy_oid_ptr; - ACE_NEW_THROW_EX(remote_proxy_oid_ptr, FtRtecEventComm::ObjectId*, CORBA::NO_MEMORY()); - - FtRtecEventComm::ObjectId local_oid; - local_oid.length(sizeof(remote_proxy_oid_ptr)); - memcpy(&local_oid[0], &remote_proxy_oid_ptr, sizeof(remote_proxy_oid_ptr)); - - RtecEventChannelAdmin::ProxyPushSupplier_ptr result; - activate_object_with_id(result, impl_->poa.in(), - &impl_->proxy_supplier_servant, - local_oid ACE_ENV_ARG_PARAMETER); - return result; -} - -/// FTEC_Gateway_SupplierAdmin - -FTEC_Gateway_SupplierAdmin::FTEC_Gateway_SupplierAdmin(FTEC_Gateway_Impl* impl) -: impl_(impl) -{ -} - -FTEC_Gateway_SupplierAdmin::~FTEC_Gateway_SupplierAdmin() -{ -} - -// = The RtecEventChannelAdmin::SupplierAdmin methods... -RtecEventChannelAdmin::ProxyPushConsumer_ptr -FTEC_Gateway_SupplierAdmin::obtain_push_consumer (ACE_ENV_SINGLE_ARG_DECL) -ACE_THROW_SPEC ((CORBA::SystemException)) -{ - FtRtecEventComm::ObjectId** remote_proxy_oid_ptr; - ACE_NEW_THROW_EX(remote_proxy_oid_ptr, FtRtecEventComm::ObjectId*, CORBA::NO_MEMORY()); - - FtRtecEventComm::ObjectId local_oid; - local_oid.length(sizeof(remote_proxy_oid_ptr)); - memcpy(&local_oid[0], &remote_proxy_oid_ptr, sizeof(remote_proxy_oid_ptr)); - - RtecEventChannelAdmin::ProxyPushConsumer_ptr result; - activate_object_with_id(result, impl_->poa.in(), - &impl_->proxy_consumer_servant, - local_oid ACE_ENV_ARG_PARAMETER); - return result; -} - - -FtRtecEventComm::ObjectId** -get_remote_oid_ptr(CORBA::ORB_ptr orb ACE_ENV_ARG_DECL) -{ - PortableServer::Current_var current = - resolve_init<PortableServer::Current>(orb, - "POACurrent" - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(0); - - PortableServer::ObjectId_var object_id = - current->get_object_id(ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN(0); - - FtRtecEventComm::ObjectId** result; - memcpy(&result, &object_id[0], sizeof(FtRtecEventComm::ObjectId**)); - return result; -} - -/// FTEC_Gateway_ProxyPushSupplier - -FTEC_Gateway_ProxyPushSupplier::FTEC_Gateway_ProxyPushSupplier(FTEC_Gateway_Impl* impl) -: impl_(impl) -{ -} - -FTEC_Gateway_ProxyPushSupplier::~FTEC_Gateway_ProxyPushSupplier() -{ -} - - -// = The RtecEventChannelAdmin::ProxyPushSupplier methods... -void FTEC_Gateway_ProxyPushSupplier::connect_push_consumer ( - RtecEventComm::PushConsumer_ptr push_consumer, - const RtecEventChannelAdmin::ConsumerQOS &qos - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - RtecEventChannelAdmin::AlreadyConnected, - RtecEventChannelAdmin::TypeError)) -{ - - FtRtecEventComm::ObjectId** oid_ptr = get_remote_oid_ptr(impl_->orb.in() ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - *oid_ptr = impl_->ftec->connect_push_consumer(push_consumer, qos ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -void FTEC_Gateway_ProxyPushSupplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - FtRtecEventComm::ObjectId** oid_ptr = get_remote_oid_ptr(impl_->orb.in() ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - impl_->ftec->disconnect_push_supplier(**oid_ptr ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - delete *oid_ptr; - delete oid_ptr; -} - -void FTEC_Gateway_ProxyPushSupplier::suspend_connection (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - FtRtecEventComm::ObjectId** oid_ptr = get_remote_oid_ptr(impl_->orb.in() ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - impl_->ftec->suspend_push_supplier(**oid_ptr ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -void FTEC_Gateway_ProxyPushSupplier::resume_connection (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - FtRtecEventComm::ObjectId** oid_ptr = get_remote_oid_ptr(impl_->orb.in() ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - impl_->ftec->resume_push_supplier(**oid_ptr ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -/// FTEC_Gateway_ProxyPushConsumer - -FTEC_Gateway_ProxyPushConsumer::FTEC_Gateway_ProxyPushConsumer(FTEC_Gateway_Impl* impl) -: impl_(impl) -{ -} - -FTEC_Gateway_ProxyPushConsumer::~FTEC_Gateway_ProxyPushConsumer() -{ -} - - -// = The RtecEventChannelAdmin::ProxyPushConsumer methods... - -void FTEC_Gateway_ProxyPushConsumer::push (const RtecEventComm::EventSet & data - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - FtRtecEventComm::ObjectId** oid_ptr = get_remote_oid_ptr(impl_->orb.in() ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - /* - if (CORBA::is_nil(impl_->push_handler.in())) { - impl_->push_handler = impl_->push_handler_servant._this(ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - } - - impl_->ftec->sendc_push (impl_->push_handler.in(), - **oid_ptr, - data ACE_ENV_ARG_PARAMETER); - */ - impl_->ftec->push(**oid_ptr, data ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -void FTEC_Gateway_ProxyPushConsumer::connect_push_supplier ( - RtecEventComm::PushSupplier_ptr push_supplier, - const RtecEventChannelAdmin::SupplierQOS& qos - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - RtecEventChannelAdmin::AlreadyConnected)) -{ - FtRtecEventComm::ObjectId** oid_ptr = get_remote_oid_ptr(impl_->orb.in() ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - *oid_ptr = impl_->ftec->connect_push_supplier(push_supplier, qos ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -void FTEC_Gateway_ProxyPushConsumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - FtRtecEventComm::ObjectId** oid_ptr = get_remote_oid_ptr(impl_->orb.in() ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - impl_->ftec->disconnect_push_consumer(**oid_ptr ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - delete *oid_ptr; - delete oid_ptr; -} - -PushConsumerHandler::PushConsumerHandler() -{ -} - -PushConsumerHandler::~PushConsumerHandler() -{ -} - -void PushConsumerHandler::push (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void PushConsumerHandler::push_excep (::Messaging::ExceptionHolder * - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -} // TAO_FTRTEC - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.h deleted file mode 100644 index 3db7660c7ad..00000000000 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.h +++ /dev/null @@ -1,82 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file FTEC_Gateway.h - * - * $Id$ - * - * @author Huang-Ming Huang <hh1@cse.wustl.edu> - */ -//============================================================================= -#ifndef FTEC_GATEWAY_H -#define FTEC_GATEWAY_H - -#include /**/ "ace/pre.h" - -#include "orbsvcs/FtRtecEventChannelAdminC.h" -#include "orbsvcs/RtecEventChannelAdminS.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO_FTRTEC -{ - struct FTEC_Gateway_Impl; - class TAO_FtRtEvent_Export FTEC_Gateway : - public POA_RtecEventChannelAdmin::EventChannel - { - public: - FTEC_Gateway(CORBA::ORB_ptr orb, - FtRtecEventChannelAdmin::EventChannel_ptr ftec); - ~FTEC_Gateway(); - - RtecEventChannelAdmin::EventChannel_ptr activate - (PortableServer::POA_ptr poa - ACE_ENV_ARG_DECL); - - RtecEventChannelAdmin::EventChannel_ptr - _this(ACE_ENV_SINGLE_ARG_DECL); - - //= The RtecEventChannelAdmin::EventChannel methods - virtual RtecEventChannelAdmin::ConsumerAdmin_ptr - for_consumers (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC((CORBA::SystemException)); - - virtual RtecEventChannelAdmin::SupplierAdmin_ptr - for_suppliers (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC((CORBA::SystemException)); - - virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC((CORBA::SystemException)); - - virtual RtecEventChannelAdmin::Observer_Handle - append_observer - (RtecEventChannelAdmin::Observer_ptr observer - ACE_ENV_ARG_DECL) ACE_THROW_SPEC(( - CORBA::SystemException, - RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR, - RtecEventChannelAdmin::EventChannel::CANT_APPEND_OBSERVER)); - - virtual void remove_observer - (RtecEventChannelAdmin::Observer_Handle - ACE_ENV_ARG_DECL) ACE_THROW_SPEC(( - CORBA::SystemException, - RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR, - RtecEventChannelAdmin::EventChannel::CANT_REMOVE_OBSERVER)); - - void push(RtecEventChannelAdmin::ProxyPushConsumer_ptr proxy_consumer, - const RtecEventComm::EventSet & data - ACE_ENV_ARG_DECL); - private: - struct FTEC_Gateway_Impl *impl_; - }; -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined(__ACE_INLINE__) -#include "orbsvcs/FtRtEvent/Utils/FTEC_Gateway.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.inl b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.inl deleted file mode 100644 index 4a4869aece4..00000000000 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.inl +++ /dev/null @@ -1,16 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO_FTRTEC { - ACE_INLINE RtecEventChannelAdmin::EventChannel_ptr - FTEC_Gateway::_this(ACE_ENV_SINGLE_ARG_DECL) - { - PortableServer::POA_var poa = _default_POA(); - return activate(poa.in() ACE_ENV_ARG_PARAMETER); - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.cpp deleted file mode 100644 index 6319f696946..00000000000 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.cpp +++ /dev/null @@ -1,29 +0,0 @@ -//$Id$ -#include "orbsvcs/FtRtEvent/Utils/Log.h" - -#if !defined(__ACE_INLINE__) -#include "orbsvcs/FtRtEvent/Utils/Log.inl" -#endif /* __ACE_INLINE__ */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO_FTRTEC { - -unsigned int Log::log_level_; - -#ifndef NDEBUG - Log::Log (unsigned int log_level, const ACE_TCHAR* format, ...) - { - if (log_level_ >= log_level) { - va_list p; - va_start(p, format); - char str[1024]; - ACE_OS::vsprintf(str, format, p); - ACE_DEBUG((LM_DEBUG, str)); - va_end(p); - } - } -#endif -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.h deleted file mode 100644 index 71b95a8a28e..00000000000 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Log.h - * - * $Id$ - * - * @author Huang-Ming Huang <hh1@cse.wustl.edu> - */ -//============================================================================= -#ifndef FTRTEC_LOG_H -#define FTRTEC_LOG_H - -#include /**/ "ace/pre.h" -#include "orbsvcs/FtRtEvent/Utils/ftrtevent_export.h" -#include "tao/Versioned_Namespace.h" -#include "ace/OS.h" -#include "ace/Log_Msg.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO_FTRTEC { - - /** - * A utility class for logging messages. - */ - class TAO_FtRtEvent_Export Log - { - public: - Log (unsigned int log_level, const ACE_TCHAR* format, ...); - static void level(unsigned int log_level); - static unsigned int level(); - static void hexdump(unsigned int log_level, const char* buf, size_t len, const char* msg); - private: - friend class Trace; - static unsigned log_level_; - }; -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined(__ACE_INLINE__) -#include "orbsvcs/FtRtEvent/Utils/Log.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.inl b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.inl deleted file mode 100644 index 120a88f6557..00000000000 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.inl +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO_FTRTEC { -#ifndef NDEBUG - ACE_INLINE - void Log::level(unsigned int log_level) - { - log_level_ = log_level; - } - - ACE_INLINE - unsigned int Log::level() - { - return log_level_; - } - - ACE_INLINE - void Log::hexdump(unsigned int level, const char* buf, size_t len, const char* msg) - { - if (Log::log_level_ >= level) - ACE_HEX_DUMP((LM_DEBUG, buf, len, msg)); - } -#else // NDEBUG - ACE_INLINE - Log::Log (unsigned int, const ACE_TCHAR*, ...) - { - } - - ACE_INLINE - void Log::level(unsigned int ) - { - } - - ACE_INLINE - unsigned int Log::level() - { - return 0; - } - - ACE_INLINE - void Log::hexdump(unsigned int, const char*, size_t, const char*) - { - } -#endif -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.cpp deleted file mode 100644 index 96f0abfbad5..00000000000 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "orbsvcs/FtRtEvent/Utils/Safe_InputCDR.h" - -ACE_RCSID (Utils, - Safe_InputCDR, - "$Id$") - -#if !defined(__ACE_INLINE__) -#include "orbsvcs/FtRtEvent/Utils/Safe_InputCDR.inl" -#endif /* __ACE_INLINE__ */ diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.h deleted file mode 100644 index b4aede7f570..00000000000 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.h +++ /dev/null @@ -1,40 +0,0 @@ -// -*- C++ -*- -//============================================================================= -/** - * @file Safe_InputCDR.h - * - * $Id$ - * - * @author Huang-Ming Huang <hh1@cse.wustl.edu> - */ -//============================================================================= -#ifndef SAFE_INPUTCDR_H -#define SAFE_INPUTCDR_H -#include /**/ "ace/pre.h" - -#include "orbsvcs/FtRtEvent/Utils/ftrtevent_export.h" -#include "tao/CDR.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_FtRtEvent_Export Safe_InputCDR : public TAO_InputCDR -{ -public: - /** - * Create an input stream from an arbitrary buffer. - * - * This contructor will work no matter the buffer is aligned properly - * or not. If the buffer is not properly aligned, it will make a copy - * of the buffer. - */ - Safe_InputCDR(const char* buf, int size); -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined(__ACE_INLINE__) -#include "orbsvcs/FtRtEvent/Utils/Safe_InputCDR.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.inl b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.inl deleted file mode 100644 index a4712c153f5..00000000000 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.inl +++ /dev/null @@ -1,23 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#include "ace/OS_Memory.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -Safe_InputCDR::Safe_InputCDR(const char* buf, int size) -: TAO_InputCDR((ACE_Message_Block*)0) -{ - if (ACE_ptr_align_binary(buf, ACE_CDR::MAX_ALIGNMENT) != buf) { - ACE_CDR::grow(&start_,size); - this->start_.copy(buf, size); - } - else { - this->start_.init(buf,size); - this->start_.wr_ptr(size); - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/ScopeGuard.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/ScopeGuard.h deleted file mode 100644 index 1b0dc0bc02d..00000000000 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/ScopeGuard.h +++ /dev/null @@ -1,300 +0,0 @@ -// -*- C++ -*- -//============================================================================= -/** - * @file ScopeGuard.h - * - * $Id$ - * - * @brief This is the code published at - * http://www.cuj.com/documents/s=8000/cujcexp1812alexandr/alexandr.htm - */ -//============================================================================= - -#ifndef SCOPEGUARD_H_ -#define SCOPEGUARD_H_ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template <class T> -class RefHolder -{ - T& ref_; -public: - RefHolder(T& ref) : ref_(ref) {} - operator T& () const - { - return ref_; - } -private: - // Disable assignment - not implemented - RefHolder& operator=(const RefHolder&); -}; - -template <class T> -inline RefHolder<T> ByRef(T& t) -{ - return RefHolder<T>(t); -} - -class ScopeGuardImplBase -{ - ScopeGuardImplBase& operator =(const ScopeGuardImplBase&); -protected: - ~ScopeGuardImplBase() - { - } - ScopeGuardImplBase(const ScopeGuardImplBase& other) throw() - : dismissed_(other.dismissed_) - { - other.Dismiss(); - } - template <typename J> - static void SafeExecute(J& j) throw() - { - if (!j.dismissed_) - try - { - j.Execute(); - } - catch(...) - { - } - } - - mutable bool dismissed_; -public: - ScopeGuardImplBase() throw() : dismissed_(false) - { - } - void Dismiss() const throw() - { - dismissed_ = true; - } -}; - -typedef const ScopeGuardImplBase& ScopeGuard; - -template <typename F> -class ScopeGuardImpl0 : public ScopeGuardImplBase -{ -public: - static ScopeGuardImpl0<F> MakeGuard(F fun) - { - return ScopeGuardImpl0<F>(fun); - } - ~ScopeGuardImpl0() throw() - { - SafeExecute(*this); - } - void Execute() - { - fun_(); - } -protected: - ScopeGuardImpl0(F fun) : fun_(fun) - { - } - F fun_; -}; - -template <typename F> -inline ScopeGuardImpl0<F> MakeGuard(F fun) -{ - return ScopeGuardImpl0<F>::MakeGuard(fun); -} - -template <typename F, typename P1> -class ScopeGuardImpl1 : public ScopeGuardImplBase -{ -public: - static ScopeGuardImpl1<F, P1> MakeGuard(F fun, P1 p1) - { - return ScopeGuardImpl1<F, P1>(fun, p1); - } - ~ScopeGuardImpl1() throw() - { - SafeExecute(*this); - } - void Execute() - { - fun_(p1_); - } -protected: - ScopeGuardImpl1(F fun, P1 p1) : fun_(fun), p1_(p1) - { - } - F fun_; - const P1 p1_; -}; - -template <typename F, typename P1> -inline ScopeGuardImpl1<F, P1> MakeGuard(F fun, P1 p1) -{ - return ScopeGuardImpl1<F, P1>::MakeGuard(fun, p1); -} - -template <typename F, typename P1, typename P2> -class ScopeGuardImpl2: public ScopeGuardImplBase -{ -public: - static ScopeGuardImpl2<F, P1, P2> MakeGuard(F fun, P1 p1, P2 p2) - { - return ScopeGuardImpl2<F, P1, P2>(fun, p1, p2); - } - ~ScopeGuardImpl2() throw() - { - SafeExecute(*this); - } - void Execute() - { - fun_(p1_, p2_); - } -protected: - ScopeGuardImpl2(F fun, P1 p1, P2 p2) : fun_(fun), p1_(p1), p2_(p2) - { - } - F fun_; - const P1 p1_; - const P2 p2_; -}; - -template <typename F, typename P1, typename P2> -inline ScopeGuardImpl2<F, P1, P2> MakeGuard(F fun, P1 p1, P2 p2) -{ - return ScopeGuardImpl2<F, P1, P2>::MakeGuard(fun, p1, p2); -} - -template <typename F, typename P1, typename P2, typename P3> -class ScopeGuardImpl3 : public ScopeGuardImplBase -{ -public: - static ScopeGuardImpl3<F, P1, P2, P3> MakeGuard(F fun, P1 p1, P2 p2, P3 p3) - { - return ScopeGuardImpl3<F, P1, P2, P3>(fun, p1, p2, p3); - } - ~ScopeGuardImpl3() throw() - { - SafeExecute(*this); - } - void Execute() - { - fun_(p1_, p2_, p3_); - } -protected: - ScopeGuardImpl3(F fun, P1 p1, P2 p2, P3 p3) : fun_(fun), p1_(p1), p2_(p2), p3_(p3) - { - } - F fun_; - const P1 p1_; - const P2 p2_; - const P3 p3_; -}; - -template <typename F, typename P1, typename P2, typename P3> -inline ScopeGuardImpl3<F, P1, P2, P3> MakeGuard(F fun, P1 p1, P2 p2, P3 p3) -{ - return ScopeGuardImpl3<F, P1, P2, P3>::MakeGuard(fun, p1, p2, p3); -} - -//************************************************************ - -template <class Obj, typename MemFun> -class ObjScopeGuardImpl0 : public ScopeGuardImplBase -{ -public: - static ObjScopeGuardImpl0<Obj, MemFun> MakeObjGuard(Obj& obj, MemFun memFun) - { - return ObjScopeGuardImpl0<Obj, MemFun>(obj, memFun); - } - ~ObjScopeGuardImpl0() throw() - { - SafeExecute(*this); - } - void Execute() - { - (obj_.*memFun_)(); - } -protected: - ObjScopeGuardImpl0(Obj& obj, MemFun memFun) - : obj_(obj), memFun_(memFun) {} - Obj& obj_; - MemFun memFun_; -}; - -template <class Obj, typename MemFun> -inline ObjScopeGuardImpl0<Obj, MemFun> MakeObjGuard(Obj& obj, MemFun memFun) -{ - return ObjScopeGuardImpl0<Obj, MemFun>::MakeObjGuard(obj, memFun); -} - -template <class Obj, typename MemFun, typename P1> -class ObjScopeGuardImpl1 : public ScopeGuardImplBase -{ -public: - static ObjScopeGuardImpl1<Obj, MemFun, P1> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1) - { - return ObjScopeGuardImpl1<Obj, MemFun, P1>(obj, memFun, p1); - } - ~ObjScopeGuardImpl1() throw() - { - SafeExecute(*this); - } - void Execute() - { - (obj_.*memFun_)(p1_); - } -protected: - ObjScopeGuardImpl1(Obj& obj, MemFun memFun, P1 p1) - : obj_(obj), memFun_(memFun), p1_(p1) {} - Obj& obj_; - MemFun memFun_; - const P1 p1_; -}; - -template <class Obj, typename MemFun, typename P1> -inline ObjScopeGuardImpl1<Obj, MemFun, P1> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1) -{ - return ObjScopeGuardImpl1<Obj, MemFun, P1>::MakeObjGuard(obj, memFun, p1); -} - -template <class Obj, typename MemFun, typename P1, typename P2> -class ObjScopeGuardImpl2 : public ScopeGuardImplBase -{ -public: - static ObjScopeGuardImpl2<Obj, MemFun, P1, P2> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2) - { - return ObjScopeGuardImpl2<Obj, MemFun, P1, P2>(obj, memFun, p1, p2); - } - ~ObjScopeGuardImpl2() throw() - { - SafeExecute(*this); - } - void Execute() - { - (obj_.*memFun_)(p1_, p2_); - } -protected: - ObjScopeGuardImpl2(Obj& obj, MemFun memFun, P1 p1, P2 p2) - : obj_(obj), memFun_(memFun), p1_(p1), p2_(p2) {} - Obj& obj_; - MemFun memFun_; - const P1 p1_; - const P2 p2_; -}; - -template <class Obj, typename MemFun, typename P1, typename P2> -inline ObjScopeGuardImpl2<Obj, MemFun, P1, P2> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2) -{ - return ObjScopeGuardImpl2<Obj, MemFun, P1, P2>::MakeObjGuard(obj, memFun, p1, p2); -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#define CONCATENATE_DIRECT(s1, s2) s1##s2 -#define CONCATENATE(s1, s2) CONCATENATE_DIRECT(s1, s2) -#define ANONYMOUS_VARIABLE(str) CONCATENATE(str, __LINE__) - -#define ON_BLOCK_EXIT ScopeGuard ANONYMOUS_VARIABLE(scopeGuard) = MakeGuard -#define ON_BLOCK_EXIT_OBJ ScopeGuard ANONYMOUS_VARIABLE(scopeGuard) = MakeObjGuard - -#endif //SCOPEGUARD_H_ diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.cpp deleted file mode 100644 index 6a34e95164b..00000000000 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.cpp +++ /dev/null @@ -1,167 +0,0 @@ -//$Id$ -#include "orbsvcs/FtRtEvent/Utils/UUID.h" - -ACE_RCSID (Utils, - UUID, - "$Id$") -#if !defined(__ACE_INLINE__) -#include "orbsvcs/FtRtEvent/Utils/UUID.inl" -#endif /* __ACE_INLINE__ */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -static union -{ - struct - { - ACE_UINT32 rand1; - ACE_UINT16 rand2; - } rand_node; - ACE_OS::macaddr_node_t mac_address; -} node; - -int -hex_to_byte (char h) -{ - if (h >= '0' && h <= '9') return h - '0'; - if (h >= 'A' && h <= 'F') return h - 'A' + 10; - if (h >= 'a' && h <= 'f') return h - 'a' + 10; - return -1; -} - -int -hexbyte_to_byte (const char *hexbyte) -{ - int hi = hex_to_byte(*hexbyte); - if (hi == -1) return -1; - ++hexbyte; - - int low = hex_to_byte(*hexbyte); - if (low == -1) return -1; - return (hi << 4) | low; -} - -static const int counts[] = { 4, 2, 2, 2, 6 }; -static const char *seperators = "----"; - -/** - * construct an UUID from the string representation - */ -UUID::UUID (const char *string_rep) -{ - if (this->from_string(string_rep) == false) - rep_.timestamp.hi = 0; -} - -bool -UUID::from_string (const char *string_rep) -{ - int offset = 0; - - for (int i = 0; i < 5; ++i) - { - for (int j = 0; j < counts[i]; ++j) - { - int r = hexbyte_to_byte(string_rep); - if (r == -1) - { - return false; - } - - rep_.uuid[offset++] = static_cast<unsigned char> (r); - string_rep += 2; - } - - if (*string_rep++ != seperators[i]) - { - return false; - } - } - - return true; -} - -static const char *table = "0123456789abcdef"; - -inline char * -bytes_to_hex (const unsigned char *bytes, - char *dest, - int len) -{ - for (int i = 0; i < len; ++i) - { - *dest++ = table[bytes[i] >> 4]; - *dest++ = table[bytes[i] & 0x0f]; - } - - return dest; -} - -/** - * convert to a string representation - */ -void -UUID::to_string (char *string_rep) const -{ - for (int i = 0; i < 5; ++i) - { - string_rep = bytes_to_hex(rep_.uuid, - string_rep, - counts[i]); - *string_rep++ = seperators[i]; - } -} - -void -UUID::create (unsigned char *buffer) -{ - static ACE_RANDR_TYPE seed; - - if (seed == 0) seed = ACE_OS::getpid(); - - // test if node is properly initialized - if (node.rand_node.rand1 == 0) - { - // initialize the node - if (ACE_OS::getmacaddress(&node.mac_address) == -1) - { - node.rand_node.rand1 = ACE_OS::rand_r(seed); - node.rand_node.rand2 = (unsigned short) ACE_OS::rand_r(seed); - } - } - - // Days in years - static ACE_UINT64 SecondsToJan1970 = - (static_cast<ACE_UINT64> (365)*(1970-1583) // Days in years - + (1970-1583)/4 // Leap days - - 3 // Allow for 1700, 1800, 1900 not leap years - + 31 // Days in December 1583 - + 30 // Days in November 1583 - + 16)*60*60*24; // Days from 15th October - - - ACE_Time_Value now = ACE_OS::gettimeofday(); - ACE_UINT64 timestamp = (SecondsToJan1970 + now.sec()) * 10000000 + now.usec() * 10; - - buffer[0] = (unsigned char) (timestamp & 0xff); - buffer[1] = (unsigned char) ((timestamp >> 8) & 0xff); - buffer[2] = (unsigned char) ((timestamp >> 16) & 0xff); - buffer[3] = (unsigned char) ((timestamp >> 24) & 0xff); - buffer[4] = (unsigned char) ((timestamp >> 32) & 0xff); - buffer[5] = (unsigned char) ((timestamp >> 40) & 0xff); - - // multiplex timestamp with thread id to ensure the uniqueness between thread - buffer[6] = (unsigned char) ((timestamp >> 48) & 0xff); - // Version number is 1 - buffer[7] = (unsigned char) (((timestamp >> 56) & 0x0f) + 0x10); - - ACE_UINT16 clockSequence = static_cast< - ACE_UINT16> (ACE_OS::rand_r(seed) & 0x2ff); - - buffer[8] = (unsigned char) ((clockSequence >> 8) & 0x1f); - buffer[9] = (unsigned char) (clockSequence & 0x1f); - - memcpy(buffer + 10, &node, 6); -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.h deleted file mode 100644 index 19b81c44354..00000000000 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.h +++ /dev/null @@ -1,123 +0,0 @@ -// -*- C++ -*- -//============================================================================= -/** - * @file UUID.h - * - * $Id$ - * - * @author Huang-Ming Huang <hh1@cse.wustl.edu> - */ -//============================================================================= -#ifndef UUID_H -#define UUID_H -#include /**/ "ace/pre.h" - -#include "orbsvcs/FtRtEvent/Utils/ftrtevent_export.h" -#include "tao/Versioned_Namespace.h" -#include "ace/OS.h" -#include "ace/SString.h" - -#if defined(TAO_EXPORT_MACRO) -#undef TAO_EXPORT_MACRO -#endif -#define TAO_EXPORT_MACRO FtRtEvent_Export - -#if defined(TAO_EXPORT_NESTED_CLASSES) -#if defined(TAO_EXPORT_NESTED_MACRO) -#undef TAO_EXPORT_NESTED_MACRO -#endif /* defined (TAO_EXPORT_NESTED_MACRO) */ -#define TAO_EXPORT_NESTED_MACRO FtRtEvent_Export -#endif /* TAO_EXPORT_NESTED_CLASSES */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * This is an implementation of Global Unique Identifier - * which follows the document draft-leach-uuids-guids-01.txt. The - * class layout is compatible with the binary representation of - * UUID specified by that document. The default constructor - * is used to create an new global unique id, not a NULL UUID. - * This class does not use dynamic memory allocation and does - * not throw any exception except to_string(ACE_CString&). - */ -class TAO_FtRtEvent_Export UUID -{ - public: - enum - { - BINRARY_LENGTH= 16, - - // the required length for the string representation including the termination '\0' - STRING_LENGTH = 37 - }; - - /* Construct an Global Unique Identifier. */ - UUID(void); - - /* This is used to create an uninitialized UUID. */ - UUID(int); - - /* - * Construct an UUID from the binary represetation. If you want to avoid a memory - * copy operation for this constructor. You can safely reinterpret_cast the 16 - * bytes buffer into the UUID object and use all the member functions provided in - * this class except is_valid() which is only useful if a UUID object is - * constructed from the string representation. - */ - UUID(const unsigned char *buffer); - - /* - * Construct an UUID from the string representation. Use is_valid() to test if the - * construction is successful or not. - */ - UUID(const char *); - - /* Construct an uuid from the string representation. */ - bool from_string(const char *string_rep); - - bool operator==(const UUID &other) const; - bool operator!=(const UUID &other) const; - - /* - * Test if the UUID is valid. Used after constructing an UUID from an string - * representation. This is done by testing whether the time_hi and time_mid fields - * of the timestamp are 0. By current time, those two field shouldn't be 0 at all. - */ - bool is_valid(void) const; - - /* - * convert to a string representation the buffer size provided must be at least - * STRING_LENGTH - */ - void to_string(char *string_rep) const; - - void to_string(ACE_CString &string) const; - - /* - * convert to a string representation the buffer size provided must be at least - * BINRARY_LENGTH - */ - void to_binary(unsigned char *binary_rep) const; - - /* create an UUID in the specified buffer */ - static void create(unsigned char *buffer); - private: - union - { - struct - { - ACE_UINT32 low; - ACE_UINT32 hi; - } timestamp; - unsigned char uuid[BINRARY_LENGTH]; - } rep_; -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined(__ACE_INLINE__) -#include "orbsvcs/FtRtEvent/Utils/UUID.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.inl b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.inl deleted file mode 100644 index e1238a12ff1..00000000000 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.inl +++ /dev/null @@ -1,58 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -UUID::UUID() -{ - create(rep_.uuid); -} - -ACE_INLINE -UUID::UUID(int) -{ -} - -/// construct an UUID from the binary represetation -ACE_INLINE -UUID::UUID(const unsigned char* id) -{ - memcpy(rep_.uuid, id, 16); -} - -ACE_INLINE -bool UUID::operator == (const UUID& other) const -{ - return memcmp(this->rep_.uuid, other.rep_.uuid, BINRARY_LENGTH) == 0; -} - -ACE_INLINE -bool UUID::operator != (const UUID& other) const -{ - return !(*this == other); -} - - -ACE_INLINE -bool UUID::is_valid() const -{ - return !this->rep_.timestamp.hi; -} - - -ACE_INLINE -void UUID::to_binary(unsigned char* binary_rep) const -{ - memcpy(binary_rep, rep_.uuid, 16); -} - -ACE_INLINE -void UUID::to_string(ACE_CString& string) const -{ - string.resize(STRING_LENGTH-1); - this->to_string(&string[0]); -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/activate_with_id.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/activate_with_id.h deleted file mode 100644 index 9913cc8c8c9..00000000000 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/activate_with_id.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- -//============================================================================= -/** - * @file activate_with_id.h - * - * $Id$ - * - * @author Huang-Ming Huang <hh1@cse.wustl.edu> - */ -//============================================================================= -#ifndef ACTIVATE_WITH_ID_H -#define ACTIVATE_WITH_ID_H - -#include "tao/Versioned_Namespace.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template<class T> -void -activate_object_with_id (T * &result, - PortableServer::POA_ptr poa, - PortableServer::ServantBase *servant, - const FtRtecEventComm::ObjectId &oid - ACE_ENV_ARG_DECL) -{ - const PortableServer::ObjectId& id = - reinterpret_cast<const PortableServer::ObjectId&> (oid); - poa->activate_object_with_id(id, - servant - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - CORBA::Object_var object = - poa->id_to_reference(id - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - result = T::_narrow(object.in() ACE_ENV_ARG_PARAMETER); -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/ftrtevent_export.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/ftrtevent_export.h deleted file mode 100644 index f3133e01cbe..00000000000 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/ftrtevent_export.h +++ /dev/null @@ -1,73 +0,0 @@ - - // -*- C++ -*- - -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl TAO_FtRtEvent -// ------------------------------ -#ifndef TAO_FTRTEVENT_EXPORT_H -#define TAO_FTRTEVENT_EXPORT_H - -#include "ace/config-all.h" - -#if defined (TAO_AS_STATIC_LIBS) -# if !defined (TAO_FTRTEVENT_HAS_DLL) -# define TAO_FTRTEVENT_HAS_DLL 0 -# endif /* ! TAO_FTRTEVENT_HAS_DLL */ -#else -# if !defined (TAO_FTRTEVENT_HAS_DLL) -# define TAO_FTRTEVENT_HAS_DLL 1 -# endif /* ! TAO_FTRTEVENT_HAS_DLL */ -#endif - -#if defined(TAO_FTRTEVENT_HAS_DLL) \ -&& (TAO_FTRTEVENT_HAS_DLL == 1) -#if defined(TAO_FTRTEVENT_BUILD_DLL) -#define TAO_FtRtEvent_Export \ - ACE_Proper_Export_Flag -#define TAO_FTRTEVENT_SINGLETON_DECLARATION (T) ACE_EXPORT_SINGLETON_DECLARATION(T) -#define TAO_FTRTEVENT_SINGLETON_DECLARE (SINGLETON_TYPE, \ - CLASS, \ - LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, \ - CLASS, \ - LOCK) -#else /* TAO_FTRTEVENT_BUILD_DLL */ -#define TAO_FtRtEvent_Export \ - ACE_Proper_Import_Flag -#define TAO_FTRTEVENT_SINGLETON_DECLARATION (T) ACE_IMPORT_SINGLETON_DECLARATION(T) -#define TAO_FTRTEVENT_SINGLETON_DECLARE (SINGLETON_TYPE, \ - CLASS, \ - LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, \ - CLASS, \ - LOCK) -#endif /* TAO_FTRTEVENT_BUILD_DLL */ -#else /* TAO_FTRTEVENT_HAS_DLL == 1 */ -#define TAO_FtRtEvent_Export -#define TAO_FTRTEVENT_SINGLETON_DECLARATION(T) -#define TAO_FTRTEVENT_SINGLETON_DECLARE (SINGLETON_TYPE, \ - CLASS, \ - LOCK) -#endif /* TAO_FTRTEVENT_HAS_DLL == 1 */ - -// Set TAO_FTRTEVENT_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined(TAO_FTRTEVENT_NTRACE) -#if (ACE_NTRACE == 1) -#define TAO_FTRTEVENT_NTRACE 1 -#else /* (ACE_NTRACE == 1) */ -#define TAO_FTRTEVENT_NTRACE 0 -#endif /* (ACE_NTRACE == 1) */ -#endif /* !TAO_FTRTEVENT_NTRACE */ - -#if (TAO_FTRTEVENT_NTRACE == 1) -#define TAO_FTRTEVENT_TRACE(X) -#else /* (TAO_FTRTEVENT_NTRACE == 1) */ -#if !defined(ACE_HAS_TRACE) -#define ACE_HAS_TRACE -#endif /* ACE_HAS_TRACE */ -#define TAO_FTRTEVENT_TRACE(X) ACE_TRACE_IMPL(X) -#include "ace/Trace.h" -#endif /* (TAO_FTRTEVENT_NTRACE == 1) */ -#endif /* TAO_FTRTEVENT_EXPORT_H */ - -// End of auto generated file. diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/resolve_init.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/resolve_init.h deleted file mode 100644 index c489912d527..00000000000 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/resolve_init.h +++ /dev/null @@ -1,73 +0,0 @@ -// -*- C++ -*- -//============================================================================= -/** - * @file resolve_init.h - * - * $Id$ - * - * @author Huang-Ming Huang <hh1@cse.wustl.edu> - */ -//============================================================================= -#ifndef RESOVLE_INIT_H -#define RESOVLE_INIT_H - -#include "tao/Versioned_Namespace.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template<class T> -typename T::_ptr_type -resolve_init (CORBA::ORB_ptr orb, - const char *id ACE_ENV_ARG_DECL_WITH_DEFAULTS) -{ - typename T::_var_type ref; - CORBA::Object_var obj; - ACE_TRY - { - CORBA::Object_var obj; - obj = orb->resolve_initial_references(id ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ref = T::_narrow(obj.in() ACE_ENV_ARG_PARAMETER); - } - - ACE_CATCHANY - { - ACE_ERROR(( - LM_ERROR, - " (%P|%t) Unable to initialize %s.\n", - id - )); - if (!CORBA::is_nil(obj.in())) - ACE_ERROR(( - LM_ERROR, - " due to narrowing problem\n" - )); - ACE_RE_THROW; - } - - ACE_ENDTRY; - return ref._retn(); -} - -#ifdef TAO_Naming_Export -template<class T> -typename T::_ptr_type -resolve (CosNaming::NamingContext_ptr context, - const CosNaming::Name &id - ACE_ENV_ARG_DECL_WITH_DEFAULTS) -{ - CORBA::Object_var obj; - obj = context->resolve(id ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(T::_nil()); - - ACE_ASSERT(!CORBA::is_nil(obj.in())); - - typename T::_var_type ref = T::_narrow(obj.in() ACE_ENV_ARG_PARAMETER); - return ref._retn(); -} -#endif - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif |