OnixS C++ FIX Engine 4.13.0
API Documentation
Loading...
Searching...
No Matches
FAST.h
Go to the documentation of this file.
1#pragma once
2/*
3* Copyright Onix Solutions Limited [OnixS]. All rights reserved.
4*
5* This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
6* and international copyright treaties.
7*
8* Access to and use of the software is governed by the terms of the applicable ONIXS Software
9* Services Agreement (the Agreement) and Customer end user license agreements granting
10* a non-assignable, non-transferable and non-exclusive license to use the software
11* for it's own data processing purposes under the terms defined in the Agreement.
12*
13* Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
14* of this source code or associated reference material to any other location for further reproduction
15* or redistribution, and any amendments to this copyright notice, are expressly prohibited.
16*
17* Any reproduction or redistribution for sale or hiring of the Software not in accordance with
18* the terms of the Agreement is a violation of copyright law.
19*/
20
21#include <string>
22#include <vector>
23#include <map>
24
25#include <OnixS/FIXEngine/ABI.h>
30
31namespace OnixS {
32namespace FIX {
35
36namespace FAST {
39{
40public:
46 Encoder(const std::string & xmlTemplates, ProtocolVersion::Enum fixVersion, bool encodeEachMessageIndependently);
47
53 Encoder(const std::string & xmlTemplates, const std::string & fixDictionaryId, bool encodeEachMessageIndependently);
54
61 Encoder(const std::string & xmlTemplates, bool encodeEachMessageIndependently);
62
70 Encoder(ProtocolVersion::Enum baseVersion, const std::string & xmlTemplates, bool encodeEachMessageIndependently);
71
81 Encoder(ProtocolVersion::Enum baseVersion, const std::string & xmlTemplates, const std::string & genericFixDictionaryId, bool encodeEachMessageIndependently);
82
84 ~Encoder(void);
85
94 size_t encode(const OnixS::FIX::Message & fixMessage, int templateID, char * buffer, size_t bufferSize); // Deprecated
95 size_t encode(const OnixS::FIX::Message & fixMessage, int templateID, unsigned char * buffer, size_t bufferSize);
96
104 size_t encode(const OnixS::FIX::Message & fixMessage, char * buffer, size_t bufferSize); // Deprecated
105 size_t encode(const OnixS::FIX::Message & fixMessage, unsigned char * buffer, size_t bufferSize);
106
110 void reset();
111
117
118private:
120
121 Encoder(const Encoder &);
122 Encoder & operator = (const Encoder &);
123
124 class Impl;
125 Impl * impl_;
126};
127
130{
131public:
139 Decoder(const std::string & xmlTemplates, const OnixS::FIX::Dictionary & fixDictionary, bool decodeEachMessageIndependently, InputDataTraits::Enum inputDataTraits);
140
148 Decoder(const std::string & xmlTemplates, bool decodeEachMessageIndependently, InputDataTraits::Enum inputDataTraits);
149
158 Decoder(ProtocolVersion::Enum baseVersionForGeneratedDictionary, const std::string & xmlTemplates, bool decodeEachMessageIndependently, InputDataTraits::Enum inputDataTraits);
159
170 Decoder(ProtocolVersion::Enum baseVersionForGeneratedDictionary,
171 const std::string & xmlTemplates, const std::string & genericFixDictionaryId,
172 bool decodeEachMessageIndependently, InputDataTraits::Enum inputDataTraits);
173
176
180
192 const OnixS::FIX::Message & decode(const char * buffer, size_t bufferSize); // Deprecated
193 const OnixS::FIX::Message & decode(const unsigned char * buffer, size_t bufferSize);
194
205 const OnixS::FIX::Message & decode(const std::vector<char> & chunk); // Deprecated
207
221 bool tryDecode(const char * buffer, size_t offset, size_t count, OnixS::FIX::Message * message, size_t * numberOfDecodedBytes); // Deprecated
222 bool tryDecode(const unsigned char * buffer, size_t offset, size_t count, OnixS::FIX::Message * message, size_t * numberOfDecodedBytes);
223
232 static bool tryDecodeUnsignedInteger(const char * buffer, size_t bufferSize, unsigned int * value, size_t * fieldLength); // Deprecated
233 static bool tryDecodeUnsignedInteger(const unsigned char * buffer, size_t bufferSize, unsigned int * value, size_t * fieldLength);
234
238 void reset();
239
245
261
266
273 static void generateFixDictionary(const std::string & fastTemplateXml,
274 const std::string & fixDictionaryId, std::string * fixDictionaryXml);
275
283 const std::string & fastTemplateXml, const std::string & fixDictionaryId,
284 std::string * fixDictionaryXml);
285private:
287
288 Decoder(const Decoder &);
289 Decoder & operator = (const Decoder &);
290
291 class Impl;
292 Impl * impl_;
293};
294
295}
296}
297}
#define ONIXS_FIXENGINE_API_DECL(typeKind, typeName)
Definition ABI.h:57
#define ONIXS_FIXENGINE_API
Definition ABI.h:45
Identifies the FIX messages dictionary.
Definition Dictionary.h:74
bool tryDecode(const unsigned char *buffer, size_t offset, size_t count, OnixS::FIX::Message *message, size_t *numberOfDecodedBytes)
const OnixS::FIX::Message & decode(const unsigned char *buffer, size_t bufferSize)
Decoder(const std::string &xmlTemplates, const OnixS::FIX::Dictionary &fixDictionary, bool decodeEachMessageIndependently, InputDataTraits::Enum inputDataTraits)
Creates a FAST to FIX Decoder.
void maximumNumberOfRepeatingGroupEntries(int value)
Manages the maximum number of repeating groups, allowed for decoded messages.
const OnixS::FIX::Message & decode(const std::vector< char > &chunk)
Decodes the given FAST stream chunk into the corresponding FIX Message.
static void generateFixDictionary(const std::string &fastTemplateXml, const std::string &fixDictionaryId, std::string *fixDictionaryXml)
Generates the FIX dictionary XML.
const OnixS::FIX::Message & decode(const char *buffer, size_t bufferSize)
Decodes the given FAST stream chunk into the corresponding FIX Message.
Decoder(const std::string &xmlTemplates, bool decodeEachMessageIndependently, InputDataTraits::Enum inputDataTraits)
Creates a FAST to FIX Decoder for the FIX dictionary-independent mode.
Decoder(ProtocolVersion::Enum baseVersionForGeneratedDictionary, const std::string &xmlTemplates, const std::string &genericFixDictionaryId, bool decodeEachMessageIndependently, InputDataTraits::Enum inputDataTraits)
Creates a FAST to FIX Decoder for the FIX dictionary-independent mode.
InputDataTraits::Enum inputDataTraits() const
Input data traits of the decoder.
static bool tryDecodeUnsignedInteger(const char *buffer, size_t bufferSize, unsigned int *value, size_t *fieldLength)
Decodes the FAST-encoded unsigned integer.
int maximumNumberOfRepeatingGroupEntries() const
The maximum number of repeating groups, allowed for decoded messages.
static void generateFixDictionary(ProtocolVersion::Enum baseVersion, const std::string &fastTemplateXml, const std::string &fixDictionaryId, std::string *fixDictionaryXml)
Generates the FIX dictionary XML.
static bool tryDecodeUnsignedInteger(const unsigned char *buffer, size_t bufferSize, unsigned int *value, size_t *fieldLength)
OnixS::FIX::Dictionary fixDictionary() const
The FIX dictionary used by the decoder instance.
Decoder(ProtocolVersion::Enum baseVersionForGeneratedDictionary, const std::string &xmlTemplates, bool decodeEachMessageIndependently, InputDataTraits::Enum inputDataTraits)
Creates a FAST to FIX Decoder for the FIX dictionary-independent mode.
void reset()
Resets the state of the previous values dictionaries (sets the state of the previous values to undefi...
bool tryDecode(const char *buffer, size_t offset, size_t count, OnixS::FIX::Message *message, size_t *numberOfDecodedBytes)
Tries to decode the given FAST stream buffer into the corresponding FIX Message.
const OnixS::FIX::Message & decode(const OnixS::Sockets::Bytes &chunk)
~Decoder()
The destructor.
~Encoder(void)
The destructor.
size_t encode(const OnixS::FIX::Message &fixMessage, int templateID, char *buffer, size_t bufferSize)
Encodes the given FIX message into a FAST stream.
size_t encode(const OnixS::FIX::Message &fixMessage, char *buffer, size_t bufferSize)
Encodes the given FIX message into a FAST stream using the default template ID.
Encoder(ProtocolVersion::Enum baseVersion, const std::string &xmlTemplates, bool encodeEachMessageIndependently)
Creates a FIX to FAST Encoder for the FIX dictionary-independent mode.
Encoder(const std::string &xmlTemplates, ProtocolVersion::Enum fixVersion, bool encodeEachMessageIndependently)
Creates a FIX to FAST Encoder.
size_t encode(const OnixS::FIX::Message &fixMessage, unsigned char *buffer, size_t bufferSize)
Encoder(ProtocolVersion::Enum baseVersion, const std::string &xmlTemplates, const std::string &genericFixDictionaryId, bool encodeEachMessageIndependently)
Creates a FIX to FAST Encoder for the FIX dictionary-independent mode.
Encoder(const std::string &xmlTemplates, bool encodeEachMessageIndependently)
Creates a FIX to FAST Encoder for the FIX dictionary-independent mode.
size_t encode(const OnixS::FIX::Message &fixMessage, int templateID, unsigned char *buffer, size_t bufferSize)
OnixS::FIX::Dictionary fixDictionary() const
The FIX dictionary used by the encoder instance.
void reset()
Resets the state of the previous values dictionaries (sets the state of the previous values to undefi...
Encoder(const std::string &xmlTemplates, const std::string &fixDictionaryId, bool encodeEachMessageIndependently)
Creates a FIX to FAST Encoder.
Encapsulates operations over a FIX Message.
Definition Message.h:52
std::vector< Byte > Bytes
Sequence of bytes.
Definition Definitions.h:43