6#include <QtCore/QVector>
27template <
typename Value>
51 virtual const Value&
GetValueAt(
int index)
const;
52 virtual void SetValueAt(
int index,
const Value& value);
55 virtual int FindValue(
const Value& value)
const;
83template <
typename Value>
90template <
typename Value>
93 m_values(attribute.m_values)
98template <
typename Value>
102 for (
int i = 0; i < elementsCount; ++i){
104 wrap.
value = valuesPtr[i];
110template <
typename Value>
113 return int(m_values.size());
117template <
typename Value>
120 Q_ASSERT(index >= 0);
121 Q_ASSERT(index < GetValuesCount());
123 return m_values[index].value;
127template <
typename Value>
130 Q_ASSERT(index >= 0);
131 Q_ASSERT(index < GetValuesCount());
133 m_values[index].value = value;
137template <
typename Value>
142 m_values.push_back(wrap);
146template <
typename Value>
153template <
typename Value>
157 valueWrap.
value = value;
159 return m_values.indexOf(valueWrap);
165template <
typename Value>
168 return GetTypeName();
174template <
typename Value>
189 valuesCount = int(m_values.size());
192 retVal = retVal && archive.
BeginMultiTag(valuesTag, valueTag, valuesCount);
199 m_values.resize(valuesCount);
202 for (
int i = 0; i < valuesCount; ++i){
203 retVal = retVal && archive.
BeginTag(valueTag);
204 retVal = retVal && archive.
Process(m_values[i].value);
205 retVal = retVal && archive.
EndTag(valueTag);
208 retVal = retVal && archive.
EndTag(valuesTag);
216template <
typename Value>
219 if (
typeid(Value) ==
typeid(QByteArray)){
220 return "iattr::TMultiAttribute<QByteArray>";
223 return istd::CClassInfo::GetName<TMultiAttribute<Value> >();
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) override
Load or store state of this object as a archive stream.
iser::TCopySerializedWrap< iser::IObject > BaseClass
virtual int GetValuesCount() const
virtual QByteArray GetFactoryId() const override
virtual void InsertValue(const Value &value)
virtual const Value & GetValueAt(int index) const
Process tag used to group data in archive stream.
@ TT_LEAF
Leaf tag, it can contain only one primitive element.
@ TT_MULTIPLE
Multiple tag containing variable number of child tags.
Represents an input/output persistence archive for object serialization.
virtual bool Process(bool &value)=0
Processes (reads or writes) a boolean value.
virtual bool EndTag(const CArchiveTag &tag)=0
Ends a tagged section in the archive.
virtual bool BeginMultiTag(const CArchiveTag &tag, const CArchiveTag &subTag, int &count)=0
Begins a tagged section containing multiple elements of the same type.
virtual bool IsStoring() const =0
Checks if this archive is in storing (writing) or loading (reading) mode.
virtual bool BeginTag(const CArchiveTag &tag)=0
Begins a tagged section in the archive.
Help class which provides the automatic update mechanism of the model.
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