00001 // -*- C++ -*- 00002 00003 /** 00004 * @file ECG_Adapters.h 00005 * 00006 * ECG_Adapters.h,v 1.10 2006/03/15 07:52:21 jtc Exp 00007 * 00008 * @author Marina Spivak <marina@atdesk.com> 00009 * 00010 * Define interfaces ECG Receivers and Mcast and UDP handlers can use 00011 * to communicate with each other. 00012 * Use of these interfaces eliminates the coupling of specific 00013 * Receivers on specific handlers, and vice versa. 00014 * 00015 */ 00016 #ifndef TAO_ECG_ADAPTERS_H 00017 #define TAO_ECG_ADAPTERS_H 00018 #include /**/ "ace/pre.h" 00019 00020 #include /**/ "orbsvcs/Event/event_serv_export.h" 00021 #include "orbsvcs/RtecUDPAdminC.h" 00022 00023 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00024 # pragma once 00025 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00026 00027 #include "ace/Refcounted_Auto_Ptr.h" 00028 00029 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00030 class ACE_SOCK_Dgram; 00031 ACE_END_VERSIONED_NAMESPACE_DECL 00032 00033 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00034 00035 /** 00036 * @class TAO_ECG_Handler_Shutdown 00037 * 00038 * @brief Interface that should be implemented 00039 * by multicast and udp handlers in EC gateways, so the 00040 * handlers can be notified of shutdown (usually by Event Receivers). 00041 */ 00042 class TAO_RTEvent_Serv_Export TAO_ECG_Handler_Shutdown 00043 { 00044 public: 00045 00046 // Define virtual destructor to make sure we can delete derived 00047 // objects through a pointer to TAO_ECG_Handler_Shutdown. 00048 virtual ~TAO_ECG_Handler_Shutdown (void); 00049 virtual int shutdown (void) = 0; 00050 }; 00051 00052 /** 00053 * @class TAO_ECG_Dgram_Handler 00054 * 00055 * @brief Interface used by mcast/udp handlers to notify interested 00056 * components (usually Event Receivers) that there is data 00057 * available on the dgram for reading, and to query them about 00058 * event type to mcast group mappings. 00059 */ 00060 class TAO_RTEvent_Serv_Export TAO_ECG_Dgram_Handler 00061 { 00062 public: 00063 00064 virtual ~TAO_ECG_Dgram_Handler (void); 00065 00066 virtual int handle_input (ACE_SOCK_Dgram& dgram) = 0; 00067 00068 virtual void get_addr (const RtecEventComm::EventHeader& header, 00069 RtecUDPAdmin::UDP_Addr_out addr 00070 ACE_ENV_ARG_DECL) = 0; 00071 }; 00072 00073 typedef ACE_Refcounted_Auto_Ptr<TAO_ECG_Handler_Shutdown, 00074 ACE_Null_Mutex> TAO_ECG_Refcounted_Handler; 00075 00076 TAO_END_VERSIONED_NAMESPACE_DECL 00077 00078 #include /**/ "ace/post.h" 00079 #endif /* TAO_ECG_ADAPTERS_H */