OnixS C++ Eurex T7 Market and Reference Data Interface (EMDI, RDI, EOBI) Handlers  8.0.0
API documentation
Group.cpp
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 protected by copyright law
4 // and international copyright treaties.
5 //
6 // Access to and use of the software is governed by the terms of the applicable ONIXS Software
7 // Services Agreement (the Agreement) and Customer end user license agreements granting
8 // a non-assignable, non-transferable and non-exclusive license to use the software
9 // for it's own data processing purposes under the terms defined in the Agreement.
10 //
11 // Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
12 // of this source code or associated reference material to any other location for further reproduction
13 // or redistribution, and any amendments to this copyright notice, are expressly prohibited.
14 //
15 // Any reproduction or redistribution for sale or hiring of the Software not in accordance with
16 // the terms of the Agreement is a violation of copyright law.
17 //
18 #include "MessageOperator.h"
19 
20 
21 namespace OnixS {
22 namespace Eurex {
23 namespace MarketData {
24 
26 
27 // Group instance.
28 
30  const Message* container, void* impl)
31  : FieldSet(container, impl)
32 {
33 }
34 
36 : FieldSet(static_cast<const FieldSet&>(other))
37 {
38 }
39 
40 inline
43  const GroupInstance& other)
44 {
45  *static_cast<FieldSet*>(this) =
46  static_cast<const FieldSet&>(other);
47 
48  return *this;
49 }
50 
51 // Group.
52 
54  const Message* container,
55  void* impl)
56  : container_(container),
57  impl_(impl)
58 {
59 }
60 
62  const Group& other)
63  : container_(other.container_),
64  impl_(other.impl_)
65 {
66 }
67 
68 Group::operator bool() const
69 {
70  return (nullptr != impl_);
71 }
72 
73 void
74 Group::swap(Group& other) throw()
75 {
76  std::swap(impl_, other.impl_);
77  std::swap(container_, other.container_);
78 }
79 
80 Group&
81 Group::operator =(const Group& other)
82 {
83  if (&other == this)
84  return *this;
85 
86  Group tmp(other);
87 
88  tmp.swap(*this);
89 
90  return *this;
91 }
92 
93 size_t
94 Group::size() const
95 {
96  if(nullptr != impl_)
97  return MessageOperator::getCore(*this).size();
98  else
99  return 0;
100 }
101 
102 const
104 Group::at(size_t index) const
105 {
106  CORE::RepeatingGroup&
107  impl =
109  *const_cast<Group*>(this));
110 
111  return MessageOperator::
113  *container_, impl.at(index));
114 }
115 
116 const GroupInstance
117 Group::operator [](size_t index) const
118 {
119  CORE::RepeatingGroup&
120  impl =
122  *const_cast<Group*>(this));
123 
124  return MessageOperator::
126  *container_, impl[index]);
127 }
128 
129 }}}
130 
const GroupInstance at(size_t index) const
Definition: Group.cpp:104
Group & operator=(const Group &other)
Reinitializes instance as reference to other one.
Definition: Group.cpp:81
Definition: Defines.h:30
Group(const Group &other)
Initializes instance as reference to given repeating group.
Definition: Group.cpp:61
const GroupInstance operator[](size_t index) const
Definition: Group.cpp:117
static GroupInstance constructGroupInstance(const Message &container, OnixS::FIX::Core::Messaging::RepeatingGroupInstance &instance)
static const OnixS::FIX::Core::Messaging::FieldValue & getCore(const FieldValueRef &value)
GroupInstance(const GroupInstance &other)
Initializes instance as reference to the other one.
Definition: Group.cpp:35
GroupInstance & operator=(const GroupInstance &)
Reinitializes instance as reference of other one.
Definition: Group.cpp:42