OnixS BME SENAF Handler C++ library  2.2.0
API documentation
GenericHighPriorityMessage.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 <OnixS/Senaf/MarketData/Export.h>
25 
26 #include <iosfwd>
27 #include <string>
28 
29 namespace OnixS { namespace Senaf { namespace MarketData {
30 
31 /// Generic High Priority Message.
32 struct ONIXS_BME_SENAF_EXPORT GenericHighPriorityMessage
33 {
34  /// Message code.
35  enum { code = 102 };
36 
37  /// Default constructor.
39 
40  /// Market.
41  ///
42  /// \note If Market = 0, the message is market independent.
43  unsigned char market;
44 
45  /// Instrument Type. Tabulated for each market.
47 
48  /// Reference.
49  ///
50  /// \note If Reference = 0, the message is reference independent.
51  unsigned short reference;
52 
53  /// Source.
54  unsigned char source;
55 
56  /// Recipient of the message. Server, Terminal, API, F-E,…
57  unsigned char recipient;
58 
59  /// Member.
60  ///
61  /// \note If Member = 0, the message is for all members.
62  unsigned char member;
63 
64  /// Session.
65  ///
66  /// If Session = 0, the message is for all the sessions of a member.
67  unsigned char session;
68 
69  /// User.
70  unsigned char user;
71 
72  /// Subtype.
73  unsigned char subtype;
74 
75  /// General information data.
76  struct Subtype001
77  {
78  /// Constructor.
79  ///
80  /// \param inMessage Message.
81  Subtype001(const std::string& inMessage) : message(inMessage) {}
82 
83  /// Text message.
84  std::string message;
85  };
86 
87  /// Text message. General information data.
89 
90  /// Terminal Activate / Block.
91  ///
92  /// \note The server will refuse every order issued by this terminal.
93  struct Subtype002
94  {
95  /// Constructor.
96  ///
97  /// \param inTerminalActivated Terminal Activate / Block.
98  /// \param inChecksum Checksum.
100  bool inTerminalActivated
101  , unsigned char inChecksum
102  )
103  : terminalActivated(inTerminalActivated)
104  , checksum(inChecksum)
105  {}
106 
107  /// Terminal Activate / Block.
109 
110  /// Checksum.
111  unsigned char checksum;
112  };
113 
114  /// Terminal Activate / Block Message.
116 
117  /// Reference or Market Activate / Block Message.
118  ///
119  /// \note The server will refuse every request regarding this Reference or Market.
120  struct Subtype003
121  {
122  /// Constructor.
123  ///
124  /// \param inReferenceActivated Reference Activate / Block.
125  /// \param inChecksum Checksum.
127  bool inReferenceActivated
128  , unsigned char inChecksum
129  )
130  : referenceActivated(inReferenceActivated)
131  , checksum(inChecksum)
132  {}
133 
134  /// Reference Activate / Block.
136 
137  /// Checksum.
138  unsigned char checksum;
139  };
140 
141  /// Reference or Market Activate / Block Message.
143 
144  /// Returns string representation.
145  std::string toString() const;
146 
147 private:
148  friend class MessageDeserializer;
149  GenericHighPriorityMessage(const char* data, size_t dataSize);
150  void deserialize(const char* data, size_t dataSize);
151  void reset();
152 };
153 
154 /// Make it printable using C++ I/O streams.
155 ONIXS_BME_SENAF_EXPORT std::ostream& operator<<(std::ostream&, const GenericHighPriorityMessage&);
156 
157 }}}
Subtype003(bool inReferenceActivated, unsigned char inChecksum)
Optional< Subtype002 > subtype002
Terminal Activate / Block Message.
Subtype002(bool inTerminalActivated, unsigned char inChecksum)
InstrumentType::Enum instrumentType
Instrument Type. Tabulated for each market.
std::ostream & operator<<(std::ostream &, const Error &)
Make it printable to formatted C++ I/O streams.
Optional< Subtype001 > subtype001
Text message. General information data.
Optional< Subtype003 > subtype003
Reference or Market Activate / Block Message.
unsigned char recipient
Recipient of the message. Server, Terminal, API, F-E,…