OnixS C++ SGX Titan OUCH Trading Handler  1.2.0
API documentation
CancelByOrderId.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 
23 
24 
26 
27  /// Using the system-generated Order ID, this message
28  /// can be used to cancel any order in the book
29  /// regardless of over which session it was inserted.
30  struct ONIXS_SGXTITAN_OUCH_API CancelByOrderId : public OutgoingMessage
31  {
32  /// Order book ID.
34  ONIXS_SGX_OUCH_NOTHROW
35  {
36  return ordinary<Binary4>(1);
37  }
38 
39  /// Side
40  Side::Enum side() const
41  ONIXS_SGX_OUCH_NOTHROW
42  {
43  return enumeration<Side>(5);
44  }
45 
46  /// The identifier assigned to the new order.
47  Binary8 orderId() const
48  ONIXS_SGX_OUCH_NOTHROW
49  {
50  return ordinary<Binary8>(6);
51  }
52 
53  /// Order book ID.
54  void orderBookId(Binary4 value)
55  ONIXS_SGX_OUCH_NOTHROW
56  {
57  setOrdinary(1, value);
58  }
59 
60  /// Side
61  void side(Side::Enum value)
62  ONIXS_SGX_OUCH_NOTHROW
63  {
64  setEnumeration<Side>(5, value);
65  }
66 
67  /// The identifier assigned to the new order.
68  void orderId(Binary8 value)
69  ONIXS_SGX_OUCH_NOTHROW
70  {
71  setOrdinary(6, value);
72  }
73 
74  /// Total message size.
75  static ONIXS_SGX_OUCH_CONST_OR_CONSTEXPR MessageSize messageSize_ = 14;
76 
77  /// Initializes empty instance
79  ONIXS_SGX_OUCH_NOTHROW
80  : OutgoingMessage(&type_, messageSize_)
82  , data_()
83  {
84  }
85 
86  private:
87 #pragma pack(push, 1)
88  Binary1 type_;
89  ONIXS_SGXTITAN_OUCH_UNUSED_FIELD Binary1 data_[messageSize_ - 1];
90 #pragma pack(pop)
91  };
92 
93  /// Serializes object into string.
94  ONIXS_SGXTITAN_OUCH_API void toStr(std::string&, const CancelByOrderId&);
95 
96  /// Serializes object into string.
97  inline std::string toStr(const CancelByOrderId& msg)
98  {
99  std::string str;
100  toStr(str, msg);
101  return str;
102  }
103 
104  ///
105  inline std::ostream& operator<<(std::ostream& stream, const CancelByOrderId& msg)
106  {
107  stream << toStr(msg);
108  return stream;
109  }
110 
void orderId(Binary8 value)
The identifier assigned to the new order.
Binary2 MessageSize
Aliases message length type.
Definition: Defines.h:47
#define ONIXS_SGXTITAN_OUCH_UNUSED_FIELD
Definition: ABI.h:40
Binary8 orderId() const
The identifier assigned to the new order.
CancelByOrderId()
Initializes empty instance.
void orderBookId(Binary4 value)
Order book ID.
ONIXS_SGXTITAN_OUCH_API std::ostream & operator<<(std::ostream &stream, HandlerState::Enum value)
#define ONIXS_SGXTITAN_OUCH_NAMESPACE_END
Definition: Bootstrap.h:31
#define ONIXS_SGXTITAN_OUCH_NAMESPACE_BEGIN
Definition: Bootstrap.h:27
Binary4 orderBookId() const
Order book ID.
ONIXS_SGXTITAN_OUCH_API void toStr(std::string &, OutboundMessageTypes::Enum)
Appends string presentation of object.
void setOrdinary(BlockSize offset, FieldValue value)
Assigns value of a field by its offset.