OnixS C++ CME MDP Premium Market Data Handler  5.8.3
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.
36 void throwFieldConversionFailure(const Char* field, const Char* target);
37 
38 /// Extracts security id from the given tag-value container.
39 ///
40 /// Throws an exception if security identifier is not a number.
41 inline SecurityId securityId(const MultiContainer& message)
42 {
44 
45  if (!value(securityId, message, Tags::SecurityID))
46  {
47  throwFieldConversionFailure("SecurityID(48)", "number");
48  }
49 
50  return securityId;
51 }
52 
53 /// Retrieves security group field value assuming
54 /// the given message represents a security definition.
55 ///
56 /// Returns an empty ref if the field is absent.
57 inline StrRef securityGroup(const MultiContainer& message)
58 {
59  return valueOrDefault(message, Tags::SecurityGroup);
60 }
61 
62 /// Retrieves symbol field value assuming the
63 /// given message represents a security definition.
64 ///
65 /// Returns an empty ref if the field is absent.
66 inline StrRef symbol(const MultiContainer& message)
67 {
68  return valueOrDefault(message, Tags::Symbol);
69 }
70 
71 /// Retrieves asset field value assuming the
72 /// given message represents a security definition.
73 ///
74 /// Returns an empty ref if the field is absent.
75 inline StrRef asset(const MultiContainer& message)
76 {
77  return valueOrDefault(message, Tags::Asset);
78 }
79 
80 /// Retrieves security update action field value assuming
81 /// the given container represents a security definition.
84 
85 /// Retrieves depths of direct and implied books assuming
86 /// the given message represents a security definition.
89 
90 /// Retrieves match event indicator bits.
91 ///
92 /// Returns an empty bitset if indicator is absent.
95 
96 /// Retrieves last update time field value.
99 
StrRef securityGroup(const MultiContainer &message)
Retrieves security group field value assuming the given message represents a security definition...
Definition: Accessors.h:57
SecurityUpdateAction::Enum securityUpdateAction(const MultiContainer &)
Retrieves security update action field value assuming the given container represents a security defin...
void throwFieldConversionFailure(const Char *field, const Char *target)
Raises exception explaining field value conversion failure.
StrRef asset(const MultiContainer &message)
Retrieves asset field value assuming the given message represents a security definition.
Definition: Accessors.h:75
MatchEventIndicator type.
Definition: Fields.h:881
#define ONIXS_CMEMDHFIX_NAMESPACE_BEGIN
Definition: Bootstrap.h:70
Represents time point without time-zone information.
Definition: Time.h:387
StrRef symbol(const MultiContainer &message)
Retrieves symbol field value assuming the given message represents a security definition.
Definition: Accessors.h:66
const Tag SecurityID
Definition: Tags.h:131
Int32 SecurityId
Unique security identifier.
Definition: Domain.h:31
Timestamp timestamp(const MultiContainer &, Tag)
Retrieves last update time field value.
Char Symbol[20]
Symbol.
Definition: Fields.h:166
char Char
Character type alias.
Definition: String.h:36
bool value(Number &number, const MultiContainer &container, Tag tag)
Finds a tag-value entry in the given collection by the given tag and returns its value component tran...
#define ONIXS_CMEMDHFIX_NAMESPACE_END
Definition: Bootstrap.h:71
Char SecurityGroup[6]
SecurityGroup type.
Definition: Fields.h:111
void bookDepths(const MultiContainer &, MbpBookDepth &, MbpBookDepth &)
Retrieves depths of direct and implied books assuming the given message represents a security definit...
Provides efficient way of accessing text-based values without copying content of the text being refer...
Definition: String.h:41
UInt8 MbpBookDepth
Market by price order book depth type.
Definition: MbpBookTraits.h:28
Char Asset[6]
Asset.
Definition: Fields.h:33
#define ONIXS_CMEMDH_EXPORTED
Definition: Compiler.h:135
UInt32 Tag
The type whose values are used to locate fields in the FIX-like messages.
Definition: Tag.h:29
Sequence of tag-value pairs preserving order of pairs and allowing presence of multiple tag-value pai...
MatchEventIndicator matchEventIndicator(const MultiContainer &)
Retrieves match event indicator bits.
MultiContainer::Value valueOrDefault(const MultiContainer &container, Tag tag, const MultiContainer::Value &defaultValue=MultiContainer::Value())
Finds a tag-value entry in the given collection by the given tag and returns its value component...
SecurityId securityId(const MultiContainer &message)
Extracts security id from the given tag-value container.
Definition: Accessors.h:41