OnixS C++ FIX Engine  4.10.1
API Documentation
IDecodeListener.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_IDECODELISTENER_H__)
21 #define __ONIXS_IDECODELISTENER_H__
22 
23 #include <cstddef>
24 
25 #include <OnixS/FIXEngine/ABI.h>
27 
28 namespace OnixS {
29 namespace FIX {
30 namespace FAST {
31 /// The 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 belongs to the entire message. Events occur single time per message.
41 
42  /// @{
43  /// Called when a new FAST-encoded message found in input data.
44  ///
45  /// @param templateId The identifier of the FAST template belonged to 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,
49  size_t messageTypeLength) = 0;
50 
51  /// Called when the decoder finishes the current message decoding.
52  /// @note It is possible to reset the caller decoder during this callback.
53  virtual void onEndMessage() = 0;
54  /// @}
55 
56  /// @name Data field events
57  /// These events denotes that particular fields were decoded. Events occurs once per a field.
58 
59  /// @{
60  /// Called when a signed 32-bit integer field decoded.
61  ///
62  /// @param tag The FIX tag of the field.
63  /// @param value the decoded value.
64  virtual void onValue(int tag, int value) = 0;
65 
66  /// Called when an unsigned 32-bit integer field decoded.
67  ///
68  /// @param tag The FIX tag of the field.
69  /// @param value the decoded value.
70  virtual void onValue(int tag, unsigned value) = 0;
71 
72  /// Called when a signed 64-bit integer field decoded.
73  ///
74  /// @param tag The FIX tag of the field.
75  /// @param value the decoded value.
76  virtual void onValue(int tag, long long value) = 0;
77 
78  /// Called when an unsigned 64-bit integer field decoded.
79  ///
80  /// @param tag The FIX tag of the field.
81  /// @param value the decoded value.
82  virtual void onValue(int tag, unsigned long long value) = 0;
83 
84  /// Called when a decimal field decoded.
85  ///
86  /// @param tag The FIX tag of the field.
87  /// @param mantissa The mantissa of the decoded decimal value.
88  /// @param exponent The exponent of the decoded decimal value (in range of -64..63).
89  virtual void onValue(int tag, long long mantissa, int exponent) = 0;
90 
91  /// Called when a string (ASCII or Unicode) or byteVector decoded.
92  ///
93  /// @param tag The FIX tag of the field.
94  /// @param value The pointer to start of decoded data.
95  /// @param valueLength The length of the decoded data (does not include the terminating zero for &lt;string&gt; fields).
96  virtual void onValue(int tag, const char * value, size_t valueLength) = 0;
97  /// @}
98 
99  /// @name Sequence events
100  /// These callbacks embraces the sequence decoding. Each callback called once per a sequence unless the sequence is empty.
101 
102  /// @{
103  /// Called just before first entry of the sequence decoding.
104  ///
105  /// @param tag The Tag of the sequence
106  /// @param itemCount The number of entries in the sequence.
107  /// @param lengthFieldTag The Tag of the &lt;length&gt; field.
108  virtual void onBeginSequence(int tag, size_t itemCount, int lengthFieldTag) = 0;
109 
110  /// Called immediately after the last sequence entry decoded.
111  virtual void onEndSequence() = 0;
112  /// @}
113 
114  /// @name Sequence entry events
115  /// These callbacks embraces sequence entry decoding. Each callback called once per sequence entry.
116 
117  /// @{
118  /// Called just before the sequence entry decoding.
119  /// @param index The index of the entry.
120  virtual void onBeginSequenceEntry(size_t index) = 0;
121 
122  /// Called after the entry was decoded.
123  virtual void onEndSequenceEntry() = 0;
124  /// @}
125 };
126 }
127 }
128 }
129 
130 #endif // __ONIXS_IDECODELISTENER_H__
#define ONIXS_FIXENGINE_DEFAULT
Definition: Compiler.h:176
#define ONIXS_FIXENGINE_API
Definition: ABI.h:45
The decode session&#39;s listener.