OnixS C++ Cboe CFE Multicast PITCH Market Data Handler  1.12.1
API documentation
TradeShort.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 TradeShortMsg : 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  Binary2 quantity() const
62  {
63  return ordinary<Binary2>(15);
64  }
65 
66  /// Symbol right padded with spaces.
67  StrRef symbol() const
69  {
70  return fixedStr<6>(17);
71  }
72 
73  /// The execution price of the order.
76  {
77  return ordinary<BinaryShortPrice>(23);
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>(25);
86  }
87 
88  /// Trade Condition
91  {
92  return enumeration<TradeCondition>(33);
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("TradeShort", size, messageSize_);
103  }
104 
105  /// Initializes instance over given memory block.
106  TradeShortMsg(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 TradeShortMsg&);
115 
116  /// Serializes object into string.
117  inline std::string toStr(const TradeShortMsg& msg)
118  {
119  std::string str;
120  toStr(str, msg);
121  return str;
122  }
123 
124 }
125 }
126 }
127 }
static ONIXS_BATS_PITCH_CONST_OR_CONSTEXPR MessageSize messageSize_
Total message size.
Definition: TradeShort.h:96
ONIXS_CBOECFE_PITCH_API ONIXS_BATS_PITCH_COLDPATH ONIXS_BATS_PITCH_NORETURN void throwIncorrectSize(const std::string &messageName, MessageSize receivedSize, MessageSize expectedSize)
#define ONIXS_BATS_PITCH_CONST_OR_CONSTEXPR
Definition: Compiler.h:110
Provides efficient way of accessing text-based FIX field values.
Definition: String.h:45
TradeShortMsg(const void *data, MessageSize size) ONIXS_BATS_PITCH_NOTHROW
Initializes instance over given memory block.
Definition: TradeShort.h:106
Binary8 executionId() const ONIXS_BATS_PITCH_NOTHROW
Definition: TradeShort.h:82
Encapsulates services for manipulating little endian encoded messages.
BinaryMessage() ONIXS_BATS_PITCH_NOTHROW
Initializes blank instance referencing to nothing.
StrRef symbol() const ONIXS_BATS_PITCH_NOTHROW
Symbol right padded with spaces.
Definition: TradeShort.h:67
Binary2 quantity() const ONIXS_BATS_PITCH_NOTHROW
Incremental number of contracts executed.
Definition: TradeShort.h:60
Binary4 timeOffset() const ONIXS_BATS_PITCH_NOTHROW
Nanosecond offset from last unit timestamp.
Definition: TradeShort.h:39
Binary2 MessageSize
Aliases message length type.
Definition: Defines.h:90
SideIndicator::Enum sideIndicator() const ONIXS_BATS_PITCH_NOTHROW
Always Buy Order regardless of resting side.
Definition: TradeShort.h:53
Binary8 orderId() const ONIXS_BATS_PITCH_NOTHROW
Obfuscated Order ID or Order Id of the executed order.
Definition: TradeShort.h:46
static void validateSize(MessageSize size)
Check the given size.
Definition: TradeShort.h:99
TradeCondition::Enum tradeCondition() const ONIXS_BATS_PITCH_NOTHROW
Trade Condition.
Definition: TradeShort.h:89
The Trade message provides information about executions that occur off of the CFE book (such as ECRP ...
Definition: TradeShort.h:36
#define ONIXS_BATS_PITCH_NOTHROW
Definition: Compiler.h:107
ONIXS_CBOECFE_PITCH_API void toStr(std::string &, SideIndicator::Enum)
Appends string presentation of object.
BinaryShortPrice price() const ONIXS_BATS_PITCH_NOTHROW
The execution price of the order.
Definition: TradeShort.h:74