OnixS C++ FIX Engine  4.2.0
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>
26 
27 namespace OnixS {
28 namespace FIX {
29 namespace SBE {
30 /// SBE decode session's listener.
31 /// This interface declares set of methods called by EventBasedDecoder during decoding process.
33 {
34 public:
35  /// @note FIX Engine does NOT manage the lifetime of this listener.
36  virtual ~IDecodeListener();
37 
38  /// @name Entire message events
39  /// These events belonges to to entire message. Each each from the group occurs single time per message.
40 
41  /// @{
42  /// Called when a new SBE-encoded message started to decode.
43  ///
44  /// @param messageType FIX type of the message.
45  /// @param messageTypeLength Length of the messageType string. Doe not include terminating zero.
46  virtual void onBeginMessage(const char * messageType, size_t messageTypeLength) = 0;
47 
48  /// Called when decoder finishes current message decoding.
49  /// @note It is possible to reset caller decoder during this callback.
50  virtual void onEndMessage() = 0;
51  /// @}
52 
53  /// @name Data field events
54  /// These events denotes that particular fields were decoded. Events occurs once per field.
55 
56  /// @{
57  /// Called when single-char field decoded.
58  ///
59  /// @param tag FIX tag of the field.
60  /// @param value Decoded value.
61  virtual void onValue(int tag, char value) = 0;
62 
63  /// Called when signed 16-bit integer or signed 8-bit integer field decoded.
64  ///
65  /// @param tag FIX tag of the field.
66  /// @param value Decoded value.
67  virtual void onValue(int tag, short value) = 0;
68 
69  /// Called when unsigned 16-bit integer or unsigned 8-bit integer field decoded.
70  ///
71  /// @param tag FIX tag of the field.
72  /// @param value Decoded value.
73  virtual void onValue(int tag, unsigned short value) = 0;
74 
75  /// Called when signed 32-bit integer field decoded.
76  ///
77  /// @param tag FIX tag of the field.
78  /// @param value Decoded value.
79  virtual void onValue(int tag, int value) = 0;
80 
81  /// Called when unsigned 32-bit integer field decoded.
82  ///
83  /// @param tag FIX tag of the field.
84  /// @param value Decoded value.
85  virtual void onValue(int tag, unsigned value) = 0;
86 
87  /// Called when signed 64-bit integer field decoded.
88  ///
89  /// @param tag FIX tag of the field.
90  /// @param value Decoded value.
91  virtual void onValue(int tag, long long value) = 0;
92 
93  /// Called when unsigned 64-bit integer field decoded.
94  ///
95  /// @param tag FIX tag of the field.
96  /// @param value Decoded value.
97  virtual void onValue(int tag, unsigned long long value) = 0;
98 
99  /// Called when decimal field decoded.
100  ///
101  /// @param tag FIX tag of the field.
102  /// @param mantissa Mantissa of the decoded decimal value.
103  /// @param exponent Exponent of the decoded decimal value (in range of -64..63).
104  virtual void onValue(int tag, long long mantissa, int exponent) = 0;
105 
106  /// Called when a string (ASCII or Unicode) or byteVector decoded.
107  ///
108  /// @param tag FIX tag of the field.
109  /// @param value Pointer to start of decoded data.
110  /// @param valueLength Length of decoded data (does not include terminating zero for &lt;string&gt; fields).
111  virtual void onValue(int tag, const char * value, size_t valueLength) = 0;
112 
113  /// Called when float field decoded.
114  ///
115  /// @param tag FIX tag of the field.
116  /// @param value Decoded value.
117  virtual void onValue(int tag, float value) = 0;
118 
119  /// Called when long float (double) field decoded.
120  ///
121  /// @param tag FIX tag of the field.
122  /// @param value Decoded value.
123  virtual void onValue(int tag, double value) = 0;
124  /// @}
125 
126  /// @name Sequence events
127  /// These callbacks embraces sequence decoding. Each callback called once per sequence unless the sequence is empty.
128 
129  /// @{
130  /// Called just before first entry of the sequence decoding.
131  ///
132  /// @param tag Tag of the sequence
133  /// @param itemCount Number of entries in the sequence.
134  virtual void onBeginSequence(int tag, size_t itemCount) = 0;
135 
136  /// Called immediately after the last sequence entry decoded.
137  virtual void onEndSequence() = 0;
138  /// @}
139 
140  /// @name Sequence entry events
141  /// These callbacks embraces sequence entry decoding. Each callback called once per sequence entry.
142 
143  /// @{
144  /// Called just before sequence entry decoding.
145  /// @param index Index of the entry.
146  virtual void onBeginSequenceEntry(size_t index) = 0;
147 
148  /// Called after the entry was decoded.
149  virtual void onEndSequenceEntry() = 0;
150  /// @}
151 };
152 }
153 }
154 }
155 
156 #endif // __ONIXS_ISBEDECODELISTENER_H__
SBE decode session&#39;s listener.
#define ONIXS_FIXENGINE_API
Definition: ABI.h:45