00001 /** 00002 * @file RtecEventComm.idl 00003 * 00004 * @brief Define the RtecEventComm module 00005 * 00006 * RtecEventComm.idl,v 1.17 2002/07/01 14:13:59 parsons Exp 00007 * 00008 * TAO's Real-time Event Service is described in: 00009 * 00010 * http://doc.ece.uci.edu/~coryan/EC/ 00011 * 00012 * @author Carlos O'Ryan <coryan@uci.edu> 00013 * @author Tim Harrison <harrison@cs.wustl.edu> 00014 */ 00015 #ifndef TAO_RTEC_EVENTCOMM_IDL 00016 #define TAO_RTEC_EVENTCOMM_IDL 00017 00018 #include "TimeBase.idl" 00019 00020 // Remove the prefix definition... 00021 // @@ TODO Is this the "Right Thing"? AFAIK the spec does not mention 00022 // if pragmas should survive the file scope... 00023 #pragma prefix "" 00024 00025 #include "RtecDefaultEventData.idl" 00026 00027 /** 00028 * @namespace RtecEventComm 00029 * 00030 * @brief Interfaces and data structures used by the event service 00031 * clients 00032 */ 00033 module RtecEventComm 00034 { 00035 /// The event data 00036 typedef RtecEventData EventData; 00037 00038 /// Shortcut for the time structures. 00039 typedef TimeBase::TimeT Time; 00040 00041 typedef long EventSourceID; 00042 typedef long _EventType; 00043 00044 /** 00045 * @struct EventHeader 00046 * 00047 * @brief Define the structure of an event header 00048 * 00049 * The event header is the portion of the event examined by the 00050 * event service for filtering purposes. 00051 * 00052 * Events can be filtered based on their type and SourceID, though 00053 * the latest is a misnomer, over time it has evolved into a 'source 00054 * class' or 'event domain' field, i.e. multiple sources can have 00055 * the same 'ID' and the same source can generate events with 00056 * different IDs. 00057 */ 00058 struct EventHeader 00059 { 00060 /// The event type. 00061 /** 00062 * Notice that the 'type' of the event may or may not be related 00063 * to the data type in its contents. I.e. it is perfectly 00064 * possible to send the same payload with different values in this 00065 * field. In other words, this is just a filterable value, and 00066 * it is up to the application to define (or not) its relation to 00067 * the contents of the event. 00068 */ 00069 _EventType type; 00070 00071 /// Some way to identify the supplier. 00072 EventSourceID source; 00073 00074 /// The "Time To Live" counter. 00075 /** 00076 * Each time an EC process the event it decreases the TTL field, 00077 * when it gets to zero the message is no longer forwarded. 00078 */ 00079 long ttl; 00080 00081 /// Applications can use this field to time-stamp the event at the 00082 /// source. 00083 /** 00084 * @todo Because the filtering language uses EventHeaders as 00085 * filtering expressions (yeah, it sucks) we also use this field 00086 * to pass timeout values into the EC filter. 00087 */ 00088 Time creation_time; 00089 00090 #ifndef TAO_LACKS_EVENT_CHANNEL_TIMESTAMPS 00091 //@{ 00092 /** @name Benchmarking timestamps 00093 * 00094 * The following timestamps are used to benchmark the Event 00095 * Channel, they should not be used by the application and may be 00096 * removed without notice. 00097 */ 00098 Time ec_recv_time; 00099 Time ec_send_time; 00100 //@} 00101 #endif /* TAO_LACKS_EVENT_CHANNEL_TIMESTAMPS */ 00102 }; 00103 00104 /** 00105 * @struct Event 00106 * 00107 * @brief The basic events delivered by the Event Service. 00108 * 00109 * The event service uses this structure to pass events around. 00110 */ 00111 struct Event 00112 { 00113 /// The header, used for filtering 00114 EventHeader header; 00115 00116 /// The payload, the event service treats this as an opaque data 00117 /// field. 00118 EventData data; 00119 }; 00120 /// The real argument to the push() operations. 00121 /** 00122 * For performance reasons TAO's Real-time Event Service uses 00123 * sequences of events 00124 */ 00125 typedef sequence<Event> EventSet; 00126 00127 /** 00128 * @interface PushConsumer 00129 * 00130 * @brief Define the interface used by consumers to receive events. 00131 * 00132 * Applications usually implement this interface to subscribe for 00133 * events. 00134 */ 00135 interface PushConsumer 00136 { 00137 /// Main event delivery callback 00138 oneway void push (in EventSet data); 00139 00140 /// Callback method to indicate a disconnection. 00141 /** 00142 * If the event service is destroyed while a consumer is still 00143 * connected then the following callback operation is invoked on 00144 * the consumer. 00145 * 00146 * The same operation is used by suppliers to disconnect from the 00147 * Event Channel, but it is invoked via their 00148 * RtecEventChannelAdmin::ProxyPushConsumer peer. 00149 */ 00150 void disconnect_push_consumer (); 00151 }; 00152 00153 /** 00154 * @interface PushSupplier 00155 * 00156 * @brief Defines the interface used by suppliers to receive 00157 * callbacks from the Event Channel. 00158 */ 00159 interface PushSupplier 00160 { 00161 /// Callback method to indicate a disconnection. 00162 /** 00163 * If the event service is destroyed while a supplier is still 00164 * connected then the following callback operation is invoked on 00165 * the supplier. 00166 * 00167 * The same operation is used by consumers to disconnect from the 00168 * Event Channel, but it is invoked via their 00169 * RtecEventChannelAdmin::ProxyPushSupplier peer. 00170 */ 00171 void disconnect_push_supplier (); 00172 }; 00173 }; 00174 00175 #endif /* TAO_RTEC_EVENTCOMM_IDL */