CExtMessage.h
Go to the documentation of this file.
1 #ifndef ilog_CExtMessage_included
2 #define ilog_CExtMessage_included
3 
4 
5 // Qt includes
6 #include <QtCore/QList>
7 
8 // ACF includes
9 #include <istd/CChangeNotifier.h>
10 #include <istd/CClassInfo.h>
11 #include <imod/TModelWrap.h>
12 #include <iser/IObject.h>
13 #include <ilog/CMessage.h>
14 
15 
16 namespace ilog
17 {
18 
19 
23 class CExtMessage: public CMessage
24 {
25 public:
27 
28  explicit CExtMessage(const iser::IObjectFactory* factoryPtr = NULL);
30  int id,
31  const QString& text,
32  const QString& source,
33  int flags = 0,
34  const QDateTime* timeStampPtr = NULL,
35  const iser::IObjectFactory* factoryPtr = NULL);
36 
38  void SetObjectFactory(const iser::IObjectFactory* factoryPtr);
39 
43  void ResetAttachedObjects();
47  int GetAttachedObjectsCount() const;
51  const iser::IObject* GetAttachedObject(int index) const;
55  const QString& GetAttachedObjectDescription(int index) const;
60  void InsertAttachedObject(const iser::IObject* objectPtr, const QString& description = "");
61 
62  // reimplemented (iser::IObject)
63  virtual QByteArray GetFactoryId() const;
64 
65  // reimplemented (iser::ISerializable)
66  virtual bool Serialize(iser::IArchive& archive);
67 
68  // reimplemented (iser::IChangeable)
69  virtual bool CopyFrom(const istd::IChangeable& object, CompatibilityMode mode = CM_STRICT);
71 
72  static QByteArray GetTypeName();
73 
74 protected:
76  {
78  QString description;
79  };
80 
81 private:
82  const iser::IObjectFactory* m_factoryPtr;
83  QList<AttachedObject> m_attachedObjects;
84 };
85 
86 
87 } // namespace ilog
88 
89 
90 #endif // ilog_CExtMessage_included
91 
92 
void InsertAttachedObject(const iser::IObject *objectPtr, const QString &description="")
Add some object to this container.
External references are simple ignored.
Definition: IChangeable.h:197
CompatibilityMode
Control how relationship betweeen objects are interpreted.
Definition: IChangeable.h:186
istd::TDelPtr< const iser::IObject > objectPtr
Definition: CExtMessage.h:77
const iser::IObjectFactory * GetObjectFactory() const
virtual QByteArray GetFactoryId() const
int GetAttachedObjectsCount() const
Get number of attached objects.
virtual istd::IChangeable * CloneMe(CompatibilityMode mode=CM_WITHOUT_REFS) const
Make a copy of this object.
void SetObjectFactory(const iser::IObjectFactory *factoryPtr)
Common interface for factorisable model objects.
Definition: IObject.h:19
If external references are different this object are not compatible and cannot be compared or copied...
Definition: IChangeable.h:192
static QByteArray GetTypeName()
Generic interface for a factory.
Definition: TIFactory.h:17
virtual bool CopyFrom(const istd::IChangeable &object, CompatibilityMode mode=CM_STRICT)
Copy this object from another one.
Represent input/output persistence archive.
Definition: IArchive.h:30
Common interface for data model objects, which can be changed.
Definition: IChangeable.h:24
const QString & GetAttachedObjectDescription(int index) const
Get description of attached object.
Extended message supporting attached list of objects.
Definition: CExtMessage.h:23
InformationCategory
Category of information.
#define NULL
Definition: istd.h:64
CMessage BaseClass
Definition: CExtMessage.h:26
CExtMessage(const iser::IObjectFactory *factoryPtr=NULL)
void ResetAttachedObjects()
Remove all attached objects from container.
const iser::IObject * GetAttachedObject(int index) const
Get single attached object.
virtual bool Serialize(iser::IArchive &archive)
Load or store state of this object as a archive stream.
Basic implementation of the istd::IInformationProvider interface.
Definition: CMessage.h:22

© 2007-2017 Witold Gantzke and Kirill Lepskiy