ACF $AcfVersion:0$
Public Member Functions | List of all members
iqtgui::CGuiApplicationComp::TrayMessages Class Reference

#include <CGuiApplicationComp.h>

Inheritance diagram for iqtgui::CGuiApplicationComp::TrayMessages:
ilog::IMessageConsumer istd::IPolymorphic

Public Member Functions

 TrayMessages (CGuiApplicationComp &parent)
 
virtual bool IsMessageSupported (int messageCategory=-1, int messageId=-1, const istd::IInformationProvider *messagePtr=NULL) const override
 Check if a message is supported by this consumer.
 
virtual void AddMessage (const MessagePtr &messagePtr) override
 Adds a message to this consumer.
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Additional Inherited Members

- Public Types inherited from ilog::IMessageConsumer
typedef istd::TSharedInterfacePtr< istd::IInformationProviderMessagePtr
 Shared pointer type for message objects.
 

Detailed Description

Definition at line 99 of file CGuiApplicationComp.h.

Constructor & Destructor Documentation

◆ TrayMessages()

iqtgui::CGuiApplicationComp::TrayMessages::TrayMessages ( CGuiApplicationComp parent)
explicit

Member Function Documentation

◆ AddMessage()

virtual void iqtgui::CGuiApplicationComp::TrayMessages::AddMessage ( const MessagePtr messagePtr)
overridevirtual

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.

Parameters
messagePtrShared pointer to the message. After this call, the message is owned by the shared pointer and will be automatically deleted when no longer referenced.
Note
This method should not throw exceptions. Implementations should handle errors gracefully (e.g., by logging internally or ignoring invalid messages).
Warning
The message object should not be modified after being added to a consumer, as multiple consumers may reference the same message object.
Example
// Create message with shared pointer
2001,
"File not found: config.xml",
"ConfigLoader"
)
);
// Add to consumer (ownership transferred)
consumer->AddMessage(msg);
// msg can still be used as shared pointer maintains reference count
// but don't modify the message after adding it
Basic implementation of the istd::IInformationProvider interface for log messages.
Definition CMessage.h:80
@ IC_ERROR
Information about error, processing could not be done correctly.
Shared ownership smart pointer for interface types.
See also
IsMessageSupported()

Implements ilog::IMessageConsumer.

◆ IsMessageSupported()

virtual bool iqtgui::CGuiApplicationComp::TrayMessages::IsMessageSupported ( int  messageCategory = -1,
int  messageId = -1,
const istd::IInformationProvider messagePtr = NULL 
) const
overridevirtual

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.

Parameters
messageCategoryCategory of message (IC_NONE, IC_INFO, IC_WARNING, IC_ERROR, IC_CRITICAL) or -1 if category check should be skipped.
See also
istd::IInformationProvider::InformationCategory.
Parameters
messageIdNumeric ID of message or -1 if ID check should be skipped. Message IDs are application-defined for filtering and routing.
messagePtrOptional pointer to complete message object for detailed inspection, or NULL if not needed. The consumer will not store this pointer.
Returns
true if the message is supported and should be sent to this consumer, false if the message should be filtered out.
Note
Returning false does not indicate an error; it simply means the message doesn't match the consumer's filter criteria.
Example
// Check if consumer accepts warnings
if (consumer->IsMessageSupported(istd::IInformationProvider::IC_WARNING)) {
// Consumer accepts warnings
}
// Check specific message ID
if (consumer->IsMessageSupported(-1, 5001)) {
// Consumer accepts message ID 5001
}
// Check complete message
if (consumer->IsMessageSupported(-1, -1, &msg)) {
// Consumer accepts this specific message
}
@ IC_INFO
Normal information level.
@ IC_WARNING
Information about warning, processing could be done.

Implements ilog::IMessageConsumer.


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