OnixS C++ HKEX OMD-C Handler 1.0.0
API documentation
Loading...
Searching...
No Matches
Defines.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#pragma once
21
25
26#include <string>
27#include <ostream>
28#include <set>
29
30
31namespace OnixS
32{
33 namespace HKEX
34 {
35 namespace MarketData
36 {
37 namespace Omdc
38 {
40 typedef UInt32 SequenceNumber;
41
43 struct ONIXS_HKEX_OMDC_API DataSource
44 {
47
48 enum Origin
49 {
52 Retr = 3,
53 };
54
58
61
64
67
70
73
75 bool cached;
76
77 std::string toString () const;
78 };
79
81 typedef UInt32 InstrumentId;
82
84 typedef UInt64 OrderId;
85
87 typedef Int32 Price;
88
90 typedef UInt32 Quantity;
91
93 typedef UInt16 MessageSize;
94
95 ONIXS_HKEX_OMDC_API std::ostream& operator << (std::ostream& stream, const DataSource& ds);
96
98 typedef size_t CpuIndex;
99
101 class ONIXS_HKEX_OMDC_API ThreadAffinity
102 {
103 typedef std::set<CpuIndex> CpuIndexes;
104
105 public:
108
111
114
116 bool empty() const;
117
119 void copyTo(CpuIndexes&) const;
120
122 bool insert(CpuIndex index);
123
125 bool erase(CpuIndex index);
126
128 void clear();
129
131 ThreadAffinity& operator = (const ThreadAffinity&);
132
134 std::string toString() const;
135
136 private:
137
139 CpuIndexes* indices_;
140 };
141 }
142 }
143 }
144}
145
std::string toString() const
Returns the string representation.
ThreadAffinity(const ThreadAffinity &)
Initializes as copy of other set.
bool empty() const
Indicates whether is empty.
~ThreadAffinity()
Utilizes all the resources.
bool erase(CpuIndex index)
Removes CPU index from the set.
bool insert(CpuIndex index)
Adds CPU index into set.
void copyTo(CpuIndexes &) const
Copies set into another set.
Represents time point without time-zone information.
Definition Time.h:483
size_t CpuIndex
Zero-based index of CPU.
Definition Defines.h:98
UInt64 OrderId
Alias for Order Id type.
Definition Defines.h:84
ONIXS_HKEX_OMDC_API std::ostream & operator<<(std::ostream &stream, const ServiceDescriptor &descriptor)
UInt16 MessageSize
Aliases message length type.
Definition Defines.h:93
Int32 Price
Alias for Order Id type.
Definition Defines.h:87
UInt32 SequenceNumber
Alias for Sequence Number type.
Definition Defines.h:40
UInt32 Quantity
Alias for Quantity type.
Definition Defines.h:90
UInt32 InstrumentId
Alias for Instrument Id type.
Definition Defines.h:81
Origin origin
the way data received
Definition Defines.h:72
UInt16 packetMessageCount
Number of messages included in the packet.
Definition Defines.h:63
UInt64 packetSendTime
Packet send time from the exchange.
Definition Defines.h:57
bool cached
The packet was cached due to incorrect sequence.
Definition Defines.h:75
Timestamp packetReceptionTime
Time when the packet was received by Handler from UDP, in system ticks,.
Definition Defines.h:60
UInt8 messageIndex
Index of message in packet.
Definition Defines.h:69
SequenceNumber messageSeqNum
Sequence number of the message.
Definition Defines.h:66