OnixS C++ Eurex T7 Market and Reference Data (EMDI, MDI, RDI, EOBI) Handlers 18.2.0
API documentation
Loading...
Searching...
No Matches
FieldSet.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
26
27#include <vector>
28
29namespace OnixS
30{
31 namespace Eurex
32 {
33 namespace MarketData
34 {
35
38
40 struct ONIXS_EUREX_EMDI_API Field
41 {
44
47
50 : tag (0)
51 {
52 }
53
55 Field (Tag fieldTag, const FieldValueRef& fieldValue)
56 : tag (fieldTag), value (fieldValue)
57 {
58 }
59 };
60
62 typedef std::vector<Field> Fields;
63
66 class ONIXS_EUREX_EMDI_API FieldSet
67 {
68 public:
73 operator bool() const;
74
81 FieldValueRef get (Tag tag) const;
82
91 Int32 getInt32 (Tag tag) const;
92
101 UInt32 getUInt32 (Tag tag) const;
102
111 Int64 getInt64 (Tag tag) const;
112
121 UInt64 getUInt64 (Tag tag) const;
122
131 Decimal getDecimal (Tag tag) const;
132
142
153 Tag tag,
156
169 Group getGroup (Tag numberOfInstancesTag) const;
170
180 Group getOptionalGroup (Tag numberOfInstancesTag) const;
181
189 bool hasFlag (Tag tag) const;
190
194 size_t fields (Fields& fields) const;
195
197 void swap(FieldSet&) throw();
198
199 protected:
200 // Message to which given set belongs to.
202
203 // Underlying implementation.
204 void* impl_;
205
206 // Uninitialized set.
208
209 // Uninitialized set.
210 FieldSet (const Message*, void*);
211
212 // Clone construction.
214
215 // Destruction available via descendants.
217
218 FieldSet& operator = (const FieldSet&);
219
220 private:
221 friend class Message;
222 friend class GroupInstance;
223 friend class MessageOperator;
224 };
225
226
227 template<typename Enumeration>
228 inline typename Enumeration::Enum getIntEnumFieldValue (const FieldSet& fieldSet, Tag tag)
229 {
230 UInt32 value;
231 return (fieldSet.get (tag).toNumber (value) ? static_cast<typename Enumeration::Enum> (value) : Enumeration::Undefined);
232 }
233
234 template<typename Enumeration>
235 inline typename Enumeration::Enum getNonZeroIntEnumFieldValue (const FieldSet& fieldSet, Tag tag)
236 {
237 UInt32 value;
238 return (fieldSet.get (tag).toNumber (value) ? static_cast<typename Enumeration::Enum> (value + 1) : Enumeration::Undefined);
239 }
240 }
241 }
242}
#define ONIXS_EUREX_EMDI_API_DECL(typeKind, typeName)
Definition ABI.h:27
Decimal type for better precision.
Definition Numeric.h:66
UInt32 getUInt32(Tag tag) const
Group getOptionalGroup(Tag numberOfInstancesTag) const
FieldSet(const Message *, void *)
Group getGroup(Tag numberOfInstancesTag) const
Decimal getDecimal(Tag tag) const
UInt64 getUInt64(Tag tag) const
size_t fields(Fields &fields) const
StringRef getStringRef(Tag tag) const
FieldValueRef get(Tag tag) const
Timestamp getTimestamp(Tag tag, TimestampFormat::Enum=TimestampFormat::YYYYMMDDHHMMSSNsec) const
Represents timestamp without time-zone information.
Definition Timestamp.h:88
Enumeration::Enum getIntEnumFieldValue(const FieldSet &fieldSet, Tag tag)
Definition FieldSet.h:228
unsigned int UInt32
Definition Numeric.h:41
std::vector< Field > Fields
Ordered collection of fields.
Definition FieldSet.h:62
Enumeration::Enum getNonZeroIntEnumFieldValue(const FieldSet &fieldSet, Tag tag)
Definition FieldSet.h:235
unsigned Tag
Alias for tag numbers.
Definition Tag.h:29
Field(Tag fieldTag, const FieldValueRef &fieldValue)
Initializes all members.
Definition FieldSet.h:55
Field()
Initializes field which refers to nothing.
Definition FieldSet.h:49
FieldValueRef value
Field value reference.
Definition FieldSet.h:46
@ YYYYMMDDHHMMSSNsec
Indicates timestamp in "YYYYMMDD-HH:MM:SS.sssssssss" format.
Definition Timestamp.h:79