allpix::FilterAllDelegate
Module: Delegate classes
Delegate for invoking a filter listening to all messages also getting the name. More…
#include <delegates.h>
Inherits from allpix::ModuleDelegate< T >, allpix::BaseDelegate
Public Types
Name | |
---|---|
using bool(T::*)(const std::shared_ptr< BaseMessage > &, const std::string &) const | FilterFunction |
Public Functions
Name | |
---|---|
FilterAllDelegate(MsgFlags flags, T * obj, FilterFunction filter) Construct a filter delegate for the given module. |
|
virtual void | process(std::shared_ptr< BaseMessage > msg, std::string name, DelegateTypes & dest) override Calls the filter function with the supplied message. |
Additional inherited members
Public Functions inherited from allpix::ModuleDelegate< T >
Name | |
---|---|
ModuleDelegate(MsgFlags flags, T * obj) Construct a module delegate for the given module. |
|
virtual std::string | getUniqueName() override Get the unique name of the bound module. |
virtual std::shared_ptr< Detector > | getDetector() const override Get the detector bound to this module. |
Protected Attributes inherited from allpix::ModuleDelegate< T >
Name | |
---|---|
T *const | obj_ |
Public Functions inherited from allpix::BaseDelegate
Name | |
---|---|
BaseDelegate(const BaseDelegate & ) =delete Copying a delegate is not allowed. |
|
BaseDelegate & | operator=(const BaseDelegate & ) =delete Copying a delegate is not allowed. |
BaseDelegate(BaseDelegate && ) =default Enable default move behaviour. |
|
BaseDelegate & | operator=(BaseDelegate && ) =default Enable default move behaviour. |
BaseDelegate(MsgFlags flags) Construct a delegate with the supplied flags. |
|
virtual | ~BaseDelegate() =default Essential virtual destructor. |
bool | isRequired() const Check if delegate has a required message. |
MsgFlags | getFlags() const Get the flags for this delegate. |
virtual std::shared_ptr< Detector > | getDetector() const =0 Get the detector bound to a delegate. |
virtual std::string | getUniqueName() =0 Get the unique identifier for the bound object. |
Protected Attributes inherited from allpix::BaseDelegate
Name | |
---|---|
MsgFlags | flags_ |
Detailed Description
template <typename T >
class allpix::FilterAllDelegate;
Delegate for invoking a filter listening to all messages also getting the name.
Public Types Documentation
using FilterFunction
using allpix::FilterAllDelegate< T >::FilterFunction = bool (T::*)(const std::shared_ptr<BaseMessage>&, const std::string&) const;
Public Functions Documentation
function FilterAllDelegate
inline FilterAllDelegate(
MsgFlags flags,
T * obj,
FilterFunction filter
)
Construct a filter delegate for the given module.
Parameters:
- flags Messenger flags
- obj Module object this delegate should operate on
- filter A filter function receiving a shared_ptr to the message and its name, returning a boolean indicating the filter decision
function process
inline virtual void process(
std::shared_ptr< BaseMessage > msg,
std::string name,
DelegateTypes & dest
) override
Calls the filter function with the supplied message.
Parameters:
- msg Message to process
- name Name of the message
- dest Destination of the message
Warning: The filter function is called directly from the delegate, no heavy processing should be done in the filter function
Reimplements: allpix::BaseDelegate::process
Updated on 2024-12-13 at 08:31:37 +0000