OnixS C++ FIX Engine 4.13.0
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;
95
97 ConstIterator(const FlatGroup *, size_t);
98
99 const FlatGroupInstance & operator*() const {
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
125
128
129private:
130
131 friend class MessageOperator;
132
133 FlatGroup(const FlatMessage *, FlatFieldRef, const FlatGroupInstance *);
134
135 const FlatMessage * container_;
136
137 const FlatGroupInstance * parent_;
138
139 const char * groupFieldValue_;
140
141 size_t groupFieldValueSize_;
142
143 size_t groupSize_;
144};
145
146}
147}
#define ONIXS_FIXENGINE_API_DECL(typeKind, typeName)
Definition ABI.h:57
#define ONIXS_FIXENGINE_API
Definition ABI.h:45
Represents a temporary reference to a field in an editable serialized message.
Field primary attributes (a tag and a reference to a value).
Definition FlatMessage.h:62
A single instance of the FIX Repeating Group.
Definition FlatGroup.h:35
FlatFieldRef find(Tag) const
Looks for a field using the given tag number.
StringRef operator[](const FlatFieldRef &) const
Provides an access to a field value by the given temporary reference.
FlatGroup getGroup(const FlatFieldRef &numberOfInstancesRef) const
Returns the reference to a repeating group - if exists.
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 * operator->() const
Definition FlatGroup.h:103
ConstIterator(const FlatGroup *, size_t)
Initializes an iterator by a first group instance from which you need to iterate.
const FlatGroupInstance & operator*() const
Definition FlatGroup.h:99
Encapsulates operations over the FIX Repeating Group.
Definition FlatGroup.h:76
size_t size() const
Returns the number of instances in the repeating group.
Definition FlatGroup.h:80
ConstIterator end() const
Returns the iterator to the group instance after the last one in the group.
friend class MessageOperator
Definition FlatGroup.h:131
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
Provides an access to FIX fields from a flat (tag=value) message.
Provides an efficient way of accessing text-based FIX field values.
Definition StringRef.h:62
unsigned Tag
Alias for tag numbers.
Definition Tag.h:28