10#include <QtCore/QVector>
31template <
typename Value>
55 virtual const Value&
GetValueAt(
int index)
const;
56 virtual void SetValueAt(
int index,
const Value& value);
59 virtual int FindValue(
const Value& value)
const;
87template <
typename Value>
94template <
typename Value>
97 m_values(attribute.m_values)
102template <
typename Value>
106 for (
int i = 0; i < elementsCount; ++i){
108 wrap.
value = valuesPtr[i];
114template <
typename Value>
117 return int(m_values.size());
121template <
typename Value>
124 Q_ASSERT(index >= 0);
125 Q_ASSERT(index < GetValuesCount());
127 return m_values[index].value;
131template <
typename Value>
134 Q_ASSERT(index >= 0);
135 Q_ASSERT(index < GetValuesCount());
137 m_values[index].value = value;
141template <
typename Value>
146 m_values.push_back(wrap);
150template <
typename Value>
157template <
typename Value>
161 valueWrap.
value = value;
163 return m_values.indexOf(valueWrap);
169template <
typename Value>
172 return GetTypeName();
178template <
typename Value>
187 return archive.
ProcessAnyList(valuesTag, valueTag,
int(m_values.size()),
188 [&](
int i,
auto& archive) {
189 return archive.ProcessLeaf(valueTag, m_values[i].value);
191 [&](
int valuesCount) {
192 m_values.resize(valuesCount);
201template <
typename Value>
204 if (
typeid(Value) ==
typeid(QByteArray)){
205 return "iattr::TMultiAttribute<QByteArray>";
Template implementation of multiple component attribute.
virtual int FindValue(const Value &value) const
virtual void SetValueAt(int index, const Value &value)
static QByteArray GetTypeName()
virtual bool Serialize(iser::IArchive &archive)
Load or store state of this object as a archive stream.
QByteArray GetFactoryId() const
iser::TCopySerializedWrap< iser::IObject > BaseClass
virtual int GetValuesCount() const
virtual void InsertValue(const Value &value)
virtual const Value & GetValueAt(int index) const
Process tag used to group data in archive stream.
@ Multiple
Multiple tag containing variable number of child tags.
@ Leaf
Leaf tag, it can contain only one primitive element.
Represent input/output persistence archive.
virtual bool ProcessAnyList(const CArchiveTag &listTag, const CArchiveTag &subTag, int count, std::function< bool(int, IArchive &)> iterArchiveFn, std::function< bool(int)> resizeFn=nullptr)=0
Process some list of elements.
virtual bool IsChanging() const =0
Check if this archive processing change the object state.
Help class which provides the automatic update mechanism of the model.
const QByteArray & GetName() const
Get undecorated and platform undependent class name.
This namespace containes implementations of attributes concept.
TMultiAttribute< bool > CBooleanListAttribute
TMultiAttribute< QByteArray > CIdListAttribute
TMultiAttribute< QString > CStringListAttribute
TMultiAttribute< int > CIntegerListAttribute
TMultiAttribute< double > CRealListAttribute
bool operator==(const Wrap &object) const