Apama  10.5.4.1
AP_TimestampSet.h
Go to the documentation of this file.
1 /*
2  * Title: AP_TimestampSet.h
3  * Description: High-accuracy time stamp generator
4  * $Copyright(c) 2008, 2009, 2011-2012 Progress Software Corporation (PSC). All rights reserved.$
5  * $Copyright (c) 2013-2018 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.$
6  * Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG
7  * @author Henry Lockwood
8  * @version $Id: CTimeStamp.h 78362 2008-04-15 15:28:55Z hlockwoo $
9  */
10 
11 #ifndef AP_TIMESTAMP_SET_H
12 #define AP_TIMESTAMP_SET_H
13 
14 #include <AP_Platform.h>
15 #include <IAF_Platform.h>
16 #include <sys/timeb.h>
17 #include <string.h>
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
27 /*
28  * High-res timestamp IDs. These are symbolic constants used to index
29  * where a timestamp was created.
30  */
31 
32 /*
33  * Downstream (incoming towards correlator) timestamp IDs
34  */
35 
36 /* 1000-1999 are for downstream events in the IAF */
37 #define AP_TIMESTAMP_DOWNSTREAM_IAF_MIN 1000
38 
40 #define AP_TIMESTAMP_DOWNSTREAM_IAF_TRANSPORT_ENTRY 1000
41 
42 #define AP_TIMESTAMP_DOWNSTREAM_IAF_TRANSPORT_EXIT 1249
43 
45 #define AP_TIMESTAMP_DOWNSTREAM_IAF_DECODER_ENTRY 1250
46 
47 #define AP_TIMESTAMP_DOWNSTREAM_IAF_DECODER_EXIT 1499
48 
50 #define AP_TIMESTAMP_DOWNSTREAM_IAF_MAPPER_ENTRY 1500
51 
52 #define AP_TIMESTAMP_DOWNSTREAM_IAF_MAPPER_EXIT 1749
53 
55 #define AP_TIMESTAMP_DOWNSTREAM_IAF_APAMA_ENTRY 1750
56 
57 #define AP_TIMESTAMP_DOWNSTREAM_IAF_APAMA_EXIT 1999
58 #define AP_TIMESTAMP_DOWNSTREAM_IAF_MAX 1999
59 
60 /* 3000-3999 are for downstream events in the sender */
61 #define AP_TIMESTAMP_DOWNSTREAM_SENDER_MIN 3000
62 #define AP_TIMESTAMP_DOWNSTREAM_SENDER_MAX 3999
63 
64 /* 5000-5999 are for downstream events in the correlator */
65 #define AP_TIMESTAMP_DOWNSTREAM_CORRELATOR_MIN 5000
66 #define AP_TIMESTAMP_DOWNSTREAM_CORRELATOR_INPUT_MIN 5000
67 #define AP_TIMESTAMP_DOWNSTREAM_CORRELATOR_INPUT_MAX 5099
68 #define AP_TIMESTAMP_DOWNSTREAM_CORRELATOR_SERVICE_MONITOR_MIN 5100
69 #define AP_TIMESTAMP_DOWNSTREAM_CORRELATOR_SERVICE_MONITOR_MAX 5299
70 /* Reserved for internal Apama framework use */
71 #define AP_TIMESTAMP_DOWNSTREAM_CORRELATOR_RESERVED1_MIN 5300
72 #define AP_TIMESTAMP_DOWNSTREAM_CORRELATOR_RESERVED1_MAX 5499
73 #define AP_TIMESTAMP_DOWNSTREAM_CORRELATOR_RESERVED2_MIN 5500
74 #define AP_TIMESTAMP_DOWNSTREAM_CORRELATOR_RESERVED2_MAX 5699
75 #define AP_TIMESTAMP_DOWNSTREAM_CORRELATOR_APPLICATION_MIN 5700
76 #define AP_TIMESTAMP_DOWNSTREAM_CORRELATOR_APPLICATION_MAX 5899
77 #define AP_TIMESTAMP_DOWNSTREAM_CORRELATOR_OUTPUT_MIN 5900
78 #define AP_TIMESTAMP_DOWNSTREAM_CORRELATOR_OUTPUT_MAX 5999
79 #define AP_TIMESTAMP_DOWNSTREAM_CORRELATOR_MAX 5999
80 
81 /* 7000-7999 are for downstream events in the merger */
82 #define AP_TIMESTAMP_DOWNSTREAM_MERGER_MIN 7000
83 #define AP_TIMESTAMP_DOWNSTREAM_MERGE_MAX 7999
84 
85 /* 9000-9999 are for downstream events in an external receiver client */
86 #define AP_TIMESTAMP_DOWNSTREAM_CLIENT_MIN 9000
87 #define AP_TIMESTAMP_DOWNSTREAM_CLIENT_MAX 9999
88 
89 /*
90  * Upstream (outgoing from correlator) timestamp IDs
91  */
92 
93 /* 11000-11999 are for upstream events in an external sender client */
94 #define AP_TIMESTAMP_UPSTREAM_CLIENT_MIN 11000
95 #define AP_TIMESTAMP_UPSTREAM_CLIENT_MAX 11999
96 
97 /* 13000-13999 are for upstream events in the sender */
98 #define AP_TIMESTAMP_UPSTREAM_SENDER_MIN 13000
99 #define AP_TIMESTAMP_UPSTREAM_SENDER_MAX 13999
100 
101 /* 15000-15999 are for upstream events in the correlator */
102 #define AP_TIMESTAMP_UPSTREAM_CORRELATOR_MIN 15000
103 #define AP_TIMESTAMP_UPSTREAM_CORRELATOR_INPUT_MIN 15000
104 #define AP_TIMESTAMP_UPSTREAM_CORRELATOR_INPUT_MAX 15099
105 #define AP_TIMESTAMP_UPSTREAM_CORRELATOR_APPLICATION_MIN 15100
106 #define AP_TIMESTAMP_UPSTREAM_CORRELATOR_APPLICATION_MAX 15299
107 /* Reserved for internal Apama framework use */
108 #define AP_TIMESTAMP_UPSTREAM_CORRELATOR_RESERVED2_MIN 15300
109 #define AP_TIMESTAMP_UPSTREAM_CORRELATOR_RESERVED2_MAX 15499
110 #define AP_TIMESTAMP_UPSTREAM_CORRELATOR_RESERVED1_MIN 15500
111 #define AP_TIMESTAMP_UPSTREAM_CORRELATOR_RESERVED1_MAX 15699
112 #define AP_TIMESTAMP_UPSTREAM_CORRELATOR_SERVICE_MONITOR_MIN 15700
113 #define AP_TIMESTAMP_UPSTREAM_CORRELATOR_SERVICE_MONITOR_MAX 15899
114 #define AP_TIMESTAMP_UPSTREAM_CORRELATOR_OUTPUT_MIN 15900
115 #define AP_TIMESTAMP_UPSTREAM_CORRELATOR_OUTPUT_MAX 15999
116 #define AP_TIMESTAMP_UPSTREAM_CORRELATOR_MAX 15999
117 
118 /* 17000-17999 are for upstream events in the merger */
119 #define AP_TIMESTAMP_UPSTREAM_MERGER_MIN 17000
120 #define AP_TIMESTAMP_UPSTREAM_MERGER_MAX 17999
121 
122 /* 19000-19999 are for upstream events in the IAF */
123 #define AP_TIMESTAMP_UPSTREAM_IAF_MIN 19000
124 
125 #define AP_TIMESTAMP_UPSTREAM_IAF_APAMA_ENTRY 19000
126 
127 #define AP_TIMESTAMP_UPSTREAM_IAF_APAMA_EXIT 19249
128 
130 #define AP_TIMESTAMP_UPSTREAM_IAF_MAPPER_ENTRY 19250
131 
132 #define AP_TIMESTAMP_UPSTREAM_IAF_MAPPER_EXIT 19499
133 
135 #define AP_TIMESTAMP_UPSTREAM_IAF_ENCODER_ENTRY 19500
136 
137 #define AP_TIMESTAMP_UPSTREAM_IAF_ENCODER_EXIT 19749
138 
140 #define AP_TIMESTAMP_UPSTREAM_IAF_TRANSPORT_ENTRY 19750
141 
142 #define AP_TIMESTAMP_UPSTREAM_IAF_TRANSPORT_EXIT 19999
143 
144 #define AP_TIMESTAMP_UPSTREAM_IAF_MAX 19999
145 
146 
156 
161 typedef AP_uint64 AP_TimestampSetIndex;
162 
163 
168 typedef double AP_TimestampSetTime;
169 
170 
184 {
195  void (*addNow)(struct AP_TimestampSet* timestamp, AP_TimestampSetIndex index);
196 
208  void (*addTime)(struct AP_TimestampSet* timestamp, AP_TimestampSetIndex index, AP_TimestampSetTime time);
209 
222  void (*replace)(struct AP_TimestampSet* timestamp, AP_TimestampSetIndex index, AP_TimestampSetTime newTime);
223 
235  void (*replaceWithNow)(struct AP_TimestampSet* timestamp, AP_TimestampSetIndex index);
236 
249 
266 
270  AP_bool (*getNextStampAndRemove)(struct AP_TimestampSet* timestamp, AP_TimestampSetIndex* retIndex, AP_TimestampSetTime* retTime);
271 
280  AP_uint32 (*getSize)(struct AP_TimestampSet* timestamp);
281 
292  AP_char8* (*toString)(struct AP_TimestampSet* timestamp);
293 };
294 
295 
308 
312  void* reserved;
313 
319 
320 };
321 typedef struct AP_TimestampSet AP_TimestampSet;
322 
323 
332 AP_COMMON_API AP_TimestampSet* AP_TimestampSet_ctor();
333 
334 
346 
347 
356 AP_COMMON_API void AP_TimestampSet_dtor(AP_TimestampSet* timestamp);
357 
371 
372 #ifdef __cplusplus
373 } /* extern "C" */
374 #endif
375 
376 #endif /* __CTIMESTAMP_HA_INCLUDED__ */
AP_TimestampSetTime(* findTimeAndRemove)(struct AP_TimestampSet *timestamp, AP_TimestampSetIndex index)
findTimeAndRemove
Definition: AP_TimestampSet.h:265
AP_uint64 AP_TimestampSetIndex
Field keys are integer indices.
Definition: AP_TimestampSet.h:155
AP_TimestampSet_Functions.
Definition: AP_TimestampSet.h:183
void(* addNow)(struct AP_TimestampSet *timestamp, AP_TimestampSetIndex index)
addNow
Definition: AP_TimestampSet.h:195
struct AP_TimestampSet_Functions * functions
Function table of internal operations on the timestamp object.
Definition: AP_TimestampSet.h:318
void * reserved
Pointer to private internal data.
Definition: AP_TimestampSet.h:312
AP_uint32(* getSize)(struct AP_TimestampSet *timestamp)
getSize
Definition: AP_TimestampSet.h:280
AP_COMMON_API AP_TimestampSet * AP_TimestampSet_ctor()
AP_TimestampSet_ctor.
AP_COMMON_API AP_TimestampSet * AP_TimestampSet_copy(AP_TimestampSet *old)
AP_TimestampSet_copy.
double AP_TimestampSetTime
Field values are double-precision floating point numbers.
Definition: AP_TimestampSet.h:168
AP_TimestampSetTime(* findTime)(struct AP_TimestampSet *timestamp, AP_TimestampSetIndex index)
findTime
Definition: AP_TimestampSet.h:248
AP_bool(* getNextStampAndRemove)(struct AP_TimestampSet *timestamp, AP_TimestampSetIndex *retIndex, AP_TimestampSetTime *retTime)
getNextStampAndRemove
Definition: AP_TimestampSet.h:270
AP_TimestampSet.
Definition: AP_TimestampSet.h:307
void(* replace)(struct AP_TimestampSet *timestamp, AP_TimestampSetIndex index, AP_TimestampSetTime newTime)
replace
Definition: AP_TimestampSet.h:222
AP_COMMON_API AP_TimestampSetTime AP_TimestampSet_getRelativeTime()
AP_TimestampSet_getRelativeTime.
void(* replaceWithNow)(struct AP_TimestampSet *timestamp, AP_TimestampSetIndex index)
replaceWithNow
Definition: AP_TimestampSet.h:235
AP_COMMON_API void AP_TimestampSet_dtor(AP_TimestampSet *timestamp)
AP_TimestampSet_dtor.
void(* addTime)(struct AP_TimestampSet *timestamp, AP_TimestampSetIndex index, AP_TimestampSetTime time)
addTime
Definition: AP_TimestampSet.h:208