|
ACF $AcfVersion:0$
|
Common interface for a message container consuming information objects (messages). More...
#include <IMessageConsumer.h>
Public Types | |
| typedef istd::TSharedInterfacePtr< istd::IInformationProvider > | MessagePtr |
| Shared pointer type for message objects. | |
Public Member Functions | |
| virtual bool | IsMessageSupported (int messageCategory=-1, int messageId=-1, const istd::IInformationProvider *messagePtr=NULL) const =0 |
| Check if a message is supported by this consumer. | |
| virtual void | AddMessage (const MessagePtr &messagePtr)=0 |
| Adds a message to this consumer. | |
Public Member Functions inherited from istd::IPolymorphic | |
| virtual | ~IPolymorphic () |
Common interface for a message container consuming information objects (messages).
This is the fundamental interface in the ilog library that all message consumers must implement. It provides a standardized way to check message support and add messages to the consumer.
The interface uses a shared pointer (MessagePtr) for message ownership, ensuring automatic memory management. Consumers can be chained together, filtered, or routed based on message properties.
Definition at line 47 of file IMessageConsumer.h.
Shared pointer type for message objects.
Definition at line 51 of file IMessageConsumer.h.
|
pure virtual |
Adds a message to this consumer.
This method transfers ownership of the message to the consumer via shared pointer. The consumer may store, display, forward, or otherwise process the message.
Most implementations deliver messages asynchronously using Qt signals/slots to ensure thread safety when messages are added from worker threads.
| messagePtr | Shared pointer to the message. After this call, the message is owned by the shared pointer and will be automatically deleted when no longer referenced. |
Implemented in ilog::CMessageContainer, ilog::CLogComp, ilog::CLogCompBase, ilog::TMessageDelegatorComp< BaseComponent >, ilog::TMessageDelegatorComp< icomp::CComponentBase >, iloggui::CLogGuiComp, iloggui::CMessageBoxComp, iqtgui::CGuiApplicationComp::TrayMessages, and iqtgui::CSplashScreenGuiComp.
|
pure virtual |
Check if a message is supported by this consumer.
This method allows consumers to filter messages based on category, ID, or the complete message object. It's used to determine whether a message should be sent to this consumer before actually adding it.
| messageCategory | Category of message (IC_NONE, IC_INFO, IC_WARNING, IC_ERROR, IC_CRITICAL) or -1 if category check should be skipped. |
| messageId | Numeric ID of message or -1 if ID check should be skipped. Message IDs are application-defined for filtering and routing. |
| messagePtr | Optional pointer to complete message object for detailed inspection, or NULL if not needed. The consumer will not store this pointer. |
Implemented in ilog::CLogComp, ilog::CMessageContainer, ilog::CStreamLogCompBase, ilog::TMessageDelegatorComp< BaseComponent >, ilog::TMessageDelegatorComp< icomp::CComponentBase >, iloggui::CLogGuiComp, iloggui::CMessageBoxComp, iqtgui::CGuiApplicationComp::TrayMessages, and iqtgui::CSplashScreenGuiComp.