OnixS ICE iMpact Multicast Price Feed Handler C++ library 8.18.0
API documentation
Loading...
Searching...
No Matches
GroupSubscription.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Onix Solutions Limited. All rights reserved.
3 *
4 * This software owned by Onix Solutions Limited 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 "Enumerations.h"
23#include "Export.h"
24#include "Types.h"
25
26#include <iosfwd>
27#include <set>
28#include <string>
29
30namespace OnixS { namespace ICE { namespace iMpact { namespace MarketData {
31
33struct ONIXS_ICEMDH_EXPORT GroupSubscription
34{
36 std::string groupName;
37
45
48
52
55 const std::string& groupName,
58 );
59
61 static GroupSubscription deserialize(const std::string&);
62
64 bool operator==(const GroupSubscription&) const;
65
67 bool operator!=(const GroupSubscription&) const;
68
70 bool operator<(const GroupSubscription&) const;
71
73 std::string toString() const;
74};
75
77ONIXS_ICEMDH_EXPORT std::ostream& operator<<(std::ostream&, const GroupSubscription&);
78
80{
81 if (groupName != rhs.groupName)
82 {
83 return false;
84 }
85
87 {
88 return false;
89 }
90
91 if (bookDepth != rhs.bookDepth)
92 {
93 return false;
94 }
95
96 if (marketIds != rhs.marketIds)
97 {
98 return false;
99 }
100
101 return true;
102}
103
105{
106 return !(*this == rhs);
107}
108
109inline bool GroupSubscription::operator<(const GroupSubscription& right) const
110{
111 if (groupName < right.groupName)
112 {
113 return true;
114 }
115
116 if (groupName > right.groupName)
117 {
118 return false;
119 }
120
121 if (marketSubType < right.marketSubType)
122 {
123 return true;
124 }
125
126 if (marketSubType > right.marketSubType)
127 {
128 return false;
129 }
130
131 if (bookDepth < right.bookDepth)
132 {
133 return true;
134 }
135
136 if (bookDepth > right.bookDepth)
137 {
138 return false;
139 }
140
141 if (marketIds < right.marketIds)
142 {
143 return true;
144 }
145
146 if (marketIds > right.marketIds)
147 {
148 return false;
149 }
150
151 return false;
152}
153
155typedef std::set<GroupSubscription> GroupSubscriptions;
156
157}}}} // namespace OnixS::ICE::iMpact::MarketData
Declare ICE iMpact enumerations.
std::set< MarketId > MarketIds
List of market ID's.
Definition Types.h:48
std::set< GroupSubscription > GroupSubscriptions
Collection of group subscriptions.
std::ostream & operator<<(std::ostream &, const Error &)
Make it printable to formatted C++ I/O streams.
Enum
Depth of order book constants.
Defines which books should be maintained for given group name.
BookDepth::Enum bookDepth
Specifies book depth.
bool operator<(const GroupSubscription &) const
Returns true if this market subscription is less than a given.
std::string toString() const
Returns string representation.
static GroupSubscription deserialize(const std::string &)
Deserialize from a string representation.
GroupSubscription(const std::string &groupName, MarketSubType::Enum marketSubType=MarketSubType::NonImplied, BookDepth::Enum bookDepth=BookDepth::TOP5PL)
Initializes group subscription attributes.
bool operator==(const GroupSubscription &) const
Returns true if current instance is equal to the given.
bool operator!=(const GroupSubscription &) const
Returns true if current instance is not equal to the given.
@ NonImplied
The enhanced implication technology is disabled.