OnixS C++ FIX Engine 4.13.0
API Documentation
Loading...
Searching...
No Matches
Group.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 <iterator>
23
25
26namespace OnixS {
27namespace FIX {
30
37class
39 GroupInstance : public FieldSet
40{
41public:
44
47
49 GroupInstance & operator = (const GroupInstance &);
50
52 void swap(GroupInstance &);
53
58 std::string toString(char delimiter = 0x1) const;
59
65 void toString(std::string & str, char delimiter = 0x1) const;
66
67private:
68 friend class MessageOperator;
69
70 GroupInstance(const Message *, void *);
71};
72
73inline
75{
76 *static_cast<FieldSet *>(this) = static_cast<const FieldSet &>(other);
77 return *this;
78}
79
80inline
82{
83 FieldSet::swap(static_cast<FieldSet &>(other));
84}
85
86inline
87std::string GroupInstance::toString(char delimiter) const
88{
89 std::string str;
90
91 toString(str, delimiter);
92
93 return str;
94}
95
108{
109public:
112
114 Group(const Group & other);
115
117 bool valid() const;
118
124 size_t size() const;
125
133 GroupInstance at(size_t index);
134
142 const GroupInstance at(size_t index) const;
143
151 GroupInstance operator [](size_t index);
152
160 const GroupInstance operator [](size_t index) const;
161
163 Group & operator = (const Group & other);
164
166 void swap(Group & other);
167
172 std::string toString(char delimiter = 0x1) const;
173
179 void toString(std::string & str, char delimiter = 0x1) const;
180
183 {
184 public:
185
186 typedef std::forward_iterator_tag iterator_category;
188 typedef std::ptrdiff_t difference_type;
191
193 Iterator(Group *, size_t);
194
195 GroupInstance & operator *() {
196 return currentGroupInstance_;
197 }
198
199 GroupInstance * operator ->() {
200 return &currentGroupInstance_;
201 }
202
203 bool operator == (const Iterator &) const;
204 bool operator != (const Iterator &) const;
205
206 Iterator & operator ++();
207
208 private:
210 Group * container_;
211
213 size_t currentGroupInstanceIndex_;
214
216 GroupInstance currentGroupInstance_;
217 };
218
221
224
225private:
226 friend class MessageOperator;
227
228 void * impl_;
229
230 const Message * container_;
231
232 Group(const Message *, void *);
233};
234
235inline
236std::string Group::toString(char delimiter) const
237{
238 std::string str;
239
240 toString(str, delimiter);
241
242 return str;
243}
244
247std::ostream & operator << (std::ostream & os, const Group & group);
248
251std::ostream & operator << (std::ostream & os, const GroupInstance & instance);
252
253}
254}
#define ONIXS_FIXENGINE_API_DECL(typeKind, typeName)
Definition ABI.h:57
#define ONIXS_FIXENGINE_API
Definition ABI.h:45
void swap(FieldSet &)
friend class Message
Definition FieldSet.h:783
The single instance of the FIX Repeating Group.
Definition Group.h:40
void swap(GroupInstance &)
Swaps two instances.
Definition Group.h:81
GroupInstance & operator=(const GroupInstance &)
Reinitializes an instance as reference of other one.
Definition Group.h:74
GroupInstance()
The group instance which refers to nothing.
friend class MessageOperator
Definition Group.h:68
GroupInstance(const GroupInstance &other)
Initializes an instance as a reference to the other one.
std::string toString(char delimiter=0x1) const
Returns the string representation of the group instance using the given delimiter.
Definition Group.h:87
void toString(std::string &str, char delimiter=0x1) const
Appends a string representation of the group instance using the given delimiter.
The mutable iterator to iterate over all group instances in the repeating group.
Definition Group.h:183
GroupInstance * pointer
Definition Group.h:189
std::forward_iterator_tag iterator_category
Definition Group.h:186
GroupInstance & reference
Definition Group.h:190
GroupInstance value_type
Definition Group.h:187
Iterator(Group *, size_t)
Initializes the iterator by a first group instance from which you need to iterate.
std::ptrdiff_t difference_type
Definition Group.h:188
Encapsulates operations over the FIX Repeating Group.
Definition Group.h:108
Group()
The group which refers to nothing.
const GroupInstance at(size_t index) const
Accesses to the repeating group instance.
Iterator begin()
Returns the iterator to the first group instance in the group.
size_t size() const
Return the number of instances in the repeating group.
bool valid() const
Indicated whether the group refers to a valid instance.
GroupInstance at(size_t index)
Accesses to the repeating group instance.
void swap(Group &other)
Swaps two instances.
friend class MessageOperator
Definition Group.h:226
Group(const Group &other)
Initializes an instance as a reference to the given repeating group.
Iterator end()
Returns the iterator to the group instance after the last one in the group.
std::string toString(char delimiter=0x1) const
Returns the string representation of the group using the given delimiter.
Definition Group.h:236
void toString(std::string &str, char delimiter=0x1) const
Appends the string representation of the message using the given delimiter.
Encapsulates operations over a FIX Message.
Definition Message.h:52
ONIXS_FIXENGINE_API std::ostream & operator<<(std::ostream &os, const Group &group)
Stream output.