|
ACF $AcfVersion:0$
|
Basic implementation of the istd::IInformationProvider interface for log messages. More...
#include <CMessage.h>
Public Member Functions | |
| CMessage () | |
| Default constructor. | |
| CMessage (istd::IInformationProvider::InformationCategory category, int id, const QString &text, const QString &source, int flags=0, const QDateTime *timeStampPtr=NULL) | |
| Construct a message with all properties. | |
| void | SetMessageValues (istd::IInformationProvider::InformationCategory category, int id, const QString &text, const QString &source, int flags=0, const QDateTime *timeStampPtr=NULL) |
| Set all message properties at once. | |
| virtual void | SetCategory (istd::IInformationProvider::InformationCategory category) |
| Set the message category (severity level). | |
| virtual void | SetText (const QString &text) |
| Set the message text. | |
| virtual void | SetSource (const QString &source) |
| Set the message source. | |
| virtual QDateTime | GetInformationTimeStamp () const override |
| Get the message timestamp. | |
| virtual InformationCategory | GetInformationCategory () const override |
| Get the message category (severity level). | |
| virtual int | GetInformationId () const override |
| Get the numeric message identifier. | |
| virtual QString | GetInformationDescription () const override |
| Get the human-readable message text. | |
| virtual QString | GetInformationSource () const override |
| Get the message source identifier. | |
| virtual int | GetInformationFlags () const override |
| Get application-defined flags. | |
| virtual QByteArray | GetFactoryId () const override |
| Get the factory identifier for serialization. | |
| virtual bool | Serialize (iser::IArchive &archive) override |
| Serialize or deserialize the message. | |
| virtual bool | CopyFrom (const istd::IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override |
| Copy message data from another object. | |
| virtual istd::TUniqueInterfacePtr< istd::IChangeable > | CloneMe (CompatibilityMode mode=CM_WITHOUT_REFS) const override |
| Create a deep copy of this message. | |
Public Member Functions inherited from istd::IInformationProvider | |
| I_DECLARE_ENUM (InformationCategory, IC_NONE, IC_INFO, IC_WARNING, IC_ERROR, IC_CRITICAL) | |
Public Member Functions inherited from istd::IChangeable | |
| virtual int | GetSupportedOperations () const |
| Get set of flags for supported operations. | |
| virtual bool | IsEqual (const IChangeable &object) const |
| Compare this object with another object. | |
| virtual bool | ResetData (CompatibilityMode mode=CM_WITHOUT_REFS) |
| Reset data to its default state. | |
| virtual void | BeginChanges (const ChangeSet &changeSet) |
| Starts the change transaction. | |
| virtual void | EndChanges (const ChangeSet &changeSet) |
| Ends the change transaction. | |
| virtual void | BeginChangeGroup (const ChangeSet &changeSet) |
| Starts group of changes. | |
| virtual void | EndChangeGroup (const ChangeSet &changeSet) |
| Ends group of changes. | |
Public Member Functions inherited from istd::IPolymorphic | |
| virtual | ~IPolymorphic () |
Public Member Functions inherited from iser::ISerializable | |
| virtual quint32 | GetMinimalVersion (int versionId) const |
| Get minimal needed version to correct storing of this data. | |
Static Public Member Functions | |
| static QByteArray | GetMessageTypeId () |
| Get the message type identifier for serialization. | |
Static Public Member Functions inherited from istd::IChangeable | |
| static const ChangeSet & | GetNoChanges () |
| Get empty set of changes. | |
| static const ChangeSet & | GetAnyChange () |
| Get anonymous change set. | |
| static const ChangeSet & | GetAllChanges () |
| Get anonymous change set. | |
| static const ChangeSet & | GetDelegatedChanges () |
| Get delegated change set. | |
Protected Attributes | |
| istd::IInformationProvider::InformationCategory | m_category |
| Message category (severity level) | |
| int | m_id |
| Numeric message identifier. | |
| QString | m_text |
| Human-readable message text. | |
| QString | m_source |
| Message source identifier. | |
| int | m_flags |
| Application-defined flags. | |
| QDateTime | m_timeStamp |
| Message creation timestamp. | |
Additional Inherited Members | |
Public Types inherited from istd::IInformationProvider | |
| enum | InformationCategory { IC_NONE = 0 , IC_INFO , IC_WARNING , IC_ERROR , IC_CRITICAL } |
| Category of information. More... | |
| enum | InformationTypeFlags { ITF_DEBUG = 0x1 , ITF_SYSTEM = 0x2 , ITF_USER = 0x4 } |
| Additionally information flags. More... | |
Public Types inherited from istd::IChangeable | |
| enum | ChangeFlags { CF_ACF_INTERNAL = 0 , CF_ALL_DATA , CF_ANY , CF_DESTROYING , CF_DELEGATED , CF_NO_UNDO } |
| Data model change notification flags. More... | |
| enum | SupportedOperations { SO_NONE = 0 , SO_OBSERVE = 1 << 0 , SO_COPY = 1 << 1 , SO_CLONE = 1 << 2 , SO_COMPARE = 1 << 3 , SO_RESET = 1 << 4 } |
| Flags for supported operations. More... | |
| enum | CompatibilityMode { CM_STRICT , CM_WITHOUT_REFS , CM_WITH_REFS , CM_CONVERT } |
| Control how relationship betweeen objects are interpreted. More... | |
| typedef QMultiMap< QByteArray, QVariant > | ChangeInfoMap |
Protected Member Functions inherited from istd::IChangeable | |
| virtual void | OnBeginChanges () |
| Callback function for begin change event. | |
| virtual void | OnEndChanges (const ChangeSet &changeSet) |
| Callback function for end change event. | |
Basic implementation of the istd::IInformationProvider interface for log messages.
CMessage is the fundamental message class in the ilog library. It stores all standard message properties including category (severity), ID, text, source, flags, and timestamp.
The class implements both IInformationProvider (for message data access) and IObject (for serialization and type identification), making it fully compatible with the ACF framework's serialization and component systems.
Messages are typically created with all properties at construction and treated as immutable thereafter, though setter methods are provided for scenarios requiring modification.
Definition at line 77 of file CMessage.h.
| ilog::CMessage::CMessage | ( | ) |
Default constructor.
Creates an empty message with:
Typically used when deserializing or before calling SetMessageValues().
| ilog::CMessage::CMessage | ( | istd::IInformationProvider::InformationCategory | category, |
| int | id, | ||
| const QString & | text, | ||
| const QString & | source, | ||
| int | flags = 0, |
||
| const QDateTime * | timeStampPtr = NULL |
||
| ) |
Construct a message with all properties.
| category | Message severity level |
| id | Numeric message identifier (application-defined) |
| text | Human-readable message description |
| source | Message origin (component, module, function name) |
| flags | Optional application-defined flags (default: 0) |
| timeStampPtr | Optional pointer to timestamp, or NULL to use current time |
|
overridevirtual |
Create a deep copy of this message.
| mode | Compatibility mode for cloning |
Reimplemented from istd::IChangeable.
Reimplemented in ilog::CExtMessage, and ilog::TExtMessage< Element >.
|
overridevirtual |
Copy message data from another object.
| object | Source object to copy from (must be compatible) |
| mode | Compatibility mode for copying |
Reimplemented from istd::IChangeable.
Reimplemented in ilog::CExtMessage, and ilog::TExtMessage< Element >.
|
overridevirtual |
Get the factory identifier for serialization.
Reimplemented from iser::IObject.
Reimplemented in ilog::CExtMessage, and ilog::TExtMessage< Element >.
|
inlineoverridevirtual |
Get the message category (severity level).
Implements istd::IInformationProvider.
Definition at line 306 of file CMessage.h.
References m_category.
|
inlineoverridevirtual |
Get the human-readable message text.
Implements istd::IInformationProvider.
Definition at line 318 of file CMessage.h.
References m_text.
|
inlineoverridevirtual |
Get application-defined flags.
Implements istd::IInformationProvider.
Definition at line 330 of file CMessage.h.
References m_flags.
|
inlineoverridevirtual |
Get the numeric message identifier.
Implements istd::IInformationProvider.
Definition at line 312 of file CMessage.h.
References m_id.
|
inlineoverridevirtual |
Get the message source identifier.
Implements istd::IInformationProvider.
Definition at line 324 of file CMessage.h.
References m_source.
|
inlineoverridevirtual |
Get the message timestamp.
Implements istd::IInformationProvider.
Definition at line 300 of file CMessage.h.
References m_timeStamp.
|
static |
Get the message type identifier for serialization.
|
overridevirtual |
Serialize or deserialize the message.
Stores/loads all message properties (category, ID, text, source, flags, timestamp) to/from the archive.
| archive | Archive for reading or writing |
Implements iser::ISerializable.
Reimplemented in ilog::CExtMessage, and ilog::TExtMessage< Element >.
|
virtual |
Set the message category (severity level).
| category | New message category |
| void ilog::CMessage::SetMessageValues | ( | istd::IInformationProvider::InformationCategory | category, |
| int | id, | ||
| const QString & | text, | ||
| const QString & | source, | ||
| int | flags = 0, |
||
| const QDateTime * | timeStampPtr = NULL |
||
| ) |
Set all message properties at once.
Allows modification of message properties after construction. Typically used when reusing message objects or when constructing incrementally.
| category | Message severity level |
| id | Numeric message identifier |
| text | Human-readable message description |
| source | Message origin |
| flags | Optional application-defined flags (default: 0) |
| timeStampPtr | Optional pointer to timestamp, or NULL to use current time |
|
virtual |
Set the message source.
| source | New message origin identifier |
|
virtual |
|
protected |
Message category (severity level)
Definition at line 277 of file CMessage.h.
Referenced by GetInformationCategory().
|
protected |
Application-defined flags.
Definition at line 289 of file CMessage.h.
Referenced by GetInformationFlags().
|
protected |
Numeric message identifier.
Definition at line 280 of file CMessage.h.
Referenced by GetInformationId().
|
protected |
Message source identifier.
Definition at line 286 of file CMessage.h.
Referenced by GetInformationSource().
|
protected |
Human-readable message text.
Definition at line 283 of file CMessage.h.
Referenced by GetInformationDescription().
|
protected |
Message creation timestamp.
Definition at line 292 of file CMessage.h.
Referenced by GetInformationTimeStamp().