nebula::comm::proxy::DataProvider
class nebula::comm::proxy::DataProvider
Base class for entities (services) which can provide event data. One example for runtime data provider are service proxy instances. The advantage of this DataProvider
is that, they provide access to service events by name. Service proxy instances can be wrapped to support data provider interfaces. To make application development easier, normally when service proxy code is generated, corresponding DataProvider
implementation code is also generated. Please refer the generated source folder for using the generated DataProvider
. This class defines basic functionality that derived services should implement.
Members
public void
start
()
Initialize and start the service proxy. Normally this involves proxy creation and finding the corresponding service. This method will be overridden in generated code with actual implementation.
Implementing class should make sure that, after this function return, events can be subscribed
public void
subscribeElement
(std::string & name, std::function< void(const std::string &)> notifier)
Subscribe to an event by name. On successful subscription, new events are notified by invoking notifier asynchronously. This method will be overridden in generated code with actual implementation.
- Parameters
name
Name of the event to be subscribednotifier
Event notifier callback. The callback should have the syntaxvoid(const std::string&)
. The string parameter passed in the name of event
public inline static const std::string
getServiceName
()
Get the name of Service exposed. This method will be overridden in generated code with actual implementation.
- Returns const std::string Service name