OnixS C++ FIX Engine  4.12.0
API Documentation
Dictionary.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 <string>
23 #include <vector>
24 
27 
28 namespace OnixS {
29 namespace FIX {
30 /// Identifies attributes of a valid FIX field value.
32 {
33 public:
34  /// Returns a valid value of the corresponding FIX field.
35  std::string value() const;
36 
37  /// Returns a valid value description of the corresponding FIX field.
38  std::string description() const;
39 
40 private:
41 
42  friend class MessageOperator;
43 
44  const char * value_;
45  const char * description_;
46 
47  ValidFieldValue(const char * value, const char * description);
48 };
49 
50 /// Identifies attributes of a FIX field.
52 {
53 public:
54  /// Returns the tag number of the corresponding FIX field.
55  Tag tag() const;
56 
57  /// Indicates if this field is a required one.
58  bool isRequired() const;
59 
60  /// Returns the collection of child fields if this field identifies the repeating group.
61  std::vector<FieldInfo> childFields() const;
62 
63 private:
64 
65  friend class MessageOperator;
66 
67  const void * impl_;
68 
69  FieldInfo(const void *);
70 };
71 
72 /// Identifies the FIX messages dictionary.
74 {
75 public:
76  /// Initializes the dictionary according to the
77  /// definition from the Engine configuration file.
78  ///
79  /// @param id The identifier of the FIX dictionary as specified in
80  /// the dictionary XML description by the 'id' attribute of the 'FIX' node.
81  Dictionary(const char * id);
82 
83  /// Creates the dictionary that corresponds to
84  /// the given FIX Protocol version.
86 
87  /// The dictionary unique identifier.
88  const std::string & id() const;
89 
90  /// The version of the FIX messaging specification
91  /// (protocol) on which the dictionary is based.
92  ProtocolVersion::Enum version() const;
93 
94  /// Returns the name of the corresponding FIX field.
95  ///
96  /// @return The name of corresponding FIX field
97  /// or an empty string if the field is unknown.
98  const std::string & fieldName(Tag tag) const;
99 
100  /// Returns the tag number of the corresponding FIX field.
101  ///
102  /// @return The tag number of the corresponding FIX field
103  /// or 0 if the field is unknown.
104  Tag fieldNumber(const std::string & name) const;
105 
106  /// Returns the value description (if it exists) of the corresponding FIX field value.
107  ///
108  /// @return The value description of the corresponding FIX field value
109  /// or an empty string if there is no a description for this field value
110  /// or the field is unknown.
111  std::string fieldValueDescription(Tag tag, const std::string & value) const;
112 
113  /// The collection of valid field values.
114  typedef std::vector<ValidFieldValue> ValidFieldValues;
115 
116  /// Returns valid field values (if they exist) of the corresponding FIX field.
117  ///
118  /// @return A set of valid field values of the corresponding FIX field value
119  /// or an empty set if there is no known valid field values for this field
120  /// or the field is unknown.
121  ValidFieldValues validFieldValues(Tag tag) const;
122 
123  /// The collection of message types.
124  typedef std::vector<std::string> MessageTypes;
125 
126  /// Returns a collection of types of all messages available in this particular FIX dictionary.
127  MessageTypes messageTypes() const;
128 
129  /// Returns the message name by the given message type.
130  ///
131  /// @return The message name by the given message type
132  /// or an empty string if the message type is unknown.
133  std::string messageName(const std::string & type) const;
134 
135  /// The collection of the FIX field information.
136  typedef std::vector<FieldInfo> FieldInfos;
137 
138  /// Returns a collection of field descriptions that belong to the given message.
139  FieldInfos messageFields(const std::string & type) const;
140 
141  /// The collection of tag numbers.
142  typedef std::vector<Tag> Tags;
143 
144  /// Returns a collection of all tags which belong to the dialect.
145  Tags tags() const;
146 
147  /// Compares two dictionaries by their identifiers.
148  bool operator == (const Dictionary & other) const;
149 
150  /// Compares two dictionaries by their identifiers.
151  bool operator != (const Dictionary & other) const;
152 
153  /// Swaps two instances.
154  void swap(Dictionary & other);
155 
156 private:
157  friend class MessageOperator;
158 
159  const void * impl_;
160 
161  Dictionary(const void *);
162 };
163 }
164 }
#define ONIXS_FIXENGINE_API
Definition: ABI.h:45
Identifies attributes of a FIX field.
Definition: Dictionary.h:51
std::vector< ValidFieldValue > ValidFieldValues
The collection of valid field values.
Definition: Dictionary.h:114
Identifies attributes of a valid FIX field value.
Definition: Dictionary.h:31
std::vector< Tag > Tags
The collection of tag numbers.
Definition: Dictionary.h:142
Identifies the FIX messages dictionary.
Definition: Dictionary.h:73
std::vector< FieldInfo > FieldInfos
The collection of the FIX field information.
Definition: Dictionary.h:136
unsigned Tag
Alias for tag numbers.
Definition: Tag.h:28
std::vector< std::string > MessageTypes
The collection of message types.
Definition: Dictionary.h:124
bool operator==(const FieldValueRef &ref, const std::string &str)
bool operator!=(const FieldValueRef &ref, const std::string &str)