CMessage.h
Go to the documentation of this file.
1 #ifndef ilog_CMessage_included
2 #define ilog_CMessage_included
3 
4 
5 // Qt includes
6 #include <QtCore/QString>
7 
8 // ACF includes
10 #include <iser/IObject.h>
11 
12 
13 namespace ilog
14 {
15 
16 
22 class CMessage:
23  virtual public istd::IInformationProvider,
24  virtual public iser::IObject
25 {
26 public:
27  CMessage();
29  int id,
30  const QString& text,
31  const QString& source,
32  int flags = 0,
33  const QDateTime* timeStampPtr = NULL);
34 
36  int id,
37  const QString& text,
38  const QString& source,
39  int flags = 0,
40  const QDateTime* timeStampPtr = NULL);
41 
43  virtual void SetText(const QString& text);
44  virtual void SetSource(const QString& source);
45 
46  // reimplemented (istd::IInformationProvider)
47  virtual QDateTime GetInformationTimeStamp() const;
49  virtual int GetInformationId() const;
50  virtual QString GetInformationDescription() const;
51  virtual QString GetInformationSource() const;
52  virtual int GetInformationFlags() const;
53 
54  // reimplemented (iser::IObject)
55  virtual QByteArray GetFactoryId() const;
56 
57  // reimplemented (iser::ISerializable)
58  virtual bool Serialize(iser::IArchive& archive);
59 
60  // reimplemented (istd::IChangeable)
61  virtual bool CopyFrom(const istd::IChangeable& object, CompatibilityMode mode = CM_WITHOUT_REFS);
63 
64  static QByteArray GetMessageTypeId();
65 
66 protected:
68  int m_id;
69  QString m_text;
70  QString m_source;
71  int m_flags;
72 
73  QDateTime m_timeStamp;
74 };
75 
76 
77 // inline methods
78 
79 // reimplemented (istd::IInformationProvider)
80 
81 inline QDateTime CMessage::GetInformationTimeStamp() const
82 {
83  return m_timeStamp;
84 }
85 
86 
88 {
89  return m_category;
90 }
91 
92 
93 inline int CMessage::GetInformationId() const
94 {
95  return m_id;
96 }
97 
98 
100 {
101  return m_text;
102 }
103 
104 
105 inline QString CMessage::GetInformationSource() const
106 {
107  return m_source;
108 }
109 
110 
112 {
113  return m_flags;
114 }
115 
116 
117 } // namespace ilog
118 
119 
120 #endif // !ilog_CMessage_included
121 
122 
virtual void SetCategory(istd::IInformationProvider::InformationCategory category)
istd::IInformationProvider::InformationCategory m_category
Definition: CMessage.h:67
External references are simple ignored.
Definition: IChangeable.h:197
CompatibilityMode
Control how relationship betweeen objects are interpreted.
Definition: IChangeable.h:186
QString m_source
Definition: CMessage.h:70
virtual int GetInformationId() const
Get binary ID of the information using to automatical identification of this information type...
Definition: CMessage.h:93
virtual QString GetInformationDescription() const
Get the text description of the information.
Definition: CMessage.h:99
virtual bool Serialize(iser::IArchive &archive)
Load or store state of this object as a archive stream.
static QByteArray GetMessageTypeId()
QString m_text
Definition: CMessage.h:69
virtual istd::IChangeable * CloneMe(CompatibilityMode mode=CM_WITHOUT_REFS) const
Make a copy of this object.
virtual QString GetInformationSource() const
Get the source of the information.
Definition: CMessage.h:105
Common interface for factorisable model objects.
Definition: IObject.h:19
virtual bool CopyFrom(const istd::IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
Copy this object from another one.
QDateTime m_timeStamp
Definition: CMessage.h:73
Represent input/output persistence archive.
Definition: IArchive.h:30
Common interface for data model objects, which can be changed.
Definition: IChangeable.h:24
virtual void SetSource(const QString &source)
virtual int GetInformationFlags() const
Get flags of the information.
Definition: CMessage.h:111
InformationCategory
Category of information.
#define NULL
Definition: istd.h:64
void SetMessageValues(istd::IInformationProvider::InformationCategory category, int id, const QString &text, const QString &source, int flags=0, const QDateTime *timeStampPtr=NULL)
Common interface for class providing some basic information object.
virtual void SetText(const QString &text)
virtual QByteArray GetFactoryId() const
Basic implementation of the istd::IInformationProvider interface.
Definition: CMessage.h:22
virtual InformationCategory GetInformationCategory() const
Get category of the information.
Definition: CMessage.h:87
virtual QDateTime GetInformationTimeStamp() const
Get optional time stamp of the information.
Definition: CMessage.h:81

© 2007-2017 Witold Gantzke and Kirill Lepskiy