OnixS C++ FIX Engine  4.10.1
API Documentation
ISbeDecodeListener.h
Go to the documentation of this file.
1 /*
2 * Copyright Onix Solutions Limited [OnixS]. All rights reserved.
3 *
4 * This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
5 * and international copyright treaties.
6 *
7 * Access to and use of the software is governed by the terms of the applicable ONIXS Software
8 * Services Agreement (the Agreement) and Customer end user license agreements granting
9 * a non-assignable, non-transferable and non-exclusive license to use the software
10 * for it's own data processing purposes under the terms defined in the Agreement.
11 *
12 * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
13 * of this source code or associated reference material to any other location for further reproduction
14 * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
15 *
16 * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
17 * the terms of the Agreement is a violation of copyright law.
18 */
19 
20 #if !defined(__ONIXS_ISBEDECODELISTENER_H__)
21 #define __ONIXS_ISBEDECODELISTENER_H__
22 
23 #include <cstddef>
24 
25 #include <OnixS/FIXEngine/ABI.h>
27 
28 namespace OnixS {
29 namespace FIX {
30 namespace SBE {
31 /// The SBE decode session's listener.
32 /// This interface declares set of methods called by the EventBasedDecoder during the decoding process.
34 {
35 public:
36  /// @note The FIX Engine does NOT manage the lifetime of this listener.
38 
39  /// @name Entire message events
40  /// These events belong to the entire message. Each one from the group occurs a single time per a message.
41 
42  /// @{
43  /// Called when a new SBE-encoded message started to decode.
44  ///
45  /// @param templateId The SBE template identifier of the message.
46  /// @param messageType The FIX type of the message.
47  /// @param messageTypeLength The length of the messageType string. Doe not include the terminating zero.
48  virtual void onBeginMessage(unsigned templateId, const char * messageType, size_t messageTypeLength) = 0;
49 
50  /// Called when the decoder finishes the current message decoding.
51  /// @note It is possible to reset the caller decoder during this callback.
52  virtual void onEndMessage() = 0;
53  /// @}
54 
55  /// @name Data field events
56  /// These events denotes that particular fields were decoded. Events occurs once per a field.
57 
58  /// @{
59  /// Called when a single-char field decoded.
60  ///
61  /// @param tag The FIX tag of the field.
62  /// @param value The decoded value.
63  virtual void onValue(int tag, char value) = 0;
64 
65  /// Called when a signed 16-bit integer or signed 8-bit integer field decoded.
66  ///
67  /// @param tag The FIX tag of the field.
68  /// @param value The decoded value.
69  virtual void onValue(int tag, short value) = 0;
70 
71  /// Called when an unsigned 16-bit integer or unsigned 8-bit integer field decoded.
72  ///
73  /// @param tag The FIX tag of the field.
74  /// @param value The decoded value.
75  virtual void onValue(int tag, unsigned short value) = 0;
76 
77  /// Called when a signed 32-bit integer field decoded.
78  ///
79  /// @param tag The FIX tag of the field.
80  /// @param value The decoded value.
81  virtual void onValue(int tag, int value) = 0;
82 
83  /// Called when an unsigned 32-bit integer field decoded.
84  ///
85  /// @param tag The FIX tag of the field.
86  /// @param value The decoded value.
87  virtual void onValue(int tag, unsigned value) = 0;
88 
89  /// Called when a signed 64-bit integer field decoded.
90  ///
91  /// @param tag The FIX tag of the field.
92  /// @param value The decoded value.
93  virtual void onValue(int tag, long long value) = 0;
94 
95  /// Called when an unsigned 64-bit integer field decoded.
96  ///
97  /// @param tag The FIX tag of the field.
98  /// @param value The decoded value.
99  virtual void onValue(int tag, unsigned long long value) = 0;
100 
101  /// Called when a decimal field decoded.
102  ///
103  /// @param tag The FIX tag of the field.
104  /// @param mantissa The mantissa of the decoded decimal value.
105  /// @param exponent The exponent of the decoded decimal value (in range of -64..63).
106  virtual void onValue(int tag, long long mantissa, int exponent) = 0;
107 
108  /// Called when a string (ASCII or Unicode) or byteVector decoded.
109  ///
110  /// @param tag The FIX tag of the field.
111  /// @param value The pointer to start of decoded data.
112  /// @param valueLength The length of decoded data (does not include the terminating zero for &lt;string&gt; fields).
113  virtual void onValue(int tag, const char * value, size_t valueLength) = 0;
114 
115  /// Called when a float field decoded.
116  ///
117  /// @param tag The FIX tag of the field.
118  /// @param value The decoded value.
119  virtual void onValue(int tag, float value) = 0;
120 
121  /// Called when a long float (double) field decoded.
122  ///
123  /// @param tag The FIX tag of the field.
124  /// @param value The decoded value.
125  virtual void onValue(int tag, double value) = 0;
126  /// @}
127 
128  /// @name Sequence events
129  /// These callbacks embraces the sequence decoding. Each callback called once per a sequence unless the sequence is empty.
130 
131  /// @{
132  /// Called just before first entry of the sequence decoding.
133  ///
134  /// @param tag The Tag of the sequence
135  /// @param itemCount The number of entries in the sequence.
136  virtual void onBeginSequence(int tag, size_t itemCount) = 0;
137 
138  /// Called immediately after the last sequence entry decoded.
139  virtual void onEndSequence() = 0;
140  /// @}
141 
142  /// @name Sequence entry events
143  /// These callbacks embraces the sequence entry decoding. Each callback called once per a sequence entry.
144 
145  /// @{
146  /// Called just before the sequence entry decoding.
147  /// @param index The index of the entry.
148  virtual void onBeginSequenceEntry(size_t index) = 0;
149 
150  /// Called after the entry was decoded.
151  virtual void onEndSequenceEntry() = 0;
152  /// @}
153 };
154 }
155 }
156 }
157 
158 #endif // __ONIXS_ISBEDECODELISTENER_H__
#define ONIXS_FIXENGINE_DEFAULT
Definition: Compiler.h:176
#define ONIXS_FIXENGINE_API
Definition: ABI.h:45
The SBE decode session&#39;s listener.