Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
openlcb::EventService Class Reference

Global Event Service. More...

#include <EventService.hxx>

Inheritance diagram for openlcb::EventService:
Service

Classes

class  Impl
 PImpl class for the EventService. More...
 

Public Member Functions

 EventService (ExecutorBase *e)
 Creates a global event service with no interfaces registered.
 
 EventService (If *iface)
 Creates a global event service that runs on an interface's thread and registers the interface.
 
void register_interface (If *iface)
 Registers this global event handler with an interface.
 
Implimpl ()
 
bool event_processing_pending ()
 Returns true if there are outstanding events that are not yet handled.
 
- Public Member Functions inherited from Service
 Service (ExecutorBase *e)
 Constructor.
 
 ~Service ()
 Destructor.
 
ExecutorBaseexecutor ()
 

Static Public Attributes

static EventServiceinstance = nullptr
 

Private Attributes

std::unique_ptr< Implimpl_
 

Detailed Description

Global Event Service.

Registers itself with a specific interface to receive all incoming messages related to the OpenLCB Event Protocol, maintains the registry of event handlers, and routes the incoming messages to the event handlers based on the registration arguments.

Definition at line 67 of file EventService.hxx.

Constructor & Destructor Documentation

◆ EventService() [1/2]

openlcb::EventService::EventService ( ExecutorBase e)

Creates a global event service with no interfaces registered.

Definition at line 23 of file EventService.cxx.

◆ EventService() [2/2]

openlcb::EventService::EventService ( If iface)

Creates a global event service that runs on an interface's thread and registers the interface.

Definition at line 30 of file EventService.cxx.

◆ ~EventService()

openlcb::EventService::~EventService ( )

Definition at line 38 of file EventService.cxx.

Member Function Documentation

◆ event_processing_pending()

bool openlcb::EventService::event_processing_pending ( )

Returns true if there are outstanding events that are not yet handled.

Definition at line 107 of file EventService.cxx.

◆ impl()

Impl * openlcb::EventService::impl ( )
inline

Definition at line 82 of file EventService.hxx.

◆ register_interface()

void openlcb::EventService::register_interface ( If iface)

Registers this global event handler with an interface.

This operation will be undone in the destructor.

Definition at line 44 of file EventService.cxx.

Member Data Documentation

◆ impl_

std::unique_ptr<Impl> openlcb::EventService::impl_
private

Definition at line 94 of file EventService.hxx.

◆ instance

EventService * openlcb::EventService::instance = nullptr
static

Definition at line 91 of file EventService.hxx.


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