OnixS C++ CBOE CFE Binary Order Entry (BOE) Handler  1.11.0
API documentation
SessionMessages.Testing.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 #pragma once
20 
24 
25 #include <vector>
27 
28 namespace OnixS {
29 namespace CboeCFE {
30 namespace Trading {
31 namespace BOE {
32 namespace Testing {
33 
34 ///
35 struct ONIXS_CBOE_CFE_BOE_API MutableLoginResponse : public OutgoingMessage
36 {
38 
40 
42 
43  std::vector<Unit> units_;
44 
45  MessageType::Enum type() const ONIXS_BATS_BOE_NOEXCEPT ONIXS_BATS_BOE_OVERRIDE { return MessageType::LoginResponse; };
46 
47  void validate() const ONIXS_BATS_BOE_OVERRIDE {};
48 
49  std::string toString() const ONIXS_BATS_BOE_OVERRIDE;
50 
51  void toString(std::string& str) const ONIXS_BATS_BOE_OVERRIDE;
52 
53  size_t serializeTo(unsigned char*) const ONIXS_BATS_BOE_NOEXCEPT ONIXS_BATS_BOE_OVERRIDE;
54 };
55 
56 ///
57 struct ONIXS_CBOE_CFE_BOE_API MutableReplayComplete : public OutgoingMessage
58 {
59  MessageType::Enum type() const ONIXS_BATS_BOE_NOEXCEPT ONIXS_BATS_BOE_OVERRIDE { return MessageType::ReplayComplete; };
60 
61  void validate() const ONIXS_BATS_BOE_OVERRIDE {};
62 
63  std::string toString() const ONIXS_BATS_BOE_OVERRIDE;
64 
65  void toString(std::string&) const ONIXS_BATS_BOE_OVERRIDE;
66 
67 private:
68  size_t serializeTo(unsigned char*) const ONIXS_BATS_BOE_NOEXCEPT ONIXS_BATS_BOE_OVERRIDE { return 0; };
69 };
70 
71 ///
72 struct ONIXS_CBOE_CFE_BOE_API MutableLogoutResponse : public OutgoingMessage
73 {
75 
77 
78  MessageType::Enum type() const ONIXS_BATS_BOE_NOEXCEPT ONIXS_BATS_BOE_OVERRIDE { return MessageType::LogoutResponse; };
79 
80  void validate() const ONIXS_BATS_BOE_OVERRIDE {};
81 
82  std::string toString() const ONIXS_BATS_BOE_OVERRIDE;
83 
84  void toString(std::string& str) const ONIXS_BATS_BOE_OVERRIDE;
85 
86  size_t serializeTo(unsigned char*) const ONIXS_BATS_BOE_NOEXCEPT ONIXS_BATS_BOE_OVERRIDE;
87 };
88 
89 ///
90 struct ONIXS_CBOE_CFE_BOE_API MutableServerHeartbeat : public OutgoingMessage
91 {
92  MessageType::Enum type() const ONIXS_BATS_BOE_NOEXCEPT ONIXS_BATS_BOE_OVERRIDE { return MessageType::ServerHeartbeat; };
93 
94  void validate() const ONIXS_BATS_BOE_OVERRIDE {};
95 
96  std::string toString() const ONIXS_BATS_BOE_OVERRIDE;
97 
98  void toString(std::string&) const ONIXS_BATS_BOE_OVERRIDE;
99 
100 private:
101  size_t serializeTo(unsigned char*) const ONIXS_BATS_BOE_NOEXCEPT ONIXS_BATS_BOE_OVERRIDE { return 0; };
102 };
103 
108 
109 
110 ///
111 struct ONIXS_CBOE_CFE_BOE_API ConstantLoginRequest : public BinaryMessage
112 {
113  static MessageType::Enum type() ONIXS_BATS_BOE_NOEXCEPT { return MessageType::LoginRequest; };
114 
115  ///
117  {
118  return fixedStr<4>(0);
119  }
120 
121  ///
123  {
124  return fixedStr<4>(4);
125  }
126 
127  ///
128  StrRef password() const
129  {
130  return fixedStr<10>(8);
131  }
132 
133  ///
135  {
136  return enumeration<ReplayUnspecifiedUnit>(18);
137  }
138 
139  ///
141  {
142  return ordinary<Binary1>(19);
143  }
144 
145  struct Unit : public BinaryMessage
146  {
147  Binary1 number() const
148  {
149  return ordinary<Binary1>(0);
150  }
151 
153  {
154  return ordinary<Binary4>(1);
155  }
156 
157  Unit(const void* data, MessageSize size)
158  : BinaryMessage(data, size)
159  {
160  }
161  };
162 
163  ///
164  Unit units(MessageSize index) const
165  {
166  assert(index < numberOfUnits());
167 
168  static const MessageSize UnitSize = 5;
169  return submessage<Unit>(20 + UnitSize * index, UnitSize);
170  }
171 
173  : BinaryMessage()
174  {}
175 
176  /// Initializes instance over given memory block.
177  ConstantLoginRequest(const void* data, MessageSize size)
178  : BinaryMessage(data, size)
179  {
180  }
181 };
182 
183 ///
184 struct ONIXS_CBOE_CFE_BOE_API ConstantLogoutRequest : public BinaryMessage
185 {
186  static MessageType::Enum type() ONIXS_BATS_BOE_NOEXCEPT { return MessageType::LogoutRequest; };
187 
189  : BinaryMessage()
190  {}
191 
192  ConstantLogoutRequest(const void* data, MessageSize size)
193  : BinaryMessage(data, size)
194  {
195  }
196 };
197 
198 ///
199 struct ONIXS_CBOE_CFE_BOE_API ConstantClientHeartbeat : public BinaryMessage
200 {
201  static MessageType::Enum type() ONIXS_BATS_BOE_NOEXCEPT { return MessageType::ClientHeartbeat; };
202 
204  : BinaryMessage()
205  {}
206 
207  ConstantClientHeartbeat(const void* data, MessageSize size)
208  : BinaryMessage(data, size)
209  {
210  }
211 };
212 
216 
217 
218 }
219 }
220 }
221 }
222 }
MessageType::Enum type() const ONIXS_BATS_BOE_NOEXCEPT ONIXS_BATS_BOE_OVERRIDE
Returns message type.
ONIXS_CBOE_CFE_BOE_DECLARE_T0_STR_FUNCTIONS(MutableLoginResponse)
MessageType::Enum type() const ONIXS_BATS_BOE_NOEXCEPT ONIXS_BATS_BOE_OVERRIDE
Returns message type.
MessageType::Enum type() const ONIXS_BATS_BOE_NOEXCEPT ONIXS_BATS_BOE_OVERRIDE
Returns message type.
Provides efficient way of accessing text-based field values.
Definition: String.h:45
Encapsulates services for manipulating little endian encoded messages.
Binary2 MessageSize
Aliases message length type.
static MessageType::Enum type() ONIXS_BATS_BOE_NOEXCEPT
MessageType::Enum type() const ONIXS_BATS_BOE_NOEXCEPT ONIXS_BATS_BOE_OVERRIDE
Returns message type.
static MessageType::Enum type() ONIXS_BATS_BOE_NOEXCEPT
ConstantLoginRequest(const void *data, MessageSize size)
Initializes instance over given memory block.
Base class for outgoing messages.
static MessageType::Enum type() ONIXS_BATS_BOE_NOEXCEPT