ICF 3.0.5.47
Technical documentation of ICF Libraries
CAttributesManager.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#pragma once
7
8
9// ICF includes
10#include <istd/TOptDelPtr.h>
12#include <iser/IArchive.h>
13#include <iser/IObject.h>
14#include <iser/CArchiveTag.h>
17
18
19namespace iattr
20{
21
22
27 virtual public IAttributesManager,
28 virtual public iser::ISerializable
29{
30public:
32
34
35 // reimplemented (iattr::IAttributesManager)
36 virtual void RemoveAllAttributes();
37 virtual bool InsertAttribute(
38 const QByteArray& attributeId,
39 istd::TOptDelPtr<iser::IObject>&& attributePtr);
40 virtual bool RemoveAttribute(const QByteArray& attributeId);
41
42 // reimplemented (iattr::IAttributesProvider)
44 virtual iser::IObject* GetAttribute(const QByteArray& attributeId) const;
45
46 // reimplemented (iser::ISerializable)
47 virtual bool Serialize(iser::IArchive& archive);
48
49private:
51 typedef std::map<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
Basic implementation of an property container.
virtual AttributeIds GetAttributeIds() const
Get list of all attribute IDs.
void SetAttributesFactory(const iser::IObjectFactory *factoryPtr)
virtual void RemoveAllAttributes()
Reset properties.
CAttributesManager(const iser::IObjectFactory *factoryPtr=&CStandardAttributesFactory::GetInstance())
virtual iser::IObject * GetAttribute(const QByteArray &attributeId) const
Get attribute for the given ID.
virtual bool RemoveAttribute(const QByteArray &attributeId)
Remove an existing property from the object.
virtual bool Serialize(iser::IArchive &archive)
Load or store state of this object as a archive stream.
virtual bool InsertAttribute(const QByteArray &attributeId, istd::TOptDelPtr< iser::IObject > &&attributePtr)
Insert an property into the object.
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),...
Represent input/output persistence archive.
Definition IArchive.h:33
Common interface for factorisable model objects.
Definition IObject.h:25
Common class for all classes which objects can be archived or restored from archive.
Generic interface for a factory.
Definition TIFactory.h:22
Pointer wrapper providing activatable deleting pointed object during destruction.
Definition TOptDelPtr.h:23
This namespace containes implementations of attributes concept.

© Witold Gantzke and Kirill Lepskiy