|
Zserio C++ runtime library
1.3.0
Built for Zserio 2.18.0
|
#include <IPubsub.h>
Classes | |
| class | OnTopicCallback |
Public Types | |
| using | SubscriptionId = size_t |
Public Member Functions | |
| virtual | ~IPubsub ()=default |
| virtual void | publish (StringView topic, Span< const uint8_t > data, void *context)=0 |
| virtual SubscriptionId | subscribe (StringView topic, const std::shared_ptr< OnTopicCallback > &callback, void *context)=0 |
| virtual void | unsubscribe (SubscriptionId id)=0 |
| using zserio::IPubsub::SubscriptionId = size_t |
|
virtualdefault |
|
pure virtual |
Publishes given data as a specified topic.
| topic | Topic definition. |
| data | Data to publish. |
| context | Context specific for a particular Pub/Sub implementation. |
| PubsubException | when publishing fails. |
|
pure virtual |
Subscribes a topic.
| topic | Topic definition to subscribe. Note that the definition format depends on the particular Pub/Sub backend implementation and therefore e.g. wildcards can be used only if they are supported by Pub/Sub backend. |
| callback | Callback to be called when a message with the specified topic arrives. |
| context | Context specific for a particular Pub/Sub implementation. |
| PubsubException | when subscribing fails. |
|
pure virtual |
Unsubscribes the subscription with the given ID.
| id | ID of the subscription to be unsubscribed. |
| PubsubException | when unsubscribing fails. |