diff options
author | edwardgt <edwardgt@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-09-15 22:48:12 +0000 |
---|---|---|
committer | edwardgt <edwardgt@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-09-15 22:48:12 +0000 |
commit | 9cb706b2e675a187cf9cf774cd71c081ab4bba08 (patch) | |
tree | 372e7202301adb5cc7b94a4c3e5bff6fb757f312 | |
parent | 9bfc5d4e8b8f0c481461b572069e8de6b4d366e1 (diff) | |
download | ATCD-9cb706b2e675a187cf9cf774cd71c081ab4bba08.tar.gz |
ChangeLogTag: Mon Sep 15 16:59:34 2003 George Edwards <g.edwards@vanderbilt.edu>
-rw-r--r-- | TAO/CIAO/ciao/CIAO_Events.cpp | 69 | ||||
-rw-r--r-- | TAO/CIAO/ciao/CIAO_Events.h | 203 | ||||
-rw-r--r-- | TAO/CIAO/ciao/Container_Base.h | 14 |
3 files changed, 275 insertions, 11 deletions
diff --git a/TAO/CIAO/ciao/CIAO_Events.cpp b/TAO/CIAO/ciao/CIAO_Events.cpp new file mode 100644 index 00000000000..7717ca08775 --- /dev/null +++ b/TAO/CIAO/ciao/CIAO_Events.cpp @@ -0,0 +1,69 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file CIAO_Events.cpp + * + * $Id$ + * + * Method definitions for CIAO's event classes + * + * @author George Edwards <g.edwards@vanderbilt.edu> + */ +//============================================================================= + +::Components::Cookie * CIAO::CIAO_RTEventService::specify_event_service ( + const char * event_name, + const char * publisher_name, + const char * service_name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + CORBA::SystemException)) +{ +} + +::Components::Cookie * CIAO::CIAO_RTEventService::connect_event_supplier ( + CIAO_EventServiceInfo service_info + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + CORBA::SystemException)) +{ +} + +::Components::Cookie * CIAO::CIAO_RTEventService::connect_event_consumer ( + ::Components::EventConsumerBase_ptr c, + CIAO_EventServiceInfo service_info + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + CORBA::SystemException)) +{ +} + +void CIAO::CIAO_RTEventService::disconnect_event_consumer ( + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection)) +{ +} + +void CIAO::CIAO_RTEventService::disconnect_event_supplier ( + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection)) +{ +} + +void CIAO::CIAO_RTEventService::push_event ( + ::Components::EventBase *ev, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + CORBA::SystemException)) +{ +} diff --git a/TAO/CIAO/ciao/CIAO_Events.h b/TAO/CIAO/ciao/CIAO_Events.h new file mode 100644 index 00000000000..689638add4b --- /dev/null +++ b/TAO/CIAO/ciao/CIAO_Events.h @@ -0,0 +1,203 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file CIAO_Events.h + * + * $Id$ + * + * Header file for CIAO's event classes + * + * @author George Edwards <g.edwards@vanderbilt.edu> + */ +//============================================================================= + +#ifndef CIAO_EVENTS_H +#define CIAO_EVENTS_H +#include /**/ "ace/pre.h" + +#include "orbsvcs/RtecEventCommS.h" +#include "orbsvcs/RtecEventChannelAdminS.h" +#include "Event_Utilities.h" +#include "orbsvcs/Event/EC_Event_Channel.h" +#include "orbsvcs/Event/EC_Default_Factory.h" +#include "CCM_ContainerC.h" + +namespace CIAO +{ + + class CIAO_EventServiceBase + { + + public: + + virtual ::Components::Cookie * specify_event_service ( + const char * event_name, + const char * publisher_name, + const char * service_name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + CORBA::SystemException)) = 0; + + virtual ::Components::Cookie * connect_event_supplier ( + ::CIAO::EventServiceInfo service_info + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + CORBA::SystemException)) = 0; + + virtual ::Components::Cookie * connect_event_consumer ( + ::Components::EventConsumerBase_ptr c, + ::CIAO::EventServiceInfo service_info + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + CORBA::SystemException)) = 0; + + virtual void disconnect_event_consumer ( + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection)) = 0; + + virtual void disconnect_event_supplier ( + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection)) = 0; + + virtual void push_event ( + ::Components::EventBase *ev, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + CORBA::SystemException)) = 0; + + }; + + class CIAO_RTEventService : + public virtual CIAO_EventServiceBase + { + + public: + + virtual ::Components::Cookie * specify_event_service ( + const char * event_name, + const char * publisher_name, + const char * service_name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + CORBA::SystemException)); + + virtual ::Components::Cookie * connect_event_supplier ( + CIAO_EventServiceInfo service_info + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + CORBA::SystemException)); + + virtual ::Components::Cookie * connect_event_consumer ( + ::Components::EventConsumerBase_ptr c, + CIAO_EventServiceInfo service_info + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + CORBA::SystemException)); + + virtual void disconnect_event_consumer ( + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection)); + + virtual void disconnect_event_supplier ( + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection)); + + virtual void push_event ( + ::Components::EventBase *ev, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + CORBA::SystemException)); + + private: + + /// Map of event types + ACE_Hash_Map_Manager<const char *, RtecEventComm::EventType, ACE_Null_Mutex> + ciao_event_types_map_; + + /// Map of suppliers + ACE_Hash_Map_Manager<const char *, RtecEventComm::EventSourceID, ACE_Null_Mutex> + ciao_publishers_map_; + + /// Reference to the RT event channel + RtecEventChannelAdmin::EventChannel_var ciao_rt_event_channel_; + + }; + + + enum CIAO_EventServiceType + { + DIRECT, + EC, + RTEC, + NS, + RTNS + }; + + struct CIAO_EventServiceInfo + { + EventServiceType service_type; + RtecEventComm::EventType event_type_id; + RtecEventComm::EventSourceID event_source_id; + }; + + class CIAO_RTEventServiceSupplier_impl : + public virtual POA_RtecEventComm::PushSupplier, + public virtual PortableServer::RefCountServantBase + { + + public: + CIAO_RTEventServiceSupplier_impl (void); + + CIAO_RTEventServiceSupplier_impl (CORBA::ORB_ptr orb); + + virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + private: + CORBA::ORB_var orb_; + }; + + class CIAO_RTEventServiceConsumer_impl : + public virtual POA_RtecEventComm::PushConsumer, + public virtual PortableServer::RefCountServantBase + { + + public: + CIAO_RTEventServiceConsumer_impl (void); + + CIAO_RTEventServiceConsumer_impl (CORBA::ORB_ptr orb, + Components::EventConsumerBase_ptr consumer); + + virtual void push (const RtecEventComm::EventSet& events); + + virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + private: + CORBA::ORB_var orb_; + Components::EventConsumerBase_var event_consumer_; + }; + +} + +#include /**/ "ace/post.h" +#endif /* CIAO_EVENTS_H */ diff --git a/TAO/CIAO/ciao/Container_Base.h b/TAO/CIAO/ciao/Container_Base.h index 1d3acbbd762..3e3297e26bd 100644 --- a/TAO/CIAO/ciao/Container_Base.h +++ b/TAO/CIAO/ciao/Container_Base.h @@ -150,17 +150,9 @@ namespace CIAO // Reference to the Root POA PortableServer::POA_var root_poa_; - /// Map of event types - ACE_Hash_Map_Manager<const char *, RtecEventComm::EventType, ACE_Null_Mutex> - ciao_event_types_map_; - - /// Map of suppliers - ACE_Hash_Map_Manager<const char *, RtecEventComm::EventSourceID, ACE_Null_Mutex> - ciao_publishers_map_; - - /// Reference to the RT event channel (only created if needed; nil otherwise) - RtecEventChannelAdmin::EventChannel_var ciao_rt_event_channel_; - + // Map of CIAO event services + ACE_Hash_Map_Manager<long, CIAO_EventServiceBase *> + event_services_map; }; class CIAO_SERVER_Export Session_Container : public Container |