OnixS C++ FIX Engine 4.14.0
Users' manual and API documentation
Loading...
Searching...
No Matches
SBE.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 SBE {
39{
40public:
45 Encoder(const std::string & xmlTemplates, ISbeCustomCoderLibrary *customCoders = nullptr);
46
48 ~Encoder(void);
49
60 size_t encode(const OnixS::FIX::Message & fixMessage, int templateID, int version,
61 unsigned char * buffer, size_t bufferSize, size_t * rootBlockLength) const;
62
73 size_t encodeWithHeader(const OnixS::FIX::Message& fixMessage, int templateID, int version,
74 unsigned char* buffer, size_t bufferSize, size_t* rootBlockLength) const;
75
77 unsigned schemaVersion() const;
78
80 unsigned schemaId() const;
81
83 std::string schemaSemanticVersion() const;
84
87 std::string schemaHeaderType() const;
88private:
89 Encoder(const Encoder &);
90 Encoder & operator = (const Encoder &);
91
92 struct Impl;
93 Impl * impl_;
94};
95
98{
99public:
105 Decoder(const std::string & xmlTemplates, const OnixS::FIX::Dictionary & fixDictionary, ISbeCustomCoderLibrary* customCoders = nullptr);
106
112 Decoder(const std::string & xmlTemplates, ISbeCustomCoderLibrary* customCoders = nullptr);
113
120 Decoder(ProtocolVersion::Enum baseVersion, const std::string & xmlTemplates, ISbeCustomCoderLibrary* customCoders = nullptr);
121
124
140 const OnixS::FIX::Message & decode(int templateId, int version, size_t rootBlockLength,
141 const unsigned char * buffer, size_t bufferSize, size_t * numberOfDecodedBytes = nullptr) const;
142
159 const OnixS::FIX::Message& decode(const unsigned char* buffer, size_t bufferSize, size_t* numberOfDecodedBytes = nullptr,
160 int *templateId = nullptr, int *version = nullptr) const;
161
162
179 bool tryDecode(int templateId, int version, size_t rootBlockLength,
180 const unsigned char * buffer, size_t offset, size_t count, OnixS::FIX::Message * message,
181 size_t * numberOfDecodedBytes) const;
182
188
204
209
214 static Dictionary generateFixDictionary(const std::string & sbeTemplateXml);
215
221 const std::string & sbeTemplateXml);
222
224 unsigned schemaVersion() const;
225
227 unsigned schemaId() const;
228
230 std::string schemaSemanticVersion() const;
231
234 std::string schemaHeaderType() const;
235private:
237
238 Decoder(const Decoder &);
239 Decoder & operator = (const Decoder &);
240
241 struct Impl;
242 Impl * impl_;
243};
244
245}
246}
247}
#define ONIXS_FIXENGINE_API
Definition ABI.h:45
Identifies the FIX messages dictionary.
Definition Dictionary.h:132
static Dictionary generateFixDictionary(ProtocolVersion::Enum baseVersion, const std::string &sbeTemplateXml)
unsigned schemaVersion() const
The maximum known version of the SBE schema.
const OnixS::FIX::Message & decode(const unsigned char *buffer, size_t bufferSize, size_t *numberOfDecodedBytes=nullptr, int *templateId=nullptr, int *version=nullptr) const
Decoder(ProtocolVersion::Enum baseVersion, const std::string &xmlTemplates, ISbeCustomCoderLibrary *customCoders=nullptr)
Decoder(const std::string &xmlTemplates, ISbeCustomCoderLibrary *customCoders=nullptr)
unsigned schemaId() const
The schema identifier.
Decoder(const std::string &xmlTemplates, const OnixS::FIX::Dictionary &fixDictionary, ISbeCustomCoderLibrary *customCoders=nullptr)
static Dictionary generateFixDictionary(const std::string &sbeTemplateXml)
void maximumNumberOfRepeatingGroupEntries(int value)
bool tryDecode(int templateId, int version, size_t rootBlockLength, const unsigned char *buffer, size_t offset, size_t count, OnixS::FIX::Message *message, size_t *numberOfDecodedBytes) const
int maximumNumberOfRepeatingGroupEntries() const
friend ONIXS_FIXENGINE_API_DECL(class, OnixS::FIX::Dictionary)
OnixS::FIX::Dictionary fixDictionary() const
const OnixS::FIX::Message & decode(int templateId, int version, size_t rootBlockLength, const unsigned char *buffer, size_t bufferSize, size_t *numberOfDecodedBytes=nullptr) const
std::string schemaHeaderType() const
std::string schemaSemanticVersion() const
The semantic version of the SBE schema.
~Decoder()
The destructor.
Encoder(const std::string &xmlTemplates, ISbeCustomCoderLibrary *customCoders=nullptr)
~Encoder(void)
Destructor.
unsigned schemaVersion() const
The maximum known version of the SBE schema.
unsigned schemaId() const
The schema identifier.
size_t encode(const OnixS::FIX::Message &fixMessage, int templateID, int version, unsigned char *buffer, size_t bufferSize, size_t *rootBlockLength) const
std::string schemaHeaderType() const
std::string schemaSemanticVersion() const
The semantic version of the SBE schema.
size_t encodeWithHeader(const OnixS::FIX::Message &fixMessage, int templateID, int version, unsigned char *buffer, size_t bufferSize, size_t *rootBlockLength) const
The library that contains user-defined SBE coders.
ONIXS_FIXENGINE_API_DECL(class, IEngineListener)