Chi-Tech
chi::EventPublisher Class Reference

#include <EventPublisher.h>

Inheritance diagram for chi::EventPublisher:
chi::SystemWideEventPublisher chi_physics::PhysicsEventPublisher

Public Member Functions

virtual void PublishEvent (const chi::Event &event)
 
void AddSubscriber (std::shared_ptr< chi::EventSubscriber > &subscriber_sptr)
 
virtual ~EventPublisher ()=default
 

Protected Member Functions

 EventPublisher (const std::string &name)
 

Protected Attributes

const std::string publisher_name_
 
std::vector< std::weak_ptr< chi::EventSubscriber > > subscribers_
 

Detailed Description

Base class for event publishers.

Definition at line 18 of file EventPublisher.h.

Constructor & Destructor Documentation

◆ ~EventPublisher()

virtual chi::EventPublisher::~EventPublisher ( )
virtualdefault

◆ EventPublisher()

chi::EventPublisher::EventPublisher ( const std::string &  name)
explicitprotected

Definition at line 14 of file EventPublisher.cc.

Member Function Documentation

◆ AddSubscriber()

void chi::EventPublisher::AddSubscriber ( std::shared_ptr< chi::EventSubscriber > &  subscriber_sptr)

Adds a subscriber to the publisher.

Definition at line 32 of file EventPublisher.cc.

◆ PublishEvent()

void chi::EventPublisher::PublishEvent ( const chi::Event event)
virtual

Publish the given event.

Reimplemented in chi::SystemWideEventPublisher, and chi_physics::PhysicsEventPublisher.

Definition at line 18 of file EventPublisher.cc.

Field Documentation

◆ publisher_name_

const std::string chi::EventPublisher::publisher_name_
protected

Definition at line 32 of file EventPublisher.h.

◆ subscribers_

std::vector<std::weak_ptr<chi::EventSubscriber> > chi::EventPublisher::subscribers_
protected

Definition at line 33 of file EventPublisher.h.


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