|
ACF $AcfVersion:0$
|
Template for creating extended messages with custom embedded data. More...
#include <TExtMessage.h>
Public Types | |
| typedef CMessage | BaseClass |
| Base message class typedef. | |
| typedef Element | BaseClass2 |
| Base element class typedef. | |
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 |
Public Member Functions | |
| TExtMessage () | |
| Default constructor. | |
| TExtMessage (istd::IInformationProvider::InformationCategory category, int id, const QString &text, const QString &source, int flags=0, const QDateTime *timeStampPtr=NULL) | |
| Construct message with all standard properties. | |
| virtual QByteArray | GetFactoryId () const override |
| Get the factory identifier for serialization. | |
| virtual bool | Serialize (iser::IArchive &archive) override |
| Serialize or deserialize the message and element data. | |
| virtual bool | CopyFrom (const istd::IChangeable &object, CompatibilityMode mode=CM_STRICT) override |
| Copy message and element data from another object. | |
| virtual istd::TUniqueInterfacePtr< istd::IChangeable > | CloneMe (CompatibilityMode mode=CM_WITHOUT_REFS) const override |
| Create a deep copy of this extended 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 | GetTypeName () |
| Get the extended message type identifier. | |
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. | |
Additional Inherited Members | |
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. | |
Template for creating extended messages with custom embedded data.
TExtMessage combines CMessage with a user-defined Element type to create specialized message types that carry both standard message properties and custom structured data in a single object.
This is an alternative to CExtMessage's attached objects approach. Instead of attaching separate objects, the custom data is embedded directly in the message type through multiple inheritance.
The Element type must implement iser::ISerializable and istd::IChangeable for proper serialization and cloning support.
| Element | User-defined class to embed in the message. Must implement iser::ISerializable and istd::IChangeable interfaces. |
Definition at line 94 of file TExtMessage.h.
| typedef CMessage ilog::TExtMessage< Element >::BaseClass |
Base message class typedef.
Definition at line 100 of file TExtMessage.h.
| typedef Element ilog::TExtMessage< Element >::BaseClass2 |
Base element class typedef.
Definition at line 103 of file TExtMessage.h.
| TExtMessage::TExtMessage | ( | ) |
Default constructor.
Initializes both the message and element parts with default values.
Definition at line 213 of file TExtMessage.h.
| TExtMessage::TExtMessage | ( | istd::IInformationProvider::InformationCategory | category, |
| int | id, | ||
| const QString & | text, | ||
| const QString & | source, | ||
| int | flags = 0, |
||
| const QDateTime * | timeStampPtr = NULL |
||
| ) |
Construct message with all standard properties.
Creates a message with the specified properties. The Element part is default-constructed and can be set afterwards.
| 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 for current time |
Definition at line 221 of file TExtMessage.h.
|
overridevirtual |
Create a deep copy of this extended message.
Creates a new message with both message and element data copied.
| mode | Compatibility mode for cloning |
Reimplemented from ilog::CMessage.
Definition at line 279 of file TExtMessage.h.
References NULL, and istd::TDelPtr< Type, Accessor >::PopPtr().
|
overridevirtual |
Copy message and element data from another object.
Copies both message properties and element data from a compatible object.
| object | Source object to copy from |
| mode | Compatibility mode for copying |
Reimplemented from ilog::CMessage.
Definition at line 270 of file TExtMessage.h.
|
overridevirtual |
Get the factory identifier for serialization.
Reimplemented from ilog::CMessage.
Definition at line 237 of file TExtMessage.h.
|
static |
Get the extended message type identifier.
Returns a unique type name combining the template parameter's type.
Definition at line 293 of file TExtMessage.h.
|
overridevirtual |
Serialize or deserialize the message and element data.
Stores/loads both the base message properties and the Element data to/from the archive. The Element part is serialized in a tagged section.
| archive | Archive for reading or writing |
Reimplemented from ilog::CMessage.
Definition at line 246 of file TExtMessage.h.
References iser::IVersionInfo::AcfVersionId, iser::IArchive::BeginTag(), iser::IArchive::EndTag(), iser::IArchive::GetVersionInfo(), iser::IVersionInfo::GetVersionNumber(), and iser::CArchiveTag::TT_GROUP.