OnixS C++ FIX Engine 4.14.0
Users' manual and API documentation
Loading...
Searching...
No Matches
FlatGroup.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
26
27namespace OnixS {
28namespace FIX {
31
34class ONIXS_FIXENGINE_API FlatGroupInstance
35{
36public:
37
41
44
52 FlatGroup getGroup(const FlatFieldRef & numberOfInstancesRef) const;
53
54private:
55
56 friend class MessageOperator;
57
58 FlatGroupInstance(const FlatMessage *, const StringRef &, const FlatGroupInstance * parent);
59 FlatGroupInstance(const FlatMessage *, const FlatGroupInstance *, const FlatGroupInstance * parent);
60
61 const FlatMessage * container_;
62 Tag parentLeadingTag_;
63 FlatField leadingField_;
64};
65
75class ONIXS_FIXENGINE_API FlatGroup
76{
77public:
78
80 size_t size() const { return groupSize_; }
81
83 StringRef groupFieldValue() const { return StringRef(groupFieldValue_, groupFieldValueSize_); }
84
87 {
88 public:
89
90 typedef std::forward_iterator_tag iterator_category;
92 typedef std::ptrdiff_t difference_type;
93 typedef const FlatGroupInstance * pointer;
95
97 ConstIterator(const FlatGroup *, size_t);
98
100 return currentGroupInstance_;
101 }
102
104 return &currentGroupInstance_;
105 }
106
107 bool operator == (const ConstIterator &) const;
108 bool operator != (const ConstIterator &) const;
109
110 ConstIterator & operator ++();
111
112 private:
114 const FlatGroup * container_;
115
117 size_t currentGroupInstanceIndex_;
118
120 FlatGroupInstance currentGroupInstance_;
121 };
122
124
127
130
131private:
132
133 friend class MessageOperator;
134
135 FlatGroup(const FlatMessage *, FlatFieldRef, const FlatGroupInstance *);
136
137 const FlatMessage * container_;
138
139 const FlatGroupInstance * parent_;
140
141 const char * groupFieldValue_;
142
143 size_t groupFieldValueSize_;
144
145 size_t groupSize_;
146};
147
148}
149}
#define ONIXS_FIXENGINE_API
Definition ABI.h:45
Field primary attributes (a tag and a reference to a value).
Definition FlatMessage.h:62
FlatFieldRef find(Tag) const
StringRef operator[](const FlatFieldRef &) const
Provides an access to a field value by the given temporary reference.
FlatGroup getGroup(const FlatFieldRef &numberOfInstancesRef) const
The constant iterator to iterate over all group instances in the repeating group.
Definition FlatGroup.h:87
std::forward_iterator_tag iterator_category
Definition FlatGroup.h:90
const FlatGroupInstance & reference
Definition FlatGroup.h:94
ConstIterator(const FlatGroup *, size_t)
Initializes an iterator by a first group instance from which you need to iterate.
const FlatGroupInstance * pointer
Definition FlatGroup.h:93
size_t size() const
Returns the number of instances in the repeating group.
Definition FlatGroup.h:80
ConstIterator const_iterator
Definition FlatGroup.h:123
ConstIterator end() const
Returns the iterator to the group instance after the last one in the group.
friend class MessageOperator
Definition FlatGroup.h:133
ConstIterator begin() const
Returns the iterator to the first group instance in the group.
StringRef groupFieldValue() const
Returns the StringRef value of the repeating group field.
Definition FlatGroup.h:83
ONIXS_FIXENGINE_API_DECL(class, IEngineListener)
unsigned Tag
Alias for tag numbers.
Definition Tag.h:28