OnixS C++ Cboe CFE Multicast PITCH Market Data Handler  1.12.1
API documentation
Variance.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  /// Variance Block
36  struct Variance : public BinaryMessage
37  {
38  /// Realized Variance to date (signed 64-bit decimal with 8 implied decimal places)
41  {
42  return ordinary<SignedBinary8>(0);
43  }
44 
45  /// Number of expected SP500 prices to be used for calculating returns during the life of the contract
48  {
49  return ordinary<Binary2>(8);
50  }
51 
52  /// Number of returns elapsed as of the beginning of the trading day
55  {
56  return ordinary<Binary2>(10);
57  }
58 
59  /// Previous day Settlement Value
62  {
63  return ordinary<BinaryPrice>(12);
64  }
65 
66  /// Discount Factor (signed 64-bit decimal with 16 implied decimal places)
69  {
70  return ordinary<SignedBinary8>(20);
71  }
72 
73  /// Initial strike
76  {
77  return ordinary<BinaryPrice>(28);
78  }
79 
80  /// ARMVM that was used to adjust the previous day settlement price (signed 64-bit decimal value with 6
81  /// implied decimal places)
84  {
85  return ordinary<SignedBinary8>(36);
86  }
87 
88  /// Fed Funds rate of prior day (signed 64-bit number with 6 implied decimal places)
91  {
92  return ordinary<SignedBinary8>(44);
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("Variance", size, messageSize_);
103  }
104 
105  /// Initializes instance over given memory block.
106  Variance(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 Variance&);
115 
116  /// Serializes object into string.
117  inline std::string toStr(const Variance& msg)
118  {
119  std::string str;
120  toStr(str, msg);
121  return str;
122  }
123 
124 }
125 }
126 }
127 }
Variance(const void *data, MessageSize size) ONIXS_BATS_PITCH_NOTHROW
Initializes instance over given memory block.
Definition: Variance.h:106
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
BinaryPrice previousSettlement() const ONIXS_BATS_PITCH_NOTHROW
Previous day Settlement Value.
Definition: Variance.h:60
Encapsulates services for manipulating little endian encoded messages.
BinaryMessage() ONIXS_BATS_PITCH_NOTHROW
Initializes blank instance referencing to nothing.
Binary2 MessageSize
Aliases message length type.
Definition: Defines.h:90
static void validateSize(MessageSize size)
Check the given size.
Definition: Variance.h:99
Binary2 numExpectedPrices() const ONIXS_BATS_PITCH_NOTHROW
Number of expected SP500 prices to be used for calculating returns during the life of the contract...
Definition: Variance.h:46
SignedBinary8 fedFundsRate() const ONIXS_BATS_PITCH_NOTHROW
Fed Funds rate of prior day (signed 64-bit number with 6 implied decimal places)
Definition: Variance.h:89
SignedBinary8 discountFactor() const ONIXS_BATS_PITCH_NOTHROW
Discount Factor (signed 64-bit decimal with 16 implied decimal places)
Definition: Variance.h:67
static ONIXS_BATS_PITCH_CONST_OR_CONSTEXPR MessageSize messageSize_
Total message size.
Definition: Variance.h:96
SignedBinary8 realizedVariance() const ONIXS_BATS_PITCH_NOTHROW
Realized Variance to date (signed 64-bit decimal with 8 implied decimal places)
Definition: Variance.h:39
Binary2 numElapsedReturns() const ONIXS_BATS_PITCH_NOTHROW
Number of returns elapsed as of the beginning of the trading day.
Definition: Variance.h:53
#define ONIXS_BATS_PITCH_NOTHROW
Definition: Compiler.h:107
ONIXS_CBOECFE_PITCH_API void toStr(std::string &, SideIndicator::Enum)
Appends string presentation of object.
SignedBinary8 previousARMVM() const ONIXS_BATS_PITCH_NOTHROW
Definition: Variance.h:82
BinaryPrice initialStrike() const ONIXS_BATS_PITCH_NOTHROW
Initial strike.
Definition: Variance.h:74