OnixS C++ CME Market Data Handler  5.4.0
API documentation
Accessors.h
Go to the documentation of this file.
1 // Copyright Onix Solutions Limited [OnixS]. All rights reserved.
2 //
3 // This software owned by Onix Solutions Limited [OnixS] and is
4 // protected by copyright law and international copyright treaties.
5 //
6 // Access to and use of the software is governed by the terms of the applicable
7 // OnixS Software Services Agreement (the Agreement) and Customer end user license
8 // agreements granting a non-assignable, non-transferable and non-exclusive license
9 // to use the software for it's own data processing purposes under the terms defined
10 // in the Agreement.
11 //
12 // Except as otherwise granted within the terms of the Agreement, copying or
13 // reproduction of any part of this source code or associated reference material
14 // to any other location for further reproduction or redistribution, and any
15 // amendments to this copyright notice, are expressly prohibited.
16 //
17 // Any reproduction or redistribution for sale or hiring of the Software not in
18 // accordance with the terms of the Agreement is a violation of copyright law.
19 //
20 
21 #pragma once
22 
23 #include <OnixS/CME/MDH/Domain.h>
24 #include <OnixS/CME/MDH/String.h>
25 
26 #include <OnixS/CME/MDH/Fields.h>
28 
30 #include <OnixS/CME/MDH/FIX/Tags.h>
31 
33 
34 /// Raises exception explaining field value conversion failure.
35 ONIXS_CMEMDH_EXPORTED
36 void
38 (
39  const Char* field,
40  const Char* target
41 );
42 
43 /// Extracts security id from the given tag-value container.
44 ///
45 /// Throws an exception if security identifier is not a number.
46 inline
49  const MultiContainer& message)
50 {
52 
53  if (!value(
54  securityId,
55  message,
57  {
59  (
60  "SecurityID(48)",
61  "number"
62  );
63  }
64 
65  return securityId;
66 }
67 
68 /// Retrieves security group field value assuming
69 /// the given message represents a security definition.
70 ///
71 /// Returns an empty ref if the field is absent.
72 inline
73 StrRef
75  const MultiContainer& message)
76 {
77  return
79  (
80  message,
82  );
83 }
84 
85 /// Retrieves symbol field value assuming the
86 /// given message represents a security definition.
87 ///
88 /// Returns an empty ref if the field is absent.
89 inline
90 StrRef
92  const
93  MultiContainer& message)
94 {
95  return
97  (
98  message,
100  );
101 }
102 
103 /// Retrieves asset field value assuming the
104 /// given message represents a security definition.
105 ///
106 /// Returns an empty ref if the field is absent.
107 inline
108 StrRef
110  const
111  MultiContainer& message)
112 {
113  return
115  (
116  message,
118  );
119 }
120 
121 /// Retrieves security update action field value assuming
122 /// the given container represents a security definition.
123 ONIXS_CMEMDH_EXPORTED
126  const MultiContainer&);
127 
128 /// Retrieves depths of direct and implied books assuming
129 /// the given message represents a security definition.
130 ONIXS_CMEMDH_EXPORTED
131 void
132 bookDepths(
133  const MultiContainer&,
134  MbpBookDepth&,
135  MbpBookDepth&);
136 
137 /// Retrieves match event indicator bits.
138 ///
139 /// Returns an empty bitset if indicator is absent.
140 ONIXS_CMEMDH_EXPORTED
143  const MultiContainer&);
144 
145 /// Retrieves last update time field value.
146 ONIXS_CMEMDH_EXPORTED
147 Timestamp
148 timestamp(
149  const MultiContainer&,
150  Tag);
151 
StrRef securityGroup(const MultiContainer &message)
Definition: Accessors.h:74
ONIXS_CMEMDH_EXPORTED void bookDepths(const MultiContainer &, MbpBookDepth &, MbpBookDepth &)
StrRef asset(const MultiContainer &message)
Definition: Accessors.h:109
MatchEventIndicator type.
Definition: Fields.h:939
#define ONIXS_CMEMDHFIX_NAMESPACE_BEGIN
Definition: Bootstrap.h:160
Represents time point without time-zone information.
Definition: Time.h:471
StrRef symbol(const MultiContainer &message)
Definition: Accessors.h:91
const Tag SecurityID
Definition: Tags.h:132
Int32 SecurityId
Unique security identifier.
Definition: Domain.h:31
ONIXS_CMEMDH_EXPORTED void throwFieldConversionFailure(const Char *field, const Char *target)
Raises exception explaining field value conversion failure.
Char Symbol[20]
Definition: Fields.h:213
char Char
Character type alias.
Definition: String.h:36
bool value(Number &number, const MultiContainer &container, Tag tag)
#define ONIXS_CMEMDHFIX_NAMESPACE_END
Definition: Bootstrap.h:164
Char SecurityGroup[6]
Definition: Fields.h:145
ONIXS_CMEMDH_EXPORTED SecurityUpdateAction::Enum securityUpdateAction(const MultiContainer &)
UInt8 MbpBookDepth
Market by price order book depth type.
Definition: MbpBookTraits.h:28
Char Asset[6]
Definition: Fields.h:33
ONIXS_CMEMDH_EXPORTED MatchEventIndicator matchEventIndicator(const MultiContainer &)
UInt32 Tag
Definition: Tag.h:29
ONIXS_CMEMDH_EXPORTED Timestamp timestamp(const MultiContainer &, Tag)
Retrieves last update time field value.
MultiContainer::Value valueOrDefault(const MultiContainer &container, Tag tag, const MultiContainer::Value &defaultValue=MultiContainer::Value())
SecurityId securityId(const MultiContainer &message)
Definition: Accessors.h:48