OnixS BME SENAF Handler C++ library  2.2.0
API documentation
GenericMediumPriorityMessage.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 Medium Priority Message.
32 struct ONIXS_BME_SENAF_EXPORT GenericMediumPriorityMessage
33 {
34  /// Message code.
35  enum { code = 101 };
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  ///
55  /// \note If Source = 3, is a text message coming from Senaf Market Supervision.
56  /// This message will be shown in a Senaf Terminal “pop up”.
57  unsigned char source;
58 
59  /// Recipient of the message. Server, Terminal, API, F-E,…
60  unsigned char recipient;
61 
62  /// Member.
63  ///
64  /// \note If Member = 0, the message is for all members.
65  unsigned char member;
66 
67  /// Session.
68  ///
69  /// If Session = 0, the message is for all the sessions of a member.
70  unsigned char session;
71 
72  /// User.
73  unsigned char user;
74 
75  /// Subtype.
76  unsigned char subtype;
77 
78  /// General information data.
79  struct Subtype001
80  {
81  /// Constructor.
82  ///
83  /// \param inMessage Message.
84  Subtype001(const std::string& inMessage) : message(inMessage) {}
85 
86  /// Text message.
87  std::string message;
88  };
89 
90  /// Text message. General information data.
92 
93  /// Information message for panic cancellation notificacion.
94  struct Subtype002
95  {
96  /// Constructor.
97  ///
98  /// \param inMember Member.
99  /// \param inSource Source
100  /// \param inUser User.
102  unsigned char inMember
103  , unsigned char inSource
104  , unsigned char inUser
105  )
106  : member(inMember)
107  , source(inSource)
108  , user(inUser)
109  {}
110 
111  /// Member.
112  unsigned char member;
113 
114  /// Source (Broker, Member or Senaf).
115  unsigned char source;
116 
117  /// User.
118  unsigned char user;
119  };
120 
121  /// This message will be sent to all involved each time a panic
122  /// cancellation is requested from a client, broker or Senaf.
124 
125  /// Returns string representation.
126  std::string toString() const;
127 
128 private:
129  friend class MessageDeserializer;
130  GenericMediumPriorityMessage(const char* data, size_t dataSize);
131  void deserialize(const char* data, size_t dataSize);
132  void reset();
133 };
134 
135 /// Make it printable using C++ I/O streams.
136 ONIXS_BME_SENAF_EXPORT std::ostream& operator<<(std::ostream&, const GenericMediumPriorityMessage&);
137 
138 }}}
Information message for panic cancellation notificacion.
Optional< Subtype001 > subtype001
Text message. General information data.
Subtype002(unsigned char inMember, unsigned char inSource, unsigned char inUser)
std::ostream & operator<<(std::ostream &, const Error &)
Make it printable to formatted C++ I/O streams.
unsigned char recipient
Recipient of the message. Server, Terminal, API, F-E,…
InstrumentType::Enum instrumentType
Instrument Type. Tabulated for each market.