OnixS C++ Cboe CFE Multicast PITCH Market Data Handler  1.12.1
API documentation
TradeLong.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 
22 #include <vector>
23 
28 
29 
30 namespace OnixS {
31 namespace CboeCFE {
32 namespace MarketData {
33 namespace Pitch {
34 
35  /// The Trade message provides information about executions that occur off of the CFE book (such as ECRP / Block trades).
36  struct TradeLongMsg : public BinaryMessage
37  {
38  /// Nanosecond offset from last unit timestamp.
41  {
42  return ordinary<Binary4>(2);
43  }
44 
45  /// Obfuscated Order ID or Order Id of the executed order.
46  Binary8 orderId() const
48  {
49  return ordinary<Binary8>(6);
50  }
51 
52  /// Always Buy Order regardless of resting side.
55  {
56  return enumeration<SideIndicator>(14);
57  }
58 
59  /// Incremental number of contracts executed.
60  Binary4 quantity() const
62  {
63  return ordinary<Binary4>(15);
64  }
65 
66  /// Symbol right padded with spaces.
67  StrRef symbol() const
69  {
70  return fixedStr<6>(19);
71  }
72 
73  /// The execution price of the order.
76  {
77  return ordinary<BinaryPrice>(25);
78  }
79 
80  /// CFE generated day-unique execution identifier of this trade. Execution Id is also referenced in the
81  /// Trade Break message.
84  {
85  return ordinary<Binary8>(33);
86  }
87 
88  /// Trade Condition
91  {
92  return enumeration<TradeCondition>(41);
93  }
94 
95  /// Total message size.
97 
98  /// Check the given size.
99  static void validateSize(MessageSize size)
100  {
101  if (ONIXS_BATS_PITCH_CHECK_EXPECT((size < messageSize_), false))
102  throwIncorrectSize("TradeLong", size, messageSize_);
103  }
104 
105  /// Initializes instance over given memory block.
106  TradeLongMsg(const void* data, MessageSize size)
108  : BinaryMessage(data, size)
109  {
110  }
111  };
112 
113  /// Serializes object into string.
114  ONIXS_CBOECFE_PITCH_API void toStr(std::string&, const TradeLongMsg&);
115 
116  /// Serializes object into string.
117  inline std::string toStr(const TradeLongMsg& msg)
118  {
119  std::string str;
120  toStr(str, msg);
121  return str;
122  }
123 
124 }
125 }
126 }
127 }
SideIndicator::Enum sideIndicator() const ONIXS_BATS_PITCH_NOTHROW
Always Buy Order regardless of resting side.
Definition: TradeLong.h:53
ONIXS_CBOECFE_PITCH_API ONIXS_BATS_PITCH_COLDPATH ONIXS_BATS_PITCH_NORETURN void throwIncorrectSize(const std::string &messageName, MessageSize receivedSize, MessageSize expectedSize)
Binary4 timeOffset() const ONIXS_BATS_PITCH_NOTHROW
Nanosecond offset from last unit timestamp.
Definition: TradeLong.h:39
#define ONIXS_BATS_PITCH_CONST_OR_CONSTEXPR
Definition: Compiler.h:110
static void validateSize(MessageSize size)
Check the given size.
Definition: TradeLong.h:99
Provides efficient way of accessing text-based FIX field values.
Definition: String.h:45
Encapsulates services for manipulating little endian encoded messages.
StrRef symbol() const ONIXS_BATS_PITCH_NOTHROW
Symbol right padded with spaces.
Definition: TradeLong.h:67
The Trade message provides information about executions that occur off of the CFE book (such as ECRP ...
Definition: TradeLong.h:36
BinaryMessage() ONIXS_BATS_PITCH_NOTHROW
Initializes blank instance referencing to nothing.
Binary8 orderId() const ONIXS_BATS_PITCH_NOTHROW
Obfuscated Order ID or Order Id of the executed order.
Definition: TradeLong.h:46
TradeLongMsg(const void *data, MessageSize size) ONIXS_BATS_PITCH_NOTHROW
Initializes instance over given memory block.
Definition: TradeLong.h:106
Binary2 MessageSize
Aliases message length type.
Definition: Defines.h:90
Binary4 quantity() const ONIXS_BATS_PITCH_NOTHROW
Incremental number of contracts executed.
Definition: TradeLong.h:60
Binary8 executionId() const ONIXS_BATS_PITCH_NOTHROW
Definition: TradeLong.h:82
TradeCondition::Enum tradeCondition() const ONIXS_BATS_PITCH_NOTHROW
Trade Condition.
Definition: TradeLong.h:89
BinaryPrice price() const ONIXS_BATS_PITCH_NOTHROW
The execution price of the order.
Definition: TradeLong.h:74
static ONIXS_BATS_PITCH_CONST_OR_CONSTEXPR MessageSize messageSize_
Total message size.
Definition: TradeLong.h:96
#define ONIXS_BATS_PITCH_NOTHROW
Definition: Compiler.h:107
ONIXS_CBOECFE_PITCH_API void toStr(std::string &, SideIndicator::Enum)
Appends string presentation of object.