proton/event.h

Go to the documentation of this file.
00001 #ifndef PROTON_EVENT_H
00002 #define PROTON_EVENT_H 1
00003 
00004 /*
00005  *
00006  * Licensed to the Apache Software Foundation (ASF) under one
00007  * or more contributor license agreements.  See the NOTICE file
00008  * distributed with this work for additional information
00009  * regarding copyright ownership.  The ASF licenses this file
00010  * to you under the Apache License, Version 2.0 (the
00011  * "License"); you may not use this file except in compliance
00012  * with the License.  You may obtain a copy of the License at
00013  *
00014  *   http://www.apache.org/licenses/LICENSE-2.0
00015  *
00016  * Unless required by applicable law or agreed to in writing,
00017  * software distributed under the License is distributed on an
00018  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00019  * KIND, either express or implied.  See the License for the
00020  * specific language governing permissions and limitations
00021  * under the License.
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 } pn_event_type_t;
00352 
00353 
00360 PN_EXTERN const char *pn_event_type_name(pn_event_type_t type);
00361 
00370 PN_EXTERN pn_collector_t *pn_collector(void);
00371 
00377 PN_EXTERN void pn_collector_free(pn_collector_t *collector);
00378 
00387 PN_EXTERN void pn_collector_release(pn_collector_t *collector);
00388 
00394 PN_EXTERN void pn_collector_drain(pn_collector_t *collector);
00395 
00413 PN_EXTERN pn_event_t *pn_collector_put(pn_collector_t *collector,
00414                                        const pn_class_t *clazz, void *context,
00415                                        pn_event_type_t type);
00416 
00428 PN_EXTERN pn_event_t *pn_collector_peek(pn_collector_t *collector);
00429 
00436 PN_EXTERN bool pn_collector_pop(pn_collector_t *collector);
00437 
00445 PN_EXTERN pn_event_t *pn_collector_next(pn_collector_t *collector);
00446 
00453 PN_EXTERN pn_event_t *pn_collector_prev(pn_collector_t *collector);
00454 
00463 PN_EXTERN  bool pn_collector_more(pn_collector_t *collector);
00464 
00471 PN_EXTERN pn_event_type_t pn_event_type(pn_event_t *event);
00472 
00479 PN_EXTERN const pn_class_t *pn_event_class(pn_event_t *event);
00480 
00484 PN_EXTERN void *pn_event_context(pn_event_t *event);
00485 
00492 PN_EXTERN pn_connection_t *pn_event_connection(pn_event_t *event);
00493 
00500 PN_EXTERN pn_session_t *pn_event_session(pn_event_t *event);
00501 
00508 PN_EXTERN pn_link_t *pn_event_link(pn_event_t *event);
00509 
00516 PN_EXTERN pn_delivery_t *pn_event_delivery(pn_event_t *event);
00517 
00524 PN_EXTERN pn_transport_t *pn_event_transport(pn_event_t *event);
00525 
00532 PN_EXTERN pn_record_t *pn_event_attachments(pn_event_t *event);
00533 
00540 PN_EXTERN struct pn_condition_t *pn_event_condition(pn_event_t *event);
00541 
00547 typedef struct pn_event_batch_t pn_event_batch_t;
00548 
00549 /* NOTE: there is deliberately no peek(), more() or other look-ahead on an event
00550  * batch. We want to know exactly which events have been handled, next() only
00551  * allows the user to get each event exactly once, in order.
00552  */
00553 
00560 PN_EXTERN pn_event_t *pn_event_batch_next(pn_event_batch_t *batch);
00561 
00567 struct pn_event_batch_t {
00568   pn_event_t *(*next_event)(pn_event_batch_t *batch);
00569 };
00574 #ifdef __cplusplus
00575 }
00576 #endif
00577 
00582 #endif /* event.h */

Generated on 28 Nov 2017 for Qpid Proton C by  doxygen 1.6.1