00001 #ifndef PROTON_EVENT_H
00002 #define PROTON_EVENT_H 1
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <proton/import_export.h>
00026 #include <proton/type_compat.h>
00027 #include <proton/object.h>
00028 #include <stddef.h>
00029
00030 #ifdef __cplusplus
00031 extern "C" {
00032 #endif
00033
00075 typedef struct pn_event_t pn_event_t;
00076
00080 typedef enum {
00085 PN_EVENT_NONE = 0,
00086
00090 PN_REACTOR_INIT,
00091
00096 PN_REACTOR_QUIESCED,
00097
00101 PN_REACTOR_FINAL,
00102
00106 PN_TIMER_TASK,
00107
00113 PN_CONNECTION_INIT,
00114
00119 PN_CONNECTION_BOUND,
00120
00125 PN_CONNECTION_UNBOUND,
00126
00131 PN_CONNECTION_LOCAL_OPEN,
00132
00137 PN_CONNECTION_REMOTE_OPEN,
00138
00143 PN_CONNECTION_LOCAL_CLOSE,
00144
00149 PN_CONNECTION_REMOTE_CLOSE,
00150
00156 PN_CONNECTION_FINAL,
00157
00162 PN_SESSION_INIT,
00163
00168 PN_SESSION_LOCAL_OPEN,
00169
00174 PN_SESSION_REMOTE_OPEN,
00175
00180 PN_SESSION_LOCAL_CLOSE,
00181
00186 PN_SESSION_REMOTE_CLOSE,
00187
00193 PN_SESSION_FINAL,
00194
00199 PN_LINK_INIT,
00200
00205 PN_LINK_LOCAL_OPEN,
00206
00211 PN_LINK_REMOTE_OPEN,
00212
00217 PN_LINK_LOCAL_CLOSE,
00218
00223 PN_LINK_REMOTE_CLOSE,
00224
00229 PN_LINK_LOCAL_DETACH,
00230
00235 PN_LINK_REMOTE_DETACH,
00236
00241 PN_LINK_FLOW,
00242
00248 PN_LINK_FINAL,
00249
00254 PN_DELIVERY,
00255
00260 PN_TRANSPORT,
00261
00268 PN_TRANSPORT_AUTHENTICATED,
00269
00275 PN_TRANSPORT_ERROR,
00276
00282 PN_TRANSPORT_HEAD_CLOSED,
00283
00289 PN_TRANSPORT_TAIL_CLOSED,
00290
00295 PN_TRANSPORT_CLOSED,
00296
00297 PN_SELECTABLE_INIT,
00298 PN_SELECTABLE_UPDATED,
00299 PN_SELECTABLE_READABLE,
00300 PN_SELECTABLE_WRITABLE,
00301 PN_SELECTABLE_ERROR,
00302 PN_SELECTABLE_EXPIRED,
00303 PN_SELECTABLE_FINAL,
00304
00309 PN_CONNECTION_WAKE,
00310
00316 PN_LISTENER_ACCEPT,
00317
00322 PN_LISTENER_CLOSE,
00323
00328 PN_PROACTOR_INTERRUPT,
00329
00334 PN_PROACTOR_TIMEOUT,
00335
00344 PN_PROACTOR_INACTIVE,
00345
00350 PN_LISTENER_OPEN,
00351
00362 PN_RAW_CONNECTION_CONNECTED,
00363
00374 PN_RAW_CONNECTION_CLOSED_READ,
00375
00386 PN_RAW_CONNECTION_CLOSED_WRITE,
00387
00398 PN_RAW_CONNECTION_DISCONNECTED,
00399
00411 PN_RAW_CONNECTION_NEED_READ_BUFFERS,
00412
00425 PN_RAW_CONNECTION_NEED_WRITE_BUFFERS,
00426
00440 PN_RAW_CONNECTION_READ,
00441
00455 PN_RAW_CONNECTION_WRITTEN,
00456
00462 PN_RAW_CONNECTION_WAKE
00463
00464 } pn_event_type_t;
00465
00466
00473 PN_EXTERN const char *pn_event_type_name(pn_event_type_t type);
00474
00483 PN_EXTERN pn_collector_t *pn_collector(void);
00484
00490 PN_EXTERN void pn_collector_free(pn_collector_t *collector);
00491
00500 PN_EXTERN void pn_collector_release(pn_collector_t *collector);
00501
00507 PN_EXTERN void pn_collector_drain(pn_collector_t *collector);
00508
00526 PN_EXTERN pn_event_t *pn_collector_put(pn_collector_t *collector,
00527 const pn_class_t *clazz, void *context,
00528 pn_event_type_t type);
00529
00541 PN_EXTERN pn_event_t *pn_collector_peek(pn_collector_t *collector);
00542
00549 PN_EXTERN bool pn_collector_pop(pn_collector_t *collector);
00550
00558 PN_EXTERN pn_event_t *pn_collector_next(pn_collector_t *collector);
00559
00566 PN_EXTERN pn_event_t *pn_collector_prev(pn_collector_t *collector);
00567
00576 PN_EXTERN bool pn_collector_more(pn_collector_t *collector);
00577
00584 PN_EXTERN pn_event_type_t pn_event_type(pn_event_t *event);
00585
00592 PN_EXTERN const pn_class_t *pn_event_class(pn_event_t *event);
00593
00597 PN_EXTERN void *pn_event_context(pn_event_t *event);
00598
00605 PN_EXTERN pn_connection_t *pn_event_connection(pn_event_t *event);
00606
00613 PN_EXTERN pn_session_t *pn_event_session(pn_event_t *event);
00614
00621 PN_EXTERN pn_link_t *pn_event_link(pn_event_t *event);
00622
00629 PN_EXTERN pn_delivery_t *pn_event_delivery(pn_event_t *event);
00630
00637 PN_EXTERN pn_transport_t *pn_event_transport(pn_event_t *event);
00638
00645 PN_EXTERN pn_record_t *pn_event_attachments(pn_event_t *event);
00646
00653 PN_EXTERN struct pn_condition_t *pn_event_condition(pn_event_t *event);
00654
00655 #ifdef __cplusplus
00656 }
00657 #endif
00658
00663 #endif