OnixS C++ Cboe CFE Multicast PITCH Market Data Handler  1.10.3
API documentation
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 
26 
27 #include <string>
28 #include <ostream>
29 #include <memory>
30 #include <set>
31 
32 
33 namespace OnixS
34 {
35  namespace CboeCFE
36  {
37  namespace MarketData
38  {
39  namespace Pitch
40  {
41  /// Data source
42  struct ONIXS_CBOECFE_PITCH_API DataSource
43  {
45  DataSource(const Timestamp& ts) : packetReceptionTime(ts) {}
46 
47  enum Origin
48  {
49  Multicast = 0,
50  Replay = 1,
51  Spin = 2
52  };
53 
54  /// Time when the packet was received by Handler from UDP, in system ticks, @see Time.h
56 
57  /// Message sequence number
59 
60  /// Number of message in packet
62 
63  /// Message sequence number
64  UInt32 messageSeqNum;
65 
66  /// Market data group
68 
69  /// the way data received
71 
72  /// The packet was cached due to incorrect sequence
73  bool cached;
74 
75  std::string toString () const;
76  };
77 
78  typedef UInt8 Binary1;
79  typedef UInt16 Binary2;
80  typedef UInt32 Binary4;
81  typedef UInt64 Binary8;
82 
83  typedef Int32 SignedBinary4;
84  typedef Int64 SignedBinary8;
85 
86  /// Alias for Sequence Number type.
87  typedef UInt32 SequenceNumber;
88 
89  /// Aliases message length type.
90  typedef Binary2 MessageSize;
91 
92  /// Binary Price.
93  typedef
95  <
96  Int64,
97  IntegralConstant<Int8, -4>
98  >
100 
101  /// Binary Short Price.
102  typedef
104  <
105  Int16,
106  IntegralConstant<Int8, -2>
107  >
109 
110  typedef UInt8 BitField;
111 
112  typedef UInt32 BinaryDate;
113 
114  /// Alias for Order Id type.
115  typedef Binary8 OrderId;
116 
117  /// Alias for Quantity type.
118  typedef Binary4 Quantity;
119 
120  typedef Binary4 Time;
121 
122  /// Alias for Instrument Id type.
123  typedef Binary8 InstrumentId;
124 
125  ONIXS_CBOECFE_PITCH_API std::ostream& operator << (std::ostream& stream, const DataSource& ds);
126 
127  /// Zero-based index of CPU.
128  typedef size_t CpuIndex;
129 
130  /// Represents set of CPU indices.
131  class ONIXS_CBOECFE_PITCH_API ThreadAffinity
132  {
133  typedef std::set<CpuIndex> CpuIndexes;
134 
135  public:
136  /// Initializes empty set.
137  ThreadAffinity();
138 
139  /// Initializes as copy of other set.
141 
142  /// Utilizes all the resources.
143  ~ThreadAffinity();
144 
145  /// Indicates whether is empty.
146  bool empty() const;
147 
148  /// Copies set into another set.
149  void copyTo(CpuIndexes&) const;
150 
151  /// Adds CPU index into set.
152  bool insert(CpuIndex index);
153 
154  /// Removes CPU index from the set.
155  bool erase(CpuIndex index);
156 
157  /// Makes set empty.
158  void clear();
159 
160  /// Re-initializes instance as copy of other set.
161  ThreadAffinity& operator = (const ThreadAffinity&);
162 
163  /// Returns the string representation.
164  std::string toString() const;
165 
166  private:
167 
168  /// System index.
169  CpuIndexes* indices_;
170  };
171  }
172  }
173  }
174 }
175 
FixedPointDecimal< Int16, IntegralConstant< Int8,-2 > > BinaryShortPrice
Binary Short Price.
Definition: Defines.h:108
UInt32 messageSeqNum
Message sequence number.
Definition: Defines.h:64
Binary4 Quantity
Alias for Quantity type.
Definition: Defines.h:118
Binary2 MessageSize
Aliases message length type.
Definition: Defines.h:90
bool cached
The packet was cached due to incorrect sequence.
Definition: Defines.h:73
ONIXS_CBOECFE_PITCH_API std::ostream & operator<<(std::ostream &stream, const ServiceDescriptor &descriptor)
UInt8 packetMessageNumber
Number of message in packet.
Definition: Defines.h:61
UInt8 Byte
Alias for Byte.
Definition: Memory.h:37
Represents set of CPU indices.
Definition: Defines.h:131
UInt32 SequenceNumber
Alias for Sequence Number type.
Definition: Defines.h:87
Byte marketDataGroup
Market data group.
Definition: Defines.h:67
Origin origin
the way data received
Definition: Defines.h:70
FixedPointDecimal< Int64, IntegralConstant< Int8,-4 > > BinaryPrice
Binary Price.
Definition: Defines.h:99
Represents time point without time-zone information.
Definition: Time.h:482
Binary8 OrderId
Alias for Order Id type.
Definition: Defines.h:115
size_t CpuIndex
Zero-based index of CPU.
Definition: Defines.h:128
Timestamp packetReceptionTime
Time when the packet was received by Handler from UDP, in system ticks,.
Definition: Defines.h:55
UInt8 packetMessageCount
Message sequence number.
Definition: Defines.h:58
Binary8 InstrumentId
Alias for Instrument Id type.
Definition: Defines.h:123