|
ACF $AcfVersion:0$
|
Base implementation for logging components using Qt event queue. More...
#include <CLogCompBase.h>
Public Types | |
| typedef ilog::TMessageDelegatorComp< icomp::CComponentBase > | BaseClass |
| Base class typedef for component functionality. | |
| typedef QObject | BaseClass2 |
| Base class typedef for QObject functionality. | |
Signals | |
| void | EmitAddMessage (const MessagePtr &messagePtr) |
| Signal emitted when a message is added. | |
Public Member Functions | |
| CLogCompBase () | |
| Default constructor. | |
| virtual void | AddMessage (const MessagePtr &messagePtr) override |
| Add a message to this log component. | |
Public Member Functions inherited from icomp::CComponentBase | |
| CComponentBase () | |
| Create component and assign it to specific context. | |
| virtual const icomp::IComponent * | GetParentComponent (bool ownerOnly=false) const override |
| Get parent of this component. | |
| virtual void * | GetInterface (const istd::CClassInfo &interfaceType, const QByteArray &subId="") override |
| Get access to specified component interface. | |
| virtual IComponentContextSharedPtr | GetComponentContext () const override |
| Get access to component context describing all application-specified component information loaded from components registry. | |
| virtual void | SetComponentContext (const IComponentContextSharedPtr &contextPtr, const icomp::IComponent *parentPtr, bool isParentOwner) override |
| Set component context of this component. | |
Public Member Functions inherited from istd::IPolymorphic | |
| virtual | ~IPolymorphic () |
Protected Member Functions | |
| virtual void | WriteMessageToLog (const MessagePtr &messagePtr)=0 |
| Abstract method called to process a message. | |
Protected Member Functions inherited from icomp::CComponentBase | |
| bool | IsComponentActive () const |
| Check if component is active. | |
| virtual void | OnComponentCreated () |
| virtual void | OnComponentDestroyed () |
| virtual const icomp::IRealComponentStaticInfo & | GetComponentStaticInfo () const =0 |
| Get access to static info of this component. | |
Additional Inherited Members | |
Static Protected Member Functions inherited from icomp::CComponentBase | |
| static const icomp::IRealComponentStaticInfo & | InitStaticInfo (IComponent *componentPtr) |
| static QByteArray | GetComponentId (const icomp::IComponentContext *componentContextPtr, const QByteArray &contextId=QByteArray()) |
Base implementation for logging components using Qt event queue.
CLogCompBase provides thread-safe message delivery by using Qt signals and slots to transport messages between threads. When AddMessage() is called (potentially from a worker thread), it emits a signal that's delivered on the component's thread where WriteMessageToLog() is called.
This class combines QObject (for signals/slots) with TMessageDelegatorComp to provide both thread-safe message handling and message delegation capabilities.
Derived classes must implement WriteMessageToLog() to define what happens to messages when they arrive.
Definition at line 73 of file CLogCompBase.h.
Base class typedef for component functionality.
Definition at line 80 of file CLogCompBase.h.
| typedef QObject ilog::CLogCompBase::BaseClass2 |
Base class typedef for QObject functionality.
Definition at line 83 of file CLogCompBase.h.
| ilog::CLogCompBase::CLogCompBase | ( | ) |
Default constructor.
Connects the EmitAddMessage signal to OnAddMessage slot for thread-safe message delivery.
|
overridevirtual |
Add a message to this log component.
Thread-safe method that can be called from any thread. Emits EmitAddMessage signal which is delivered on the component's thread where OnAddMessage slot processes it.
| messagePtr | Shared pointer to message to log |
Reimplemented from ilog::TMessageDelegatorComp< icomp::CComponentBase >.
Reimplemented in ilog::CLogComp.
|
signal |
Signal emitted when a message is added.
This signal provides thread-safe message delivery. When AddMessage() is called from any thread, this signal is emitted and Qt delivers it to the OnAddMessage slot on the component's thread.
| messagePtr | Shared pointer to message being added |
|
protectedpure virtual |
Abstract method called to process a message.
Derived classes must implement this to define message handling behavior. This is always called on the component's thread, regardless of which thread called AddMessage().
| messagePtr | Shared pointer to message to process |
Implemented in ilog::CLogComp, and ilog::CStreamLogCompBase.