allpix::LocalMessenger

Responsible for the actual handling of messages between Modules. More…

#include <Messenger.hpp>

Public Functions

Name
LocalMessenger(Messenger & global_messenger)
void dispatchMessage(Module * source, std::shared_ptr< BaseMessage > message, std::string name)
bool dispatchMessage(Module * source, const std::shared_ptr< BaseMessage > & message, const std::string & name, const std::string & id)
bool isSatisfied(BaseDelegate * delegate) const
Check if a delegate has received its message.
template <typename T >
std::shared_ptr< T >
fetchMessage(Module * module)
Fetches a single message of specified type meant for the calling module.
template <typename T >
std::vector< std::shared_ptr< T > >
fetchMultiMessage(Module * module)
Fetches multiple messages of specified type meant for the calling module.
std::vector< std::pair< std::shared_ptr< BaseMessage >, std::string > > fetchFilteredMessages(Module * module)
Fetches filtered messages meant for the calling module.

Detailed Description

class allpix::LocalMessenger;

Responsible for the actual handling of messages between Modules.

The local messenger is an internal object that is allocated for each thread separately. It handles dispatching and fetching messages between Modules.

Public Functions Documentation

function LocalMessenger

explicit LocalMessenger(
    Messenger & global_messenger
)

function dispatchMessage

void dispatchMessage(
    Module * source,
    std::shared_ptr< BaseMessage > message,
    std::string name
)

function dispatchMessage

bool dispatchMessage(
    Module * source,
    const std::shared_ptr< BaseMessage > & message,
    const std::string & name,
    const std::string & id
)

function isSatisfied

bool isSatisfied(
    BaseDelegate * delegate
) const

Check if a delegate has received its message.

Return: True if satisfied, false otherwise

function fetchMessage

template <typename T >
std::shared_ptr< T > fetchMessage(
    Module * module
)

Fetches a single message of specified type meant for the calling module.

Return: Shared pointer to message

function fetchMultiMessage

template <typename T >
std::vector< std::shared_ptr< T > > fetchMultiMessage(
    Module * module
)

Fetches multiple messages of specified type meant for the calling module.

Return: Vector of shared pointers to messages

function fetchFilteredMessages

std::vector< std::pair< std::shared_ptr< BaseMessage >, std::string > > fetchFilteredMessages(
    Module * module
)

Fetches filtered messages meant for the calling module.

Return: Vector of pairs containing shared pointer to and name of message


Updated on 2025-02-27 at 14:14:45 +0000