You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rh...@apache.org on 2014/09/17 21:48:07 UTC

svn commit: r1625783 - in /qpid/proton/trunk/proton-c: bindings/python/proton.py include/proton/event.h src/engine/engine.c src/events/event.c

Author: rhs
Date: Wed Sep 17 19:48:06 2014
New Revision: 1625783

URL: http://svn.apache.org/r1625783
Log:
removed event categories in favor of class ids

Modified:
    qpid/proton/trunk/proton-c/bindings/python/proton.py
    qpid/proton/trunk/proton-c/include/proton/event.h
    qpid/proton/trunk/proton-c/src/engine/engine.c
    qpid/proton/trunk/proton-c/src/events/event.c

Modified: qpid/proton/trunk/proton-c/bindings/python/proton.py
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/bindings/python/proton.py?rev=1625783&r1=1625782&r2=1625783&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/bindings/python/proton.py (original)
+++ qpid/proton/trunk/proton-c/bindings/python/proton.py Wed Sep 17 19:48:06 2014
@@ -3359,12 +3359,6 @@ class Collector:
 
 class Event:
 
-  CATEGORY_CONNECTION = PN_EVENT_CATEGORY_CONNECTION
-  CATEGORY_SESSION = PN_EVENT_CATEGORY_SESSION
-  CATEGORY_LINK = PN_EVENT_CATEGORY_LINK
-  CATEGORY_DELIVERY = PN_EVENT_CATEGORY_DELIVERY
-  CATEGORY_TRANSPORT = PN_EVENT_CATEGORY_TRANSPORT
-
   CONNECTION_INIT = PN_CONNECTION_INIT
   CONNECTION_OPEN = PN_CONNECTION_OPEN
   CONNECTION_CLOSE = PN_CONNECTION_CLOSE

Modified: qpid/proton/trunk/proton-c/include/proton/event.h
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/include/proton/event.h?rev=1625783&r1=1625782&r2=1625783&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/include/proton/event.h (original)
+++ qpid/proton/trunk/proton-c/include/proton/event.h Wed Sep 17 19:48:06 2014
@@ -77,19 +77,6 @@ extern "C" {
 typedef struct pn_event_t pn_event_t;
 
 /**
- * Related events are grouped into categories
- */
-typedef enum {
-    PN_EVENT_CATEGORY_NONE   = 0,
-    PN_EVENT_CATEGORY_CONNECTION = 0x00010000,
-    PN_EVENT_CATEGORY_SESSION = 0x00020000,
-    PN_EVENT_CATEGORY_LINK = 0x00030000,
-    PN_EVENT_CATEGORY_DELIVERY = 0x00040000,
-    PN_EVENT_CATEGORY_TRANSPORT = 0x00050000,
-    PN_EVENT_CATEGORY_COUNT = 6
-} pn_event_category_t;
-
-/**
  * An event type.
  */
 typedef enum {
@@ -104,130 +91,130 @@ typedef enum {
    * will ever be issued for a connection. Events of this type point
    * to the relevant connection.
    */
-  PN_CONNECTION_INIT = PN_EVENT_CATEGORY_CONNECTION + 1,
+  PN_CONNECTION_INIT = 1,
 
   /**
    * The local connection endpoint has been closed. Events of this
    * type point to the relevant connection.
    */
-  PN_CONNECTION_OPEN = PN_EVENT_CATEGORY_CONNECTION + 2,
+  PN_CONNECTION_OPEN = 2,
 
   /**
    * The remote endpoint has opened the connection. Events of this
    * type point to the relevant connection.
    */
-  PN_CONNECTION_REMOTE_OPEN = PN_EVENT_CATEGORY_CONNECTION + 3,
+  PN_CONNECTION_REMOTE_OPEN = 3,
 
   /**
    * The local connection endpoint has been closed. Events of this
    * type point to the relevant connection.
    */
-  PN_CONNECTION_CLOSE = PN_EVENT_CATEGORY_CONNECTION + 4,
+  PN_CONNECTION_CLOSE = 4,
 
   /**
    *  The remote endpoint has closed the connection. Events of this
    *  type point to the relevant connection.
    */
-  PN_CONNECTION_REMOTE_CLOSE = PN_EVENT_CATEGORY_CONNECTION + 5,
+  PN_CONNECTION_REMOTE_CLOSE = 5,
 
   /**
    * The connection has been freed and any outstanding processing has
    * been completed. This is the final event that will ever be issued
    * for a connection.
    */
-  PN_CONNECTION_FINAL = PN_EVENT_CATEGORY_CONNECTION + 6,
+  PN_CONNECTION_FINAL = 6,
 
   /**
    * The session has been created. This is the first event that will
    * ever be issued for a session.
    */
-  PN_SESSION_INIT = PN_EVENT_CATEGORY_SESSION + 1,
+  PN_SESSION_INIT = 11,
 
   /**
    * The local session endpoint has been opened. Events of this type
    * point ot the relevant session.
    */
-  PN_SESSION_OPEN = PN_EVENT_CATEGORY_SESSION + 2,
+  PN_SESSION_OPEN = 12,
 
   /**
    * The remote endpoint has opened the session. Events of this type
    * point to the relevant session.
    */
-  PN_SESSION_REMOTE_OPEN = PN_EVENT_CATEGORY_SESSION + 3,
+  PN_SESSION_REMOTE_OPEN = 13,
 
   /**
    * The local session endpoint has been closed. Events of this type
    * point ot the relevant session.
    */
-  PN_SESSION_CLOSE = PN_EVENT_CATEGORY_SESSION + 4,
+  PN_SESSION_CLOSE = 14,
 
   /**
    * The remote endpoint has closed the session. Events of this type
    * point to the relevant session.
    */
-  PN_SESSION_REMOTE_CLOSE = PN_EVENT_CATEGORY_SESSION + 5,
+  PN_SESSION_REMOTE_CLOSE = 15,
 
   /**
    * The session has been freed and any outstanding processing has
    * been completed. This is the final event that will ever be issued
    * for a session.
    */
-  PN_SESSION_FINAL = PN_EVENT_CATEGORY_SESSION + 6,
+  PN_SESSION_FINAL = 16,
 
   /**
    * The link has been created. This is the first event that will ever
    * be issued for a link.
    */
-  PN_LINK_INIT = PN_EVENT_CATEGORY_LINK + 1,
+  PN_LINK_INIT = 21,
 
   /**
    * The local link endpoint has been opened. Events of this type
    * point ot the relevant link.
    */
-  PN_LINK_OPEN = PN_EVENT_CATEGORY_LINK + 2,
+  PN_LINK_OPEN = 22,
 
   /**
    * The remote endpoint has opened the link. Events of this type
    * point to the relevant link.
    */
-  PN_LINK_REMOTE_OPEN = PN_EVENT_CATEGORY_LINK + 3,
+  PN_LINK_REMOTE_OPEN = 23,
 
   /**
    * The local link endpoint has been closed. Events of this type
    * point ot the relevant link.
    */
-  PN_LINK_CLOSE = PN_EVENT_CATEGORY_LINK + 4,
+  PN_LINK_CLOSE = 24,
 
   /**
    * The remote endpoint has closed the link. Events of this type
    * point to the relevant link.
    */
-  PN_LINK_REMOTE_CLOSE = PN_EVENT_CATEGORY_LINK + 5,
+  PN_LINK_REMOTE_CLOSE = 25,
 
   /**
    * The flow control state for a link has changed. Events of this
    * type point to the relevant link.
    */
-  PN_LINK_FLOW = PN_EVENT_CATEGORY_LINK + 6,
+  PN_LINK_FLOW = 26,
 
   /**
    * The link has been freed and any outstanding processing has been
    * completed. This is the final event that will ever be issued for a
    * link. Events of this type point to the relevant link.
    */
-  PN_LINK_FINAL = PN_EVENT_CATEGORY_LINK + 7,
+  PN_LINK_FINAL = 27,
 
   /**
    * A delivery has been created or updated. Events of this type point
    * to the relevant delivery.
    */
-  PN_DELIVERY = PN_EVENT_CATEGORY_DELIVERY + 1,
+  PN_DELIVERY = 31,
 
   /**
    * The transport has new data to read and/or write. Events of this
    * type point to the relevant transport.
    */
-  PN_TRANSPORT = PN_EVENT_CATEGORY_TRANSPORT + 1
+  PN_TRANSPORT = 41
 
 } pn_event_type_t;
 
@@ -306,14 +293,6 @@ PN_EXTERN bool pn_collector_pop(pn_colle
 PN_EXTERN pn_event_type_t pn_event_type(pn_event_t *event);
 
 /**
- * Get the category an event belongs to.
- *
- * @param[in] event an event object
- * @return the category the event belongs to
- */
-PN_EXTERN pn_event_category_t pn_event_category(pn_event_t *event);
-
-/**
  * Get the class associated with the event context.
  *
  * @param[in] event an event object

Modified: qpid/proton/trunk/proton-c/src/engine/engine.c
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/src/engine/engine.c?rev=1625783&r1=1625782&r2=1625783&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/engine/engine.c (original)
+++ qpid/proton/trunk/proton-c/src/engine/engine.c Wed Sep 17 19:48:06 2014
@@ -1738,10 +1738,10 @@ pn_connection_t *pn_event_connection(pn_
   pn_session_t *ssn;
   pn_transport_t *transport;
 
-  switch (pn_event_category(event)) {
-  case PN_EVENT_CATEGORY_CONNECTION:
+  switch (pn_class_id(pn_event_class(event))) {
+  case CID_pn_connection:
     return (pn_connection_t *) pn_event_context(event);
-  case PN_EVENT_CATEGORY_TRANSPORT:
+  case CID_pn_transport:
     transport = pn_event_transport(event);
     if (transport)
       return transport->connection;
@@ -1757,8 +1757,8 @@ pn_connection_t *pn_event_connection(pn_
 pn_session_t *pn_event_session(pn_event_t *event)
 {
   pn_link_t *link;
-  switch (pn_event_category(event)) {
-  case PN_EVENT_CATEGORY_SESSION:
+  switch (pn_class_id(pn_event_class(event))) {
+  case CID_pn_session:
     return (pn_session_t *) pn_event_context(event);
   default:
     link = pn_event_link(event);
@@ -1771,8 +1771,8 @@ pn_session_t *pn_event_session(pn_event_
 pn_link_t *pn_event_link(pn_event_t *event)
 {
   pn_delivery_t *dlv;
-  switch (pn_event_category(event)) {
-  case PN_EVENT_CATEGORY_LINK:
+  switch (pn_class_id(pn_event_class(event))) {
+  case CID_pn_link:
     return (pn_link_t *) pn_event_context(event);
   default:
     dlv = pn_event_delivery(event);
@@ -1784,8 +1784,8 @@ pn_link_t *pn_event_link(pn_event_t *eve
 
 pn_delivery_t *pn_event_delivery(pn_event_t *event)
 {
-  switch (pn_event_category(event)) {
-  case PN_EVENT_CATEGORY_DELIVERY:
+  switch (pn_class_id(pn_event_class(event))) {
+  case CID_pn_delivery:
     return (pn_delivery_t *) pn_event_context(event);
   default:
     return NULL;
@@ -1794,8 +1794,8 @@ pn_delivery_t *pn_event_delivery(pn_even
 
 pn_transport_t *pn_event_transport(pn_event_t *event)
 {
-  switch (pn_event_category(event)) {
-  case PN_EVENT_CATEGORY_TRANSPORT:
+  switch (pn_class_id(pn_event_class(event))) {
+  case CID_pn_transport:
     return (pn_transport_t *) pn_event_context(event);
   default:
     {

Modified: qpid/proton/trunk/proton-c/src/events/event.c
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/src/events/event.c?rev=1625783&r1=1625782&r2=1625783&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/events/event.c (original)
+++ qpid/proton/trunk/proton-c/src/events/event.c Wed Sep 17 19:48:06 2014
@@ -217,11 +217,6 @@ pn_event_type_t pn_event_type(pn_event_t
   return event->type;
 }
 
-pn_event_category_t pn_event_category(pn_event_t *event)
-{
-  return (pn_event_category_t)(event->type & 0xFFFF0000);
-}
-
 const pn_class_t *pn_event_class(pn_event_t *event)
 {
   assert(event);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org