summaryrefslogtreecommitdiff
path: root/apps/Gateway/Gateway/Event.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/Gateway/Gateway/Event.h')
-rw-r--r--apps/Gateway/Gateway/Event.h59
1 files changed, 37 insertions, 22 deletions
diff --git a/apps/Gateway/Gateway/Event.h b/apps/Gateway/Gateway/Event.h
index a8a9374be3c..24881c3e85b 100644
--- a/apps/Gateway/Gateway/Event.h
+++ b/apps/Gateway/Gateway/Event.h
@@ -17,33 +17,45 @@
#if !defined (EVENT)
#define EVENT
+#include "ace/OS.h"
+
// This is the unique connection identifier that denotes a particular
-// IO_Handler in the Gateway.
-typedef short CONN_ID;
+// Proxy_Handler in the Gateway.
+typedef ACE_INT32 ACE_INT32;
class Event_Addr
// = TITLE
// Address used to identify the source/destination of an event.
+ //
+ // = DESCRIPTION
+ // This is really a "virtual forwarding address" thatis used to
+ // decouple the filtering and forwarding logic of the Event
+ // Channel from the format of the data.
{
public:
- Event_Addr (CONN_ID cid = -1, unsigned char lid = 0, unsigned char pay = 0)
- : conn_id_ (cid), logical_id_ (lid), payload_ (pay) {}
-
- int operator== (const Event_Addr &pa) const
+ Event_Addr (ACE_INT32 cid = -1,
+ u_char sid = 0,
+ u_char type = 0)
+ : conn_id_ (cid),
+ supplier_id_ (sid),
+ type_ (type) {}
+
+ int operator== (const Event_Addr &event_addr) const
{
- return this->conn_id_ == pa.conn_id_
- && this->logical_id_ == pa.logical_id_
- && this->payload_ == pa.payload_;
+ return this->conn_id_ == event_addr.conn_id_
+ && this->supplier_id_ == event_addr.supplier_id_
+ && this->type_ == event_addr.type_;
}
- CONN_ID conn_id_;
- // Unique connection identifier that denotes a particular IO_Handler.
+ ACE_INT32 conn_id_;
+ // Unique connection identifier that denotes a particular
+ // Proxy_Handler.
- unsigned char logical_id_;
+ ACE_INT32 supplier_id_;
// Logical ID.
- unsigned char payload_;
- // Payload type.
+ ACE_INT32 type_;
+ // Event type.
};
@@ -52,24 +64,27 @@ class Event_Header
// Fixed sized header.
{
public:
- typedef unsigned short SUPPLIER_ID;
- // Type used to route messages from gatewayd.
+ typedef ACE_INT32 SUPPLIER_ID;
+ // Type used to forward events from gatewayd.
enum
{
INVALID_ID = -1 // No peer can validly use this number.
};
- SUPPLIER_ID routing_id_;
+ SUPPLIER_ID supplier_id_;
// Source ID.
+ ACE_INT32 type_;
+ // Event type.
+
size_t len_;
- // Length of the message in bytes.
+ // Length of the entire event (including data payload) in bytes.
};
class Event
// = TITLE
- // Variable-sized message (buf_ may be variable-sized between
+ // Variable-sized event (data_ may be variable-sized between
// 0 and MAX_PAYLOAD_SIZE).
{
public:
@@ -77,10 +92,10 @@ public:
// The maximum size of an Event.
Event_Header header_;
- // Message header.
+ // Event header.
- char buf_[MAX_PAYLOAD_SIZE];
- // Message payload.
+ char data_[MAX_PAYLOAD_SIZE];
+ // Event data.
};
#endif /* EVENT */