OnixS C++ CME MDP Premium Market Data Handler 5.11.1
Users' manual and API documentation
Loading...
Searching...
No Matches
PacketTraits.h
Go to the documentation of this file.
1// Copyright Onix Solutions Limited [OnixS]. All rights reserved.
2//
3// This software owned by Onix Solutions Limited [OnixS] and is
4// protected by copyright law and international copyright treaties.
5//
6// Access to and use of the software is governed by the terms of the applicable
7// OnixS Software Services Agreement (the Agreement) and Customer end user license
8// agreements granting a non-assignable, non-transferable and non-exclusive license
9// to use the software for it's own data processing purposes under the terms defined
10// in the Agreement.
11//
12// Except as otherwise granted within the terms of the Agreement, copying or
13// reproduction of any part of this source code or associated reference material
14// to any other location for further reproduction or redistribution, and any
15// amendments to this copyright notice, are expressly prohibited.
16//
17// Any reproduction or redistribution for sale or hiring of the Software not in
18// accordance with the terms of the Agreement is a violation of copyright law.
19//
20
21#pragma once
22
23#include <string>
24
28
30
33
36
38
39
44{
45public:
51 {
52 return messageSize_;
53 }
54
59 {
60 messageSize_ = value;
61 }
62
67 std::string toString() const;
68
69private:
70 Messaging::MessageSize messageSize_;
71};
72
78{
79public:
84 SequenceNumber seqNumber() const noexcept
85 {
86 return seqNumber_;
87 }
88
92 void seqNumber(SequenceNumber value) noexcept
93 {
94 seqNumber_ = value;
95 }
96
102 {
103 return sendingTime_;
104 }
105
110 {
111 sendingTime_ = value;
112 }
113
118 std::string toString() const;
119
120private:
121 SequenceNumber seqNumber_;
122 Messaging::Timestamp sendingTime_;
123};
124
126
127
132ONIXS_CMEMDH_EXPORTED void toStr(std::string& str, const MessagePrefix& hdr);
133
138inline ONIXS_CMEMDH_NODISCARD std::string toStr(const MessagePrefix& hdr)
139{
140 std::string str;
141 toStr(str, hdr);
142 return str;
143}
144
149ONIXS_CMEMDH_EXPORTED void toStr(std::string& str, const PacketHeader& hdr);
150
155inline ONIXS_CMEMDH_NODISCARD std::string toStr(const PacketHeader& hdr)
156{
157 std::string str;
158 toStr(str, hdr);
159 return str;
160}
161
162inline std::string MessagePrefix::toString() const
163{
164 return toStr(*this);
165}
166
167inline std::string PacketHeader::toString() const
168{
169 return toStr(*this);
170}
171
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
Definition Bootstrap.h:69
#define ONIXS_CMEMDH_NAMESPACE_END
Definition Bootstrap.h:73
#define ONIXS_CMEMDH_DATA_PACKING_END
Definition Compiler.h:197
#define ONIXS_CMEMDH_DATA_PACKING_BEGIN(alignment)
Definition Compiler.h:196
#define ONIXS_CMEMDH_FORCEINLINE
Definition Compiler.h:176
#define ONIXS_CMEMDH_EXPORTED
Definition Compiler.h:163
#define ONIXS_CMEMDH_NODISCARD
Definition Compiler.h:165
Represents the length prefix preceding each message in an MDP packet.
Messaging::MessageSize messageSize() const noexcept
Gets the total message size, including its binary header.
std::string toString() const
Formats the message prefix as a human-readable string.
void messageSize(Messaging::MessageSize value) noexcept
Sets the total message size, including its binary header.
The time point without the time-zone information.
Definition Time.h:450
Represents the sequence number and sending time stored in an MDP packet header.
std::string toString() const
Formats the packet header as a human-readable string.
void sendingTime(Messaging::Timestamp value) noexcept
Sets the packet sending time.
SequenceNumber seqNumber() const noexcept
Gets the packet sequence number.
void seqNumber(SequenceNumber value) noexcept
Sets the packet sequence number.
Messaging::Timestamp sendingTime() const noexcept
Gets the packet sending time.
std::uint32_t UInt32
uInt32.
Definition Integral.h:35
std::uint16_t UInt16
uInt16.
Definition Integral.h:33
UInt16 MessageSize
Message length type.
Definition Aliases.h:29
Messaging::UInt16 PacketSize
Represents a packet size in bytes.
Messaging::UInt32 SequenceNumber
Identifies a packet within an MDP packet sequence.
void toStr(std::string &str, BookState::Enum bookState)
Appends a string representation of a book state.