#include <EventBus.h>
Local adapter that exposes a shared memory EventBus through IEventBus.
◆ EventBusView()
| lintel::EventBusView::EventBusView |
( |
EventBus & |
bus | ) |
|
|
inlineexplicit |
Construct a view around a shared memory bus.
- Parameters
-
| bus | the shared memory event bus |
◆ droppedEventsOf()
| std::uint64_t lintel::EventBusView::droppedEventsOf |
( |
| ) |
const |
|
inlineoverridevirtual |
- Returns
- the number of events that were dropped due to full queues
Implements lintel::IEventBus.
◆ getConfig()
◆ getName()
| const char * lintel::EventBusView::getName |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ isEmpty()
| bool lintel::EventBusView::isEmpty |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ isEmptyOf()
| bool lintel::EventBusView::isEmptyOf |
( |
const std::string & |
subscriber | ) |
const |
|
inlineoverridevirtual |
- Parameters
-
| subscriber | the subscriber name |
- Returns
- true if the subscriber queue is empty or unknown
Implements lintel::IEventBus.
◆ isLockFree()
| bool lintel::EventBusView::isLockFree |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ isSubscribed()
| bool lintel::EventBusView::isSubscribed |
( |
const std::string & |
topic, |
|
|
const std::string & |
subscriber |
|
) |
| const |
|
inlineoverridevirtual |
- Parameters
-
| topic | the topic name |
| subscriber | the subscriber name |
- Returns
- true if the subscriber is subscribed to the topic
Implements lintel::IEventBus.
◆ isTopicRegistered()
| bool lintel::EventBusView::isTopicRegistered |
( |
const std::string & |
topic | ) |
const |
|
inlineoverridevirtual |
◆ numberOfSubscribersOf()
| std::size_t lintel::EventBusView::numberOfSubscribersOf |
( |
const std::string & |
topic | ) |
const |
|
inlineoverridevirtual |
- Parameters
-
- Returns
- the number of subscribers of the topic
Implements lintel::IEventBus.
◆ publish()
Publish an event into the point-to-point bus queue.
- Parameters
-
| event | the event to publish |
- Returns
- false if the bus queue is full
Implements lintel::IEventBus.
◆ publishToSubscribers()
| bool lintel::EventBusView::publishToSubscribers |
( |
const Event & |
event | ) |
|
|
inlineoverridevirtual |
Publish an event to every subscriber of the event topic.
- Parameters
-
| event | the event to publish |
- Returns
- false if no subscriber received the event
Implements lintel::IEventBus.
◆ receive()
| std::optional< Event > lintel::EventBusView::receive |
( |
| ) |
|
|
inlineoverridevirtual |
Receive the next event from the point-to-point bus queue.
- Returns
- the event or std::nullopt if the queue is empty
Implements lintel::IEventBus.
◆ receiveOf()
| std::optional< Event > lintel::EventBusView::receiveOf |
( |
const std::string & |
subscriber | ) |
|
|
inlineoverridevirtual |
Receive the next event of a subscriber queue.
- Parameters
-
| subscriber | the subscriber name |
- Returns
- the event or std::nullopt if the queue is empty
Implements lintel::IEventBus.
◆ registerTopic()
| bool lintel::EventBusView::registerTopic |
( |
const std::string & |
topic | ) |
|
|
inlineoverridevirtual |
Register a topic on the bus (idempotent).
- Parameters
-
- Returns
- false if the topic table is full
Implements lintel::IEventBus.
◆ reset()
| void lintel::EventBusView::reset |
( |
| ) |
|
|
inlineoverridevirtual |
Drop all queued events on the bus and every subscriber queue.
Implements lintel::IEventBus.
◆ sequenceOf()
| std::int64_t lintel::EventBusView::sequenceOf |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ subscribe()
| bool lintel::EventBusView::subscribe |
( |
const std::string & |
topic, |
|
|
const std::string & |
subscriber |
|
) |
| |
|
inlineoverridevirtual |
Subscribe a named subscriber to a topic.
- Parameters
-
| topic | the topic name |
| subscriber | the subscriber name |
- Returns
- false if the topic does not exist or the table is full
Implements lintel::IEventBus.
◆ subscriberCount()
| std::size_t lintel::EventBusView::subscriberCount |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ topicCount()
| std::size_t lintel::EventBusView::topicCount |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ unsubscribe()
| bool lintel::EventBusView::unsubscribe |
( |
const std::string & |
topic, |
|
|
const std::string & |
subscriber |
|
) |
| |
|
inlineoverridevirtual |
Unsubscribe a named subscriber from a topic.
- Parameters
-
| topic | the topic name |
| subscriber | the subscriber name |
- Returns
- true if the subscriber was removed
Implements lintel::IEventBus.
The documentation for this class was generated from the following file:
- src/include/lintel/features/base/events/EventBus.h