OpenMAMA
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
subscription.h
Go to the documentation of this file.
1 /* $Id$
2  *
3  * OpenMAMA: The open middleware agnostic messaging API
4  * Copyright (C) 2011 NYSE Technologies, Inc.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301 USA
20  */
21 
22 #ifndef MamaSubscriptionH__
23 #define MamaSubscriptionH__
24 
25 /* *************************************************** */
26 /* Includes. */
27 /* *************************************************** */
28 #include "mama/marketdata.h"
29 #include "mama/msg.h"
30 #include "mama/quality.h"
31 #include "mama/servicelevel.h"
32 #include "mama/status.h"
33 #include "mama/subscriptiontype.h"
34 #include "mama/transport.h"
35 #include "mama/types.h"
36 
37 #if defined (__cplusplus)
38 extern "C" {
39 #endif
40 
41 /* *************************************************** */
42 /* Enumerations. */
43 /* *************************************************** */
44 
57 typedef enum
58 {
61 
63 
70 typedef enum
71 {
72  /* The state of the subscription is unknown. */
74 
75  /* The subscription has been allocated in memory. */
77 
78  /* Initial setup work has been done, mamaSubscription_activate must still be called. Note that this state is only valid
79  * for market data subscriptions.
80  */
82 
83  /* The subscription is now on the throttle queue waiting to be fully activated. */
85 
86  /* The subscription is now fully activated and is processing messages. */
88 
89  /* The subscription is being de-activated, it will not be fully deactivated until the middleware removal of the listener is complete */
91 
92  /* The subscription has been de-activated, messages are no longer being processed. */
94 
95  /* The subscription is being destroyed, but waiting on deactivation to complete*/
97 
98  /* The subscription has been fully destroyed. */
100 
101  /* The subscription is in the process of being de-allocated, but waiting on deactivation to complete*/
103 
104  /* The subscription has been de-allocated. This state is only temporary and exists until such point as the subscription's
105  * memory is freed. It is provided so that a log entry will be written out.
106  */
108 
109  /* The subscription is being re-activated, it will not be fully reactivated until deactivation complete */
111 
113 
114 typedef enum
115 {
119 
120 
121 typedef enum
122 {
126 /* *************************************************** */
127 /* Type Defines. */
128 /* *************************************************** */
129 
137 typedef void (MAMACALLTYPE *wombat_subscriptionCreateCB)(
138  mamaSubscription subscription,
139  void *closure);
140 
149 typedef void (MAMACALLTYPE *wombat_subscriptionDestroyCB)(
150  mamaSubscription subscription,
151  void *closure);
152 
169 typedef void (MAMACALLTYPE *wombat_subscriptionErrorCB)(
170  mamaSubscription subscription,
172  void *platformError,
173  const char *subject,
174  void *closure);
175 
185 typedef void (MAMACALLTYPE *wombat_subscriptionGapCB)(
186  mamaSubscription subscription,
187  void *closure);
188 
198 typedef void (MAMACALLTYPE *wombat_subscriptionOnMsgCB)(
199  mamaSubscription subscription,
200  mamaMsg msg,
201  void *closure,
202  void *itemClosure);
203 
220 typedef void (MAMACALLTYPE *wombat_subscriptionQualityCB)(
221  mamaSubscription subscription,
222  mamaQuality quality,
223  const char *symbol,
224  short cause,
225  const void *platformInfo,
226  void *closure);
227 
235 typedef void (MAMACALLTYPE *wombat_subscriptionRecapCB)(
236  mamaSubscription subscription,
237  void *closure);
238 
248 typedef void (MAMACALLTYPE *wombat_subscriptionWildCardOnMsgCB)(
249  mamaSubscription subscription,
250  mamaMsg msg,
251  const char *topic,
252  void *closure,
253  void *itemClosure);
254 
255 /* *************************************************** */
256 /* Structures. */
257 /* *************************************************** */
258 
263 typedef struct mamaMsgCallbacks_
264 {
273 
279 {
285 
286 /* *************************************************** */
287 /* Public Function Prototypes. */
288 /* *************************************************** */
289 
310 MAMAExpDLL
311 extern mama_status
313  mamaSubscription subscription);
314 
329 MAMAExpDLL
330 extern mama_status
332  mamaSubscription *result);
333 
344 MAMAExpDLL
345 extern int
347  mamaSubscription subscription,
348  MamaLogLevel level);
349 
370 MAMAExpDLL
371 extern mama_status
373  mamaSubscription subscription,
374  mamaQueue queue,
375  const mamaMsgCallbacks* callbacks,
377  const char* symbol,
378  void* closure);
379 
400 MAMAExpDLL
401 extern mama_status
403  mamaSubscription subscription,
404  mamaTransport transport,
405  mamaQueue queue,
406  const mamaMsgCallbacks* callbacks,
407  const char* symbol,
408  void* closure);
409 
448 MAMAExpDLL
449 extern mama_status
451  mamaSubscription subscription,
452  mamaTransport transport,
453  mamaQueue queue,
454  const mamaWildCardMsgCallbacks* callbacks,
455  const char* source,
456  const char* symbol,
457  void* closure);
458 
480 MAMAExpDLL
481 extern mama_status
483  mamaSubscription subscription,
484  mamaQueue queue,
485  const mamaMsgCallbacks* callbacks,
487  const char* symbol,
488  void* closure);
489 
506 MAMAExpDLL
507 extern mama_status
509  mamaSubscription subscription);
510 
524 MAMAExpDLL
525 extern mama_status
527  mamaSubscription subscription);
528 
548 MAMAExpDLL
549 extern mama_status
551  mamaSubscription subscription);
552 
567 MAMAExpDLL
568 extern mama_status
570  mamaSubscription subscription);
571 
582 MAMAExpDLL
583 extern mama_status
585  mamaSubscription subscription,
586  uint8_t *appDataType);
587 
598 MAMAExpDLL
599 extern mama_status
601  mamaSubscription subscription,
602  void **closure);
603 
611 MAMAExpDLL
612 extern MamaLogLevel
614  mamaSubscription subscription);
615 
616 
628 MAMAExpDLL
629 extern mama_status
631  mamaSubscription subscription,
632  void **closure);
633 
659 MAMAExpDLL
662  mamaSubscription subscription,
663  int *ignoreDefinitelyDuplicate,
664  int *ignorePossiblyDuplicate,
665  int *ignoreDefinitelyDelayed,
666  int *ignorePossiblyDelayed,
667  int *ignoreOutOfSequence);
668 
682 MAMAExpDLL
683 extern mama_status
685  mamaSubscription subsc,
686  void **error);
687 
698 MAMAExpDLL
699 extern mama_status
701  mamaSubscription subscription,
702  int *result);
703 
714 MAMAExpDLL
715 extern mama_status
717  mamaSubscription subscription,
718  mamaQueue *queue);
719 
731 MAMAExpDLL
732 extern mama_status
734  mamaSubscription subscription,
735  int *receivedInitial);
736 
748 MAMAExpDLL
749 extern mama_status
751  mamaSubscription subscription,
752  int *doesRecover);
753 
765 MAMAExpDLL
766 extern mama_status
768  mamaSubscription subscription,
769  int *requiresInitial);
770 
781 MAMAExpDLL
782 extern mama_status
784  mamaSubscription subscription,
785  int *retries);
786 
798 MAMAExpDLL
799 extern mama_status
801  mamaSubscription subscription,
802  mamaServiceLevel *serviceLevel);
803 
815 MAMAExpDLL
816 extern mama_status
818  mamaSubscription subscription,
819  long *serviceLevel);
820 
821 
834 MAMAExpDLL
835 extern mama_status
837  mamaSubscription subscription,
838  const char** source);
839 
853 MAMAExpDLL
854 extern mama_status
856  mamaSubscription subscription,
858 
870 MAMAExpDLL
871 extern mama_status
873  mamaSubscription subscription,
874  mamaSubscriptionType *type);
875 
889 MAMAExpDLL
890 extern mama_status
892  mamaSubscription subscription,
893  const char **symbol);
894 
907 MAMAExpDLL
908 extern mama_status
910  mamaSubscription subscription,
911  const char **symbol);
912 
923 MAMAExpDLL
924 extern mama_status
926  mamaSubscription subscription,
927  double *timeout);
928 
939 MAMAExpDLL
940 extern mama_status
942  mamaSubscription subscription,
943  mamaTransport *transport);
944 
953 MAMAExpDLL
954 extern mamaMsgCallbacks *
956  mamaSubscription subscription);
957 
966 MAMAExpDLL
967 extern int
969  mamaSubscription subscription);
970 
979 MAMAExpDLL
980 extern int
982  mamaSubscription subscription);
983 
1000 MAMAExpDLL
1001 extern mama_status
1003  mamaSubscription subscription);
1004 
1016 MAMAExpDLL
1017 extern mama_status
1019  mamaSubscription subscription,
1020  uint8_t appDataType);
1021 
1032 MAMAExpDLL
1033 extern mama_status
1035  mamaSubscription subscription,
1036  MamaLogLevel level);
1037 
1048 MAMAExpDLL
1049 extern mama_status
1051  mamaSubscription subscription,
1052  int groupSizeHint);
1053 
1074 MAMAExpDLL
1075 extern mama_status
1077  mamaSubscription subscription,
1078  void *closure);
1079 
1104 MAMAExpDLL
1107  mamaSubscription subscription,
1108  int ignoreDefinitelyDuplicate,
1109  int ignorePossiblyDuplicate,
1110  int ignoreDefinitelyDelayed,
1111  int ignorePossiblyDelayed,
1112  int ignoreOutOfSequence);
1113 
1130 MAMAExpDLL
1131 extern mama_status
1133  mamaSubscription subscription,
1134  int cacheSize);
1135 
1148 MAMAExpDLL
1149 extern mama_status
1151  mamaSubscription subscription,
1152  int doesRecover);
1153 
1167 MAMAExpDLL
1168 extern mama_status
1170  mamaSubscription subscription,
1171  int requiresInitial);
1172 
1187 MAMAExpDLL
1188 extern mama_status
1190  mamaSubscription subscription,
1191  mamaServiceLevel serviceLevel,
1192  long serviceLevelOpt);
1193 
1204 MAMAExpDLL
1205 extern mama_status
1207  mamaSubscription subscription,
1208  int retries);
1209 
1222 MAMAExpDLL
1223 extern mama_status
1225  mamaSubscription subscription,
1226  mamaSubscriptionType type);
1227 
1239 MAMAExpDLL
1240 extern mama_status
1242  mamaSubscription subscription,
1243  const char *symbol);
1244 
1256 MAMAExpDLL
1257 extern mama_status
1259  mamaSubscription subscription,
1260  double timeout);
1261 
1285 MAMAExpDLL
1286 extern mama_status
1288  mamaSubscription subscription,
1289  mamaQueue queue,
1290  const mamaMsgCallbacks* callbacks,
1292  const char* symbol,
1293  void* closure);
1294 
1319 MAMAExpDLL
1320 extern mama_status
1322  mamaSubscription subscription,
1323  mamaTransport transport,
1324  mamaQueue queue,
1325  const mamaMsgCallbacks *callbacks,
1326  const char *sourceName,
1327  const char *symbol,
1328  void *closure);
1329 
1364 MAMAExpDLL
1365 extern mama_status
1367  mamaSubscription subscription,
1368  mamaTransport transport,
1369  mamaQueue queue,
1370  const mamaWildCardMsgCallbacks* callbacks,
1371  const char* source,
1372  const char* symbol,
1373  void* closure);
1374 
1383 MAMAExpDLL
1384 extern const char*
1387 
1388 #if defined (__cplusplus)
1389 }
1390 #endif
1391 
1392 #endif


© 2012 Linux Foundation