CAttributesManager.h
Go to the documentation of this file.
1 #ifndef iattr_CAttributesManager_included
2 #define iattr_CAttributesManager_included
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 
18 namespace iattr
19 {
20 
21 
26  virtual public IAttributesManager,
27  virtual public iser::ISerializable
28 {
29 public:
31 
32  void SetAttributesFactory(const iser::IObjectFactory* factoryPtr);
33 
34  // reimplemented (iattr::IAttributesManager)
35  virtual void RemoveAllAttributes();
36  virtual bool InsertAttribute(
37  const QByteArray& attributeId,
38  iser::IObject* attributePtr,
39  bool releaseFlag);
40 
41  // reimplemented (iattr::IAttributesProvider)
42  virtual AttributeIds GetAttributeIds() const;
43  virtual iser::IObject* GetAttribute(const QByteArray& attributeId) const;
44 
45  // reimplemented (iser::ISerializable)
46  virtual bool Serialize(iser::IArchive& archive);
47 
48 private:
50  typedef QMap<QByteArray, AttributePtr> AttributesMap;
51  AttributesMap m_attributesMap;
52 
53  const iser::IObjectFactory* m_attributesFactoryPtr;
54 
55  imod::CModelUpdateBridge m_attributesUpdateBridge;
56 };
57 
58 
59 } // namespace iattr
60 
61 
62 #endif // !iattr_CAttributesManager_included
63 
64 
Common interface for a container of properties.
Pointer wrapper providing activatable deleting pointed object during destruction. ...
Definition: TOptDelPtr.h:20
Common class for all classes which objects can be archived or restored from archive.
Definition: ISerializable.h:23
Common interface for factorisable model objects.
Definition: IObject.h:19
Basic implementation of an property container.
static const CStandardAttributesFactory & GetInstance()
Generic interface for a factory.
Definition: TIFactory.h:17
Represent input/output persistence archive.
Definition: IArchive.h:30
virtual bool Serialize(iser::IArchive &archive)
Load or store state of this object as a archive stream.
virtual void RemoveAllAttributes()
Reset properties.
void SetAttributesFactory(const iser::IObjectFactory *factoryPtr)
QSet< QByteArray > AttributeIds
Reflects the changes of observed objects as changes of some other object (over istd::IChangeable), typically delegated to itself.
CAttributesManager(const iser::IObjectFactory *factoryPtr=&CStandardAttributesFactory::GetInstance())
virtual AttributeIds GetAttributeIds() const
Get list of all attribute IDs.
virtual iser::IObject * GetAttribute(const QByteArray &attributeId) const
Get property with the given index.
virtual bool InsertAttribute(const QByteArray &attributeId, iser::IObject *attributePtr, bool releaseFlag)
Insert an property into the object.

© 2007-2017 Witold Gantzke and Kirill Lepskiy