Abstract interface providing I/O and additional subscription facilities for a repository.
More...
|
| | RepositorySubscriberIf ()=default |
| |
| template<typename T = void, typename F> |
| Subscription | Subscribe (const DataPointPath &path, const F &cb_value, const ErrorCallbackType &cb_error) const |
| | Subscribes to datapoint values change events by registering callbacks.
|
| |
| Subscription | Subscribe (const CallbackType &cb_created, const CallbackType &cb_deleted, const ErrorCallbackType &cb_error) const |
| | Subscribes to datapoint creation and deletion events by registering callbacks.
|
| |
| | RepositoryIf ()=default |
| |
| virtual | ~RepositoryIf ()=default |
| |
| BatchResponse | SendRequest (const BatchRequest &request) |
| |
| BatchResponse | SendRequest (const BatchRequest &request) const |
| |
| template<typename T> |
| void | CreateDataPoint (const DataPointPath &path) |
| | Creates a new empty datapoint in the repository.
|
| |
| template<typename T> |
| void | CreateDataPoint (const DataPointPath &path, const T &initial_value) |
| | Creates a new datapoint in the repository with an initial value.
|
| |
| void | CreateDataPoint (const DataPointPath &path, const char *initial_value) |
| |
| void | DeleteDataPoint (const DataPointPath &path, bool recurse=false) |
| | Deletes a datapoint.
|
| |
| const std::type_info & | GetDataPointType (const DataPointPath &path) const |
| | Fetches the type of the datapoint.
|
| |
| size_t | GetDataPointSize (const DataPointPath &path) const |
| | Fetches the size of the datapoint's data.
|
| |
| RtcVectorUInt64 | GetDataPointShape (const DataPointPath &path) const |
| | Fetches the shape of the datapoint's data.
|
| |
| bool | DataPointExists (const DataPointPath &path) const |
| | Checks for the existence of a datapoint in the repository.
|
| |
| std::pair< PathList, PathList > | GetChildren (const DataPointPath &path, bool recurse=false) const |
| | Queries the child datapoints and paths for a given parent path.
|
| |
| template<typename T> |
| T | GetDataPoint (const DataPointPath &path) const |
| | Fetches a datapoint from the repository.
|
| |
| template<typename T> |
| std::optional< T > | TryGetDataPoint (const DataPointPath &path) const |
| | Fetches a datapoint from the repository.
|
| |
| template<typename T> |
| void | SetDataPoint (const DataPointPath &path, const T &value) |
| | Sets a datapoint in the repository.
|
| |
| void | SetDataPoint (const DataPointPath &path, const char *value) |
| |
| template<typename T> |
| void | ReadDataPoint (const DataPointPath &path, T &buffer) const |
| | Reads a datapoint from the repository.
|
| |
| template<typename T> |
| void | WriteDataPoint (const DataPointPath &path, const T &buffer) |
| | Writes a datapoint to the repository.
|
| |
| void | WriteDataPoint (const DataPointPath &path, const char *buffer) |
| |
| template<typename... T> |
| void | WriteDataPoints (const T &... args) |
| |
| template<typename... T> |
| void | ReadDataPoints (T &... args) const |
| |
Abstract interface providing I/O and additional subscription facilities for a repository.
- Thread Safety
- thread-safe
template<typename T, typename F>
Subscribes to datapoint values change events by registering callbacks.
This is a convenience function that can be used to register a callback function that will be called whenever a datapoint value change notification is received and a new value is available. Either a notification only callback, or a callback that also receives the value can be registered. In the second case, a new buffer object will be allocated by the API and filled with the new value for every new value notification. This buffer is then passed onto the registered callback by reference, since the ownership of the memory for the buffer remains with the API.
- Note
- This is a synchronous method that blocks until the registration has been completed for the datapoint.
- Template Parameters
-
| T | The datapoint type. |
| F | The type of the cb_value callback function. It can be any callable that has a function signature compatible with:
This class provides a wrapper for a data point path. Definition dataPointPath.hpp:77
or |
- Parameters
-
| [in] | path | The path of the datapoint to subscribe to. |
| [in] | cb_value | A handler function, lambda or functional to invoke after a new datapoint value is received. |
| [in] | cb_error | A functional to invoke after a subscription error was detected. |
- Returns
- A moveable subscription object that controls the life-time of the subscription.
- Thread Safety
- thread-safe
- Exception Safety
- basic