ACF $AcfVersion:0$
CAttributesManager.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// Qt includes
6#include <QtCore/QMap>
7
8// ACF includes
9#include <istd/TOptDelPtr.h>
11#include <iser/IArchive.h>
12#include <iser/IObject.h>
13#include <iser/CArchiveTag.h>
16
17
18namespace iattr
19{
20
21
26 virtual public IAttributesManager,
27 virtual public iser::ISerializable
28{
29public:
31
33
34 // reimplemented (iattr::IAttributesManager)
35 virtual void RemoveAllAttributes() override;
36 virtual bool InsertAttribute(
37 const QByteArray& attributeId,
38 iser::IObject* attributePtr,
39 bool releaseFlag) override;
40 virtual bool RemoveAttribute(const QByteArray& attributeId) override;
41
42 // reimplemented (iattr::IAttributesProvider)
43 virtual AttributeIds GetAttributeIds() const override;
44 virtual iser::IObject* GetAttribute(const QByteArray& attributeId) const override;
45
46 // reimplemented (iser::ISerializable)
47 virtual bool Serialize(iser::IArchive& archive) override;
48
49private:
51 typedef QMap<QByteArray, AttributePtr> AttributesMap;
52 AttributesMap m_attributesMap;
53
54 const iser::IObjectFactory* m_attributesFactoryPtr;
55
56 imod::CModelUpdateBridge m_attributesUpdateBridge;
57};
58
59
60} // namespace iattr
61
62
63
64
Basic implementation of an property container.
void SetAttributesFactory(const iser::IObjectFactory *factoryPtr)
CAttributesManager(const iser::IObjectFactory *factoryPtr=&CStandardAttributesFactory::GetInstance())
virtual bool Serialize(iser::IArchive &archive) override
Load or store state of this object as a archive stream.
virtual bool RemoveAttribute(const QByteArray &attributeId) override
Remove an existing property from the object.
virtual bool InsertAttribute(const QByteArray &attributeId, iser::IObject *attributePtr, bool releaseFlag) override
Insert an property into the object.
virtual void RemoveAllAttributes() override
Reset properties.
virtual iser::IObject * GetAttribute(const QByteArray &attributeId) const override
Get property with the given index.
virtual AttributeIds GetAttributeIds() const override
Get list of all attribute IDs.
static const CStandardAttributesFactory & GetInstance()
Common interface for a container of properties.
Reflects the changes of observed objects as changes of some other object (over istd::IChangeable),...
Represents an input/output persistence archive for object serialization.
Definition IArchive.h:164
Common interface for factorisable model objects.
Definition IObject.h:23
Common class for all classes which objects can be archived or restored from archive.
Generic interface for a factory.
Definition TIFactory.h:19
Pointer wrapper providing activatable deleting pointed object during destruction.
Definition TOptDelPtr.h:21
This namespace containes implementations of attributes concept.