Helper class to receive notifications within a single thread. More...
#include "api/polling_notification_sink.h"
Public Types | |
typedef std::unordered_map < string, CCommandSource > | changed_endpoint_map |
Public Member Functions | |
void | get_changed_endpoints (changed_endpoint_map &changed_endpoints) |
Polling function. More... | |
Helper class to receive notifications within a single thread.
CPollingNotificationSink is a helper class for users who wish to receive notifications about changed endpoints within a single thread, for example in an event-driven gui application.
To use it, create an instance of CPollingNotificationSink, and pass a pointer to it via CServerStartupInfo into CIntegraSession::start_session.
To receive notifications about changed endpoints, users should repeatedly call get_changed_endpoints. The method will return the set of endpoints which have been set since the method was last called, mapped to the command source for each set command.
typedef std::unordered_map<string, CCommandSource> integra_api::CPollingNotificationSink::changed_endpoint_map |
Map string-representation of endpoint path to CCommandSource
void integra_api::CPollingNotificationSink::get_changed_endpoints | ( | changed_endpoint_map & | changed_endpoints | ) |
Polling function.
/param[out] changed_endpoints This map will be populated with the paths of all control endpoints which have been set since the polling function was last called. Each map entry also stores the CCommandSource relating to why the endpoint was set.