ACF $AcfVersion:0$
Public Types | Public Member Functions | List of all members
ilog::IMessageContainer Class Referenceabstract

Common interface for a message container. More...

#include <IMessageContainer.h>

Inheritance diagram for ilog::IMessageContainer:
iser::ISerializable istd::IChangeable istd::IPolymorphic

Public Types

enum  ChangeFlags { CF_MESSAGE_ADDED = 0x1d32820 , CF_MESSAGE_REMOVED , CF_RESET }
 Data model change notification flags. More...
 
typedef std::list< IMessageConsumer::MessagePtrMessages
 List type for storing message shared pointers.
 
- 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

virtual istd::IInformationProvider::InformationCategory GetWorstCategory () const =0
 Get the worst (highest severity) message category in the container.
 
virtual Messages GetMessages () const =0
 Retrieve all messages currently in the container.
 
virtual void ClearMessages ()=0
 Remove all message items from the container.
 
- Public Member Functions inherited from iser::ISerializable
virtual bool Serialize (IArchive &archive)=0
 Load or store state of this object as a archive stream.
 
virtual quint32 GetMinimalVersion (int versionId) const
 Get minimal needed version to correct storing of this data.
 
- Public Member Functions inherited from istd::IChangeable
virtual int GetSupportedOperations () const
 Get set of flags for supported operations.
 
virtual bool CopyFrom (const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
 Copy this object from another one.
 
virtual bool IsEqual (const IChangeable &object) const
 Compare this object with another object.
 
virtual istd::TUniqueInterfacePtr< istd::IChangeableCloneMe (CompatibilityMode mode=CM_WITHOUT_REFS) const
 Make a copy of this 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 ()
 

Additional Inherited Members

- Static Public Member Functions inherited from istd::IChangeable
static const ChangeSetGetNoChanges ()
 Get empty set of changes.
 
static const ChangeSetGetAnyChange ()
 Get anonymous change set.
 
static const ChangeSetGetAllChanges ()
 Get anonymous change set.
 
static const ChangeSetGetDelegatedChanges ()
 Get delegated change set.
 
- 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.
 

Detailed Description

Common interface for a message container.

This interface extends ISerializable to provide storage and retrieval of log messages. It supports hierarchical organization, change notifications, and can track the worst (highest severity) message category encountered.

Message containers are typically used to store messages for later display, analysis, export, or replay. They integrate with the model-observer pattern for automatic UI updates when messages change.

Hierarchical Organization
The IHierarchicalMessageContainer variant supports parent-child relationships, allowing messages to be organized by subsystem or component while still being accessible through a single interface.
Change Notifications
Containers notify observers when messages are added, removed, or cleared using the defined ChangeFlags. This enables automatic UI updates and logging reactions.
Usage Example
// Get message container
// Add messages...
container->AddMessage(msg1);
container->AddMessage(msg2);
// Retrieve all messages
ilog::IMessageContainer::Messages messages = container->GetMessages();
for (const auto& msgPtr : messages) {
qDebug() << msgPtr->GetInformationDescription();
}
// Check severity
if (container->GetWorstCategory() >= istd::IInformationProvider::IC_ERROR) {
// Errors were logged
}
// Clear for next session
container->ClearMessages();
std::list< IMessageConsumer::MessagePtr > Messages
List type for storing message shared pointers.
@ IC_ERROR
Information about error, processing could not be done correctly.
Shared ownership smart pointer for interface types.
See also
ilog::CMessageContainer, ilog::CLogComp, ilog::IHierarchicalMessageContainer

Definition at line 67 of file IMessageContainer.h.

Member Typedef Documentation

◆ Messages

List type for storing message shared pointers.

Definition at line 71 of file IMessageContainer.h.

Member Enumeration Documentation

◆ ChangeFlags

Data model change notification flags.

These flags are used with the istd::IChangeable change notification system to inform observers of container state changes.

Enumerator
CF_MESSAGE_ADDED 

A new message was added to the container.

CF_MESSAGE_REMOVED 

A message was removed from the container.

CF_RESET 

Container was reset/cleared of all messages.

Definition at line 79 of file IMessageContainer.h.

Member Function Documentation

◆ ClearMessages()

virtual void ilog::IMessageContainer::ClearMessages ( )
pure virtual

Remove all message items from the container.

Clears the container of all stored messages. For hierarchical containers, this only clears the current container, not child containers.

Observers are notified with CF_RESET change flag.

Example
// Start new session with clean log
container->ClearMessages();
// Or clear periodically to prevent memory buildup
if (container->GetMessagesCount() > 10000) {
container->ClearMessages();
}
See also
GetMessages(), CF_RESET

◆ GetMessages()

virtual Messages ilog::IMessageContainer::GetMessages ( ) const
pure virtual

Retrieve all messages currently in the container.

Returns a copy of the internal message list. For hierarchical containers, this includes messages from all child containers as well.

Messages are stored as shared pointers, so copying the list is efficient and safe. The returned messages are immutable and should not be modified.

Returns
List of message shared pointers. May be empty if no messages.
Note
This creates a copy of the message list. For very large containers, consider iterating or filtering differently.
Example
Messages messages = container->GetMessages();
qDebug() << "Container has" << messages.size() << "messages";
for (const auto& msgPtr : messages) {
QString text = msgPtr->GetInformationDescription();
QString source = msgPtr->GetInformationSource();
qDebug() << source << ":" << text;
}
See also
ClearMessages()

◆ GetWorstCategory()

virtual istd::IInformationProvider::InformationCategory ilog::IMessageContainer::GetWorstCategory ( ) const
pure virtual

Get the worst (highest severity) message category in the container.

Scans all messages and returns the highest severity level encountered. This is useful for quick status checks without iterating all messages.

The severity order is: IC_NONE < IC_INFO < IC_WARNING < IC_ERROR < IC_CRITICAL

Returns
The worst message category found, or IC_NONE if no messages.
See also
istd::IInformationProvider::InformationCategory
Example
container->GetWorstCategory();
switch (worst) {
statusIcon = errorIcon;
break;
statusIcon = warningIcon;
break;
default:
statusIcon = okIcon;
}
InformationCategory
Category of information.
@ IC_CRITICAL
Information about critical error - unnormal state of system, should never be returned.
@ IC_WARNING
Information about warning, processing could be done.

The documentation for this class was generated from the following file: