Skip to content

sgns::watcher::MessagingWatcher

#include <messaging_watcher.hpp>

Inherited by sgns::evmwatcher::EvmMessagingWatcher

Public Types

Name
using std::function< void(const std::string &)> MessageCallback

Public Functions

Name
virtual ~MessagingWatcher() =default
virtual void startWatching()
virtual void stopWatching()
bool isRunning() const
void addWatcher(const std::shared_ptr< MessagingWatcher > & newWatcher)
void startAll()
void stopAll()

Protected Functions

Name
MessagingWatcher(MessageCallback callback)
virtual void watch()

Protected Attributes

Name
MessageCallback messageCallback
bool running
std::mutex running_mutex
boost::thread watcherThread

Public Types Documentation

using MessageCallback

using sgns::watcher::MessagingWatcher::MessageCallback = std::function<void(const std::string &)>;

Public Functions Documentation

function ~MessagingWatcher

virtual ~MessagingWatcher() =default

function startWatching

virtual void startWatching()

Reimplemented by: sgns::evmwatcher::EvmMessagingWatcher::startWatching

function stopWatching

virtual void stopWatching()

Reimplemented by: sgns::evmwatcher::EvmMessagingWatcher::stopWatching

function isRunning

bool isRunning() const

function addWatcher

static void addWatcher(
    const std::shared_ptr< MessagingWatcher > & newWatcher
)

function startAll

static void startAll()

function stopAll

static void stopAll()

Protected Functions Documentation

function MessagingWatcher

explicit MessagingWatcher(
    MessageCallback callback
)

function watch

virtual void watch()

Protected Attributes Documentation

variable messageCallback

MessageCallback messageCallback;

variable running

bool running;

variable running_mutex

std::mutex running_mutex;

variable watcherThread

boost::thread watcherThread;

Updated on 2026-03-04 at 13:10:44 -0800