|
ACF $AcfVersion:0$
|
Extended message supporting attached list of serializable objects. More...
#include <CExtMessage.h>
Classes | |
| struct | AttachedObject |
| Structure holding an attached object and its description. More... | |
Public Types | |
| typedef CMessage | BaseClass |
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 | |
| CExtMessage (const iser::IObjectFactory *factoryPtr=NULL) | |
| Default constructor. | |
| CExtMessage (istd::IInformationProvider::InformationCategory category, int id, const QString &text, const QString &source, int flags=0, const QDateTime *timeStampPtr=NULL, const iser::IObjectFactory *factoryPtr=NULL) | |
| Construct extended message with all properties. | |
| const iser::IObjectFactory * | GetObjectFactory () const |
| Get the object factory used for deserialization. | |
| void | SetObjectFactory (const iser::IObjectFactory *factoryPtr) |
| Set the object factory for deserialization. | |
| void | ResetAttachedObjects () |
| Remove all attached objects from the message. | |
| int | GetAttachedObjectsCount () const |
| Get the number of attached objects. | |
| const iser::IObject * | GetAttachedObject (int index) const |
| Get a specific attached object by index. | |
| const QString & | GetAttachedObjectDescription (int index) const |
| Get the description of an attached object. | |
| void | InsertAttachedObject (iser::IObject *objectPtr, const QString &description="") |
| Add an object to this message. | |
| virtual QByteArray | GetFactoryId () const override |
| Get the factory identifier for serialization. | |
| virtual bool | Serialize (iser::IArchive &archive) override |
| Serialize or deserialize the message and attached objects. | |
| virtual bool | CopyFrom (const istd::IChangeable &object, CompatibilityMode mode=CM_STRICT) override |
| Copy message and attached objects from another message. | |
| 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. | |
Protected Attributes | |
| const iser::IObjectFactory * | m_factoryPtr |
| Object factory for deserializing attached objects. | |
| QList< AttachedObject > | m_attachedObjects |
| List of attached objects with descriptions. | |
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. | |
Extended message supporting attached list of serializable objects.
CExtMessage extends CMessage to allow attachment of custom objects that provide additional context or data related to the message. Each attached object can have an associated description.
This is particularly useful for error messages where you want to include the problematic data, validation results, or other context objects for detailed analysis or debugging.
The class uses an object factory for deserialization, allowing attached objects to be properly reconstructed when loading from archives.
Definition at line 82 of file CExtMessage.h.
| typedef CMessage ilog::CExtMessage::BaseClass |
Definition at line 85 of file CExtMessage.h.
|
explicit |
Default constructor.
Creates an empty extended message with no object factory.
| factoryPtr | Optional object factory for deserialization of attached objects |
| ilog::CExtMessage::CExtMessage | ( | istd::IInformationProvider::InformationCategory | category, |
| int | id, | ||
| const QString & | text, | ||
| const QString & | source, | ||
| int | flags = 0, |
||
| const QDateTime * | timeStampPtr = NULL, |
||
| const iser::IObjectFactory * | factoryPtr = NULL |
||
| ) |
Construct extended message with all properties.
| 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 |
| factoryPtr | Optional object factory for deserializing attached objects |
|
overridevirtual |
Create a deep copy of this extended message.
Creates a new message with all properties and attached objects copied.
| mode | Compatibility mode for cloning |
Reimplemented from ilog::CMessage.
|
overridevirtual |
Copy message and attached objects from another message.
| object | Source object to copy from |
| mode | Compatibility mode for copying |
Reimplemented from ilog::CMessage.
| const iser::IObject * ilog::CExtMessage::GetAttachedObject | ( | int | index | ) | const |
Get a specific attached object by index.
| index | Zero-based index of object to retrieve |
| const QString & ilog::CExtMessage::GetAttachedObjectDescription | ( | int | index | ) | const |
Get the description of an attached object.
| index | Zero-based index of object |
| int ilog::CExtMessage::GetAttachedObjectsCount | ( | ) | const |
Get the number of attached objects.
|
overridevirtual |
Get the factory identifier for serialization.
Reimplemented from ilog::CMessage.
| const iser::IObjectFactory * ilog::CExtMessage::GetObjectFactory | ( | ) | const |
Get the object factory used for deserialization.
|
static |
Get the extended message type identifier.
| void ilog::CExtMessage::InsertAttachedObject | ( | iser::IObject * | objectPtr, |
| const QString & | description = "" |
||
| ) |
Add an object to this message.
Attaches a serializable object to the message with an optional description. The message takes ownership of the object and will delete it when the message is destroyed.
| objectPtr | Pointer to object to attach. Message takes ownership. Must implement iser::IObject interface. |
| description | Optional human-readable description of the object |
| void ilog::CExtMessage::ResetAttachedObjects | ( | ) |
Remove all attached objects from the message.
Clears the attached objects list, releasing all owned objects.
|
overridevirtual |
Serialize or deserialize the message and attached objects.
Stores/loads all message properties plus all attached objects to/from the archive. Uses the object factory to recreate attached objects during deserialization.
| archive | Archive for reading or writing |
Reimplemented from ilog::CMessage.
| void ilog::CExtMessage::SetObjectFactory | ( | const iser::IObjectFactory * | factoryPtr | ) |
Set the object factory for deserialization.
| factoryPtr | Object factory to use when deserializing attached objects |
|
protected |
List of attached objects with descriptions.
Definition at line 317 of file CExtMessage.h.
|
protected |
Object factory for deserializing attached objects.
Definition at line 314 of file CExtMessage.h.