GenericSyncPublisher

template<typename ...FunctionArgs>
class kanzi::connect::GenericSyncPublisher

Generic publisher which can be used to notify several observers. The observer callback arguments are template arguments.

Public Functions

GenericSyncPublisher() = default

ctor

~GenericSyncPublisher() = default

dtor

void publish(FunctionArgs... args)

Publish an event to all subscribed observers.

bool subscribe(GenericSyncObserver<FunctionArgs...> &observer)

Subscribe to the publisher events.

Parameters
  • observer: The instance which will receive notifications in future

bool unsubscribe(GenericSyncObserver<FunctionArgs...> &observer)

Unsubscribe from publisher events.

Parameters
  • observer: The instance that will no longer receive notifications