OnixS C++ SGX Titan OUCH Trading Handler  1.2.0
API documentation
OrderCancelled.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  /// A Cancelled Message informs you that an order has
28  /// been cancelled.
29  struct ONIXS_SGXTITAN_OUCH_API OrderCancelled : public IncomingMessage
30  {
31  /// UNIX Time
33  {
34  return ordinary<DateTime>(1);
35  }
36 
37  /// Order Token
39  ONIXS_SGX_OUCH_NOTHROW
40  {
41  return fixedStr<14>(9);
42  }
43 
44  /// Order book ID
46  ONIXS_SGX_OUCH_NOTHROW
47  {
48  return ordinary<Binary4>(23);
49  }
50 
51  /// Side
52  Side::Enum side() const
53  ONIXS_SGX_OUCH_NOTHROW
54  {
55  return enumeration<Side>(27);
56  }
57 
58  /// The identifier assigned to the new order. Note
59  /// that the number is only unique per Order book and
60  /// side
61  Binary8 orderId() const
62  ONIXS_SGX_OUCH_NOTHROW
63  {
64  return ordinary<Binary8>(28);
65  }
66 
67  /// Side
69  ONIXS_SGX_OUCH_NOTHROW
70  {
71  return enumeration<CancellationReason>(36);
72  }
73 
74  /// Total message size.
75  static ONIXS_SGX_OUCH_CONST_OR_CONSTEXPR MessageSize messageSize_ = 37;
76 
77  /// Check the given size.
78  static void validateSize(MessageSize size)
79  {
80  if(size < messageSize_)
81  throwIncorrectSize("OrderCancelled", size, messageSize_);
82  }
83 
84  /// Initializes instance over given memory block.
85  OrderCancelled(const void* data, MessageSize size)
86  ONIXS_SGX_OUCH_NOTHROW
87  : IncomingMessage(data, size)
88  {
89  }
90  };
91 
92  /// Serializes object into string.
93  ONIXS_SGXTITAN_OUCH_API void toStr(std::string&, const OrderCancelled&);
94 
95  /// Serializes object into string.
96  inline std::string toStr(const OrderCancelled& msg)
97  {
98  std::string str;
99  toStr(str, msg);
100  return str;
101  }
102 
103  ///
104  inline std::ostream& operator<<(std::ostream& stream, const OrderCancelled& msg)
105  {
106  stream << toStr(msg);
107  return stream;
108  }
109 
OrderCancelled(const void *data, MessageSize size)
Initializes instance over given memory block.
IncomingMessage(const void *data, MessageSize size)
Binary2 MessageSize
Aliases message length type.
Definition: Defines.h:47
ONIXS_SGXTITAN_OUCH_API void throwIncorrectSize(const std::string &messageName, MessageSize receivedSize, MessageSize expectedSize)
ONIXS_SGXTITAN_OUCH_API std::ostream & operator<<(std::ostream &stream, HandlerState::Enum value)
Provides efficient way of accessing text-based FIX field values.
Definition: String.h:41
static void validateSize(MessageSize size)
Check the given size.
#define ONIXS_SGXTITAN_OUCH_NAMESPACE_END
Definition: Bootstrap.h:31
#define ONIXS_SGXTITAN_OUCH_NAMESPACE_BEGIN
Definition: Bootstrap.h:27
ONIXS_SGXTITAN_OUCH_API void toStr(std::string &, OutboundMessageTypes::Enum)
Appends string presentation of object.
CancellationReason::Enum reason() const
Side.
Binary4 orderBookId() const
Order book ID.