ACF $AcfVersion:0$
Public Types | Protected Member Functions | List of all members
ilog::CLogRouterComp Class Reference

Component that routes messages from one container to another with filtering. More...

#include <CLogRouterComp.h>

Inheritance diagram for ilog::CLogRouterComp:
icomp::CComponentBase imod::CSingleModelObserverBase icomp::IComponent imod::IObserver istd::IPolymorphic istd::IPolymorphic

Public Types

typedef icomp::CComponentBase BaseClass
 Base class typedef for component functionality.
 
typedef imod::CSingleModelObserverBase BaseClass2
 Base class typedef for observer functionality.
 
- Public Types inherited from imod::CSingleModelObserverBase
typedef imod::IModel ModelType
 

Protected Member Functions

virtual void OnComponentCreated () override
 
virtual void OnComponentDestroyed () override
 
virtual void OnUpdate (const istd::IChangeable::ChangeSet &changeSet) override
 Called on update of observed model.
 
- Protected Member Functions inherited from icomp::CComponentBase
bool IsComponentActive () const
 Check if component is active.
 
virtual const icomp::IRealComponentStaticInfoGetComponentStaticInfo () const =0
 Get access to static info of this component.
 
- Protected Member Functions inherited from imod::CSingleModelObserverBase
void SetModelPtr (imod::IModel *modelPtr)
 Set internal model pointer to specified value.
 

Additional Inherited Members

- Public Member Functions inherited from icomp::CComponentBase
 CComponentBase ()
 Create component and assign it to specific context.
 
virtual const icomp::IComponentGetParentComponent (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 ()
 
- Public Member Functions inherited from imod::CSingleModelObserverBase
 CSingleModelObserverBase ()
 
virtual ~CSingleModelObserverBase ()
 
imod::IModelGetObservedModel () const
 Get access to observed model.
 
imod::IModelGetModelPtr () const
 Get access to observed model.
 
void EnsureModelDetached ()
 Make sure this observer is detached.
 
void SetObservedIds (const istd::IChangeable::ChangeSet &changeMask)
 Set list of ID's beeing observed.
 
virtual bool IsModelAttached (const imod::IModel *modelPtr=NULL) const override
 Checks if the specified model is currently attached to this observer.
 
virtual bool OnModelAttached (imod::IModel *modelPtr, istd::IChangeable::ChangeSet &changeMask) override
 Callback invoked when an observable model is about to be attached to this observer.
 
virtual bool OnModelDetached (imod::IModel *modelPtr) override
 Callback invoked when an observable model is about to be detached from this observer.
 
virtual void BeforeUpdate (imod::IModel *modelPtr) override
 Callback invoked before an update of the observer's content occurs.
 
virtual void AfterUpdate (imod::IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet) override
 Callback invoked after an update of the observer's content occurs.
 
- Static Protected Member Functions inherited from icomp::CComponentBase
static const icomp::IRealComponentStaticInfoInitStaticInfo (IComponent *componentPtr)
 
static QByteArray GetComponentId (const icomp::IComponentContext *componentContextPtr, const QByteArray &contextId=QByteArray())
 
- Static Protected Attributes inherited from imod::CSingleModelObserverBase
static const istd::IChangeable::ChangeSet s_undoChanges
 

Detailed Description

Component that routes messages from one container to another with filtering.

CLogRouterComp observes a source message container and automatically forwards new messages to an output message consumer. It can filter messages by minimum severity level, and prevents duplicate forwarding by tracking already-processed messages.

This component is useful for:

Features
  • Automatic message forwarding when source container changes
  • Severity-based filtering (forward only messages >= minimum category)
  • Duplicate detection (won't forward same message twice)
  • Model-observer integration for reactive updates
  • Component-based configuration
Configuration
Component references:

Component attributes:

Usage Example
// Create source and destination
// Create router
// Configure via .acc:
// InputMessageContainer -> mainLog
// OutputMessageConsumer -> errorLog
// MinimalCategory -> 3 (errors and critical)
// Add messages to main log
mainLog->AddMessage(infoMsg); // Not forwarded
mainLog->AddMessage(errorMsg); // Forwarded to errorLog
mainLog->AddMessage(criticalMsg);// Forwarded to errorLog
Complete logging component with message storage and container interface.
Definition CLogComp.h:86
Component that routes messages from one container to another with filtering.
Shared ownership smart pointer for interface types.
Component Configuration
<Component Id="ErrorRouter" Class="ilog::CLogRouterComp">
<Reference Id="InputMessageContainer" Value="MainLog"/>
<Reference Id="OutputMessageConsumer" Value="ErrorLog"/>
<Attribute Id="MinimalCategory" Value="3"/>
</Component>
See also
ilog::IMessageContainer, ilog::IMessageConsumer, imod::IObserver

Definition at line 80 of file CLogRouterComp.h.

Member Typedef Documentation

◆ BaseClass

Base class typedef for component functionality.

Definition at line 86 of file CLogRouterComp.h.

◆ BaseClass2

Base class typedef for observer functionality.

Definition at line 89 of file CLogRouterComp.h.

Member Function Documentation

◆ OnComponentCreated()

virtual void ilog::CLogRouterComp::OnComponentCreated ( )
overrideprotectedvirtual

Reimplemented from icomp::CComponentBase.

◆ OnComponentDestroyed()

virtual void ilog::CLogRouterComp::OnComponentDestroyed ( )
overrideprotectedvirtual

Reimplemented from icomp::CComponentBase.

◆ OnUpdate()

virtual void ilog::CLogRouterComp::OnUpdate ( const istd::IChangeable::ChangeSet changeSet)
overrideprotectedvirtual

Called on update of observed model.

This method is designed to be overload by derrived classes.

Reimplemented from imod::CSingleModelObserverBase.


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