|
RTC Toolkit 5.1.0
|
Implementation of the Runtime Configuration Repository backed by the OLDB. More...
#include <rtctk/componentFramework/runtimeRepoAdapterLegacy.hpp>
Public Member Functions | |
| RuntimeRepoAdapterLegacy ()=delete | |
| Do not allow construction with no arguments. | |
| RuntimeRepoAdapterLegacy (const RuntimeRepoAdapterLegacy &)=delete | |
| This class cannot be copy constructed. | |
| RuntimeRepoAdapterLegacy & | operator= (const RuntimeRepoAdapterLegacy &)=delete |
| This class cannot be copy assigned. | |
| RuntimeRepoAdapterLegacy (RuntimeRepoAdapterLegacy &&)=default | |
| Objects of this class can be moved. | |
| RuntimeRepoAdapterLegacy & | operator= (RuntimeRepoAdapterLegacy &&)=default |
| Objects of this class can be moved with the move assignment operator. | |
| RuntimeRepoAdapterLegacy (const elt::mal::Uri &baseuri) | |
| Constructs an adapter for the Runtime Configuration Repository service using the OLDB backend. | |
| RuntimeRepoAdapterLegacy (const elt::mal::Uri &baseuri, const std::shared_ptr< elt::oldb::CiiOldb > &oldb) | |
| Constructs an adapter for the Runtime Configuration Repository service with a specific OLDB API interface. | |
| virtual | ~RuntimeRepoAdapterLegacy ()=default |
| void | CreateDataPoint (const DataPointPath &path, const std::type_info &type) override |
| Creates a new datapoint in the currently set external Redis server. | |
| void | CreateDataPoint (const DataPointPath &path, const std::type_info &type, const std::string &server_alias) override |
| Creates a new datapoint in the repository with a specified type on a particular external Redis server. | |
| std::string | GetServerAlias (const DataPointPath &path) const override |
| Fetches the server alias for a specific datapoint. | |
| virtual void | CreateDataPoint (const DataPointPath &path, const std::type_info &type, const std::string &server_alias) |
| Creates a new datapoint in the repository with a specified type on a particular external Redis server. | |
| template<typename T > | |
| void | CreateDataPoint (const DataPointPath &path, const T default_value, const std::string &server_alias) |
| Creates a new datapoint in the repository with a default value on a particular external Redis server. | |
Public Member Functions inherited from rtctk::componentFramework::RuntimeRepoIf | |
| virtual | ~RuntimeRepoIf ()=default |
| std::string | GetDefaultServerAlias () const |
| Get the current default server alias setting. | |
| void | SetDefaultServerAlias (const std::string &server_alias) |
| Set the current default server alias setting. | |
| template<typename T > | |
| void | CreateDataPoint (const DataPointPath &path, const T default_value, const std::string &server_alias) |
| Creates a new datapoint in the repository with a default value on a particular external Redis server. | |
| template<typename T > | |
| void | CreateDataPoint (const DataPointPath &path) |
| Creates a new 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) |
| virtual void | CreateDataPoint (const DataPointPath &path, const std::type_info &type) |
| Creates a new datapoint in the repository with a specified type. | |
Public Member Functions inherited from rtctk::componentFramework::RepositorySubscriberIf | |
| RepositorySubscriberIf ()=default | |
| virtual | ~RepositorySubscriberIf ()=default |
| template<typename T = void, typename F , std::enable_if_t< std::is_convertible_v< F, NotifyCallbackType > or(not std::is_same_v< T, void > and std::is_convertible_v< F, ValueCallbackType< std::conditional_t< std::is_same_v< T, void >, std::byte, T > > >), bool > = true> | |
| 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. | |
| template<typename T , typename F , std::enable_if_t< not std::is_convertible_v< T, RepositorySubscriberIf::NotifyCallbackType >, bool > = true> | |
| void | Subscribe (const DataPointPath &path, T &buffer, F handler) const |
| A convenience template function that will register a callback to receive new datapoint values in a synchronous manner. | |
| template<typename F > | |
| void | Subscribe (const DataPointPath &path, F handler) const |
| A convenience template function that will register a callback to receive datapoint value change notifications in a synchronous manner. | |
| void | Unsubscribe (const DataPointPath &path) const |
| A simple convenience function that will deregister all callbacks for receiving new datapoint values. | |
Public Member Functions inherited from rtctk::componentFramework::RepositoryIf | |
| 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 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 > | |
| 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 |
Public Member Functions inherited from rtctk::componentFramework::OldbAdapterLegacy | |
| OldbAdapterLegacy ()=delete | |
| Do not allow construction with no arguments. | |
| OldbAdapterLegacy (const OldbAdapterLegacy &)=delete | |
| This class cannot be copy constructed. | |
| OldbAdapterLegacy & | operator= (const OldbAdapterLegacy &)=delete |
| This class cannot be copy assigned. | |
| OldbAdapterLegacy (OldbAdapterLegacy &&)=default | |
| Objects of this class can be moved. | |
| OldbAdapterLegacy & | operator= (OldbAdapterLegacy &&)=default |
| Objects of this class can be moved with the move assignment operator. | |
| OldbAdapterLegacy (const elt::mal::Uri &baseuri) | |
| Constructs an adapter for the OLDB service with the default OLDB API interface. | |
| OldbAdapterLegacy (const elt::mal::Uri &baseuri, const std::shared_ptr< elt::oldb::CiiOldb > &oldb) | |
| Constructs an adapter for the OLDB service with a specific OLDB API interface. | |
| virtual | ~OldbAdapterLegacy () |
| Destroys the adapter for the OLDB service releasing allocated resources. | |
| elt::mal::Uri | GetBaseUri () const |
| Get the base URI used when creating this adapter object. | |
| Response | SendReadRequest (const ReadRequest &request) const override |
| Sends a request to read data from the repository. | |
| Response | SendWriteRequest (const WriteRequest &request) override |
| Sends a request to write data to the repository. | |
| Response | SendSubscribeRequest (const SubscribeRequest &request) const override |
| This is called to asynchronously send a subscription request for datapoints. | |
| Response | SendUnsubscribeRequest (const UnsubscribeRequest &request) const override |
| This is called to asynchronously send a request to unsubscribe from various notifications. | |
| template<typename T , typename U > | |
| void | CastAndRegisterSubscription (const SubscribeRequest::Parameters ¶ms, const std::shared_ptr< CiiOldbTypedDataBase > &datapoint, std::function< void(T *, const std::shared_ptr< CiiOldbDpValue< U > > &)> write_function) const |
| template<typename T > | |
| Lut::TableEntries | BindTypeHandlers () |
| template<typename T > | |
| void | CreateDataPoint (const DataPointPath &path) |
| Creates a new 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) |
Public Member Functions inherited from rtctk::componentFramework::OldbIf | |
| virtual | ~OldbIf ()=default |
Static Public Member Functions | |
| static void | InitMetadata () |
| Initialises the type metadata in the CII configuration service for the Runtime Configuration Repository. | |
Static Public Member Functions inherited from rtctk::componentFramework::RuntimeRepoIf | |
| static std::unique_ptr< RuntimeRepoIf > | CreateAdapter (const elt::mal::Uri &uri) |
| Factory method used to create the appropriate Runtime Configuration Repository adapter depending on the URI scheme. | |
Static Public Member Functions inherited from rtctk::componentFramework::RepositoryIf | |
| static const std::type_info & | StringToType (const std::string &arg) |
| Converts an RTC type string to a type_info. | |
| static std::string | TypeToString (const std::type_info &arg) |
| Converts a type_info to an RTC type string. | |
Static Public Member Functions inherited from rtctk::componentFramework::OldbAdapterLegacy | |
| static void | InitMetadata () |
| Initialises the type metadata in the CII configuration service for the OLDB. | |
Static Public Member Functions inherited from rtctk::componentFramework::OldbIf | |
| static std::unique_ptr< OldbIf > | CreateAdapter (const elt::mal::Uri &uri) |
| Factory method used to create the appropriate OLDB adapter depending on the URI scheme. | |
Static Public Attributes | |
| static const std::string | SUPPORTED_URI_SCHEME = "cii.oldb" |
Static Public Attributes inherited from rtctk::componentFramework::OldbAdapterLegacy | |
| static const std::string | SUPPORTED_URI_SCHEME = "cii.oldb.legacy" |
Additional Inherited Members | |
Public Types inherited from rtctk::componentFramework::RuntimeRepoIf | |
| using | AdapterIdType = elt::mal::Uri |
| The type used to distinguish between different adapters implementing RuntimeRepoIf. | |
Public Types inherited from rtctk::componentFramework::RepositorySubscriberIf | |
| template<typename T > | |
| using | ValueCallbackType = std::function<void(const DataPointPath&, T&, const MetaData&)> |
| using | NotifyCallbackType = std::function<void(const DataPointPath&, const MetaData&)> |
| using | ErrorCallbackType = std::function<void(std::exception_ptr)> |
| using | SubscriptionId = size_t |
Public Types inherited from rtctk::componentFramework::RepositoryIf | |
| using | PathList = std::vector<DataPointPath> |
| using | Clock = taiclock::TaiClock |
| using | Timestamp = Clock::time_point |
| using | CallbackType = std::function<void(const DataPointPath&)> |
| Signature of the callback functions that can be registered with the repository requests. | |
Public Types inherited from rtctk::componentFramework::OldbIf | |
| using | AdapterIdType = elt::mal::Uri |
| The type used to distinguish between different adapters implementing OldbIf. | |
Protected Types inherited from rtctk::componentFramework::RepositoryIf | |
| using | RequestList = std::vector<std::any> |
Protected Member Functions inherited from rtctk::componentFramework::OldbAdapterLegacy | |
| void | DeleteDataPointLegacy (const DataPointPath &path) override |
| Deletes a datapoint in the OLDB. | |
| const std::type_info & | GetDataPointTypeLegacy (const DataPointPath &path) const override |
| Retrieves the corresponding C++ type for the datapoint from the OLDB. | |
| std::size_t | GetDataPointSizeLegacy (const DataPointPath &path) const override |
| Returns the size of a datapoint in the OLDB. | |
| bool | DataPointExistsLegacy (const DataPointPath &path) const override |
| Checks for the existence of a datapoint in the repository. | |
| std::pair< PathList, PathList > | GetChildrenLegacy (const DataPointPath &path) const override |
| Queries the datapoints and child paths for a given path. | |
| void | SetMetadataInstanceMap (const std::map< std::type_index, std::string > &map) |
| Sets the type_index to OLDB metadata instance name map. | |
| void | SetTypeInfoMap (const std::map< std::string, const std::type_info & > &map) |
| Sets the OLDB metadata instance name to type_info map. | |
| elt::oldb::CiiOldbDpCreateContext | GetDataPointCreateContext () const |
| Get the datapoint creation context used by the underlying OLDB client object. | |
| void | SetDataPointCreateContext (elt::oldb::CiiOldbDpCreateContext &context) |
| Sets a new datapoint creation context on the underlying OLDB client object. | |
Implementation of the Runtime Configuration Repository backed by the OLDB.
|
delete |
Do not allow construction with no arguments.
|
delete |
This class cannot be copy constructed.
|
default |
Objects of this class can be moved.
|
explicit |
Constructs an adapter for the Runtime Configuration Repository service using the OLDB backend.
| [in] | baseuri | The URI containing a base path where the datapoints are stored. The URI must use the cii.oldb scheme. |
|
explicit |
Constructs an adapter for the Runtime Configuration Repository service with a specific OLDB API interface.
| [in] | baseuri | The URI containing a base path where the datapoints are stored. The URI must use the cii.oldb scheme. |
| [in] | oldb | The OLDB API client object to use under the hood. |
|
virtualdefault |
|
overridevirtual |
Creates a new datapoint in the currently set external Redis server.
The external Redis server is identified by a server alias name. The current server alias to use when creating the new datapoint is configured with the SetServerAlias method. If no server alias was set then this method falls back to default datapoint creation in the central OLDB.
| [in] | path | The datapoint path that should be created. |
| [in] | type | A type identifier object returned by typeid indicating the type of the new datapoint. See RepositoryIf::CreateDataPoint for a list of supported types. |
Reimplemented from rtctk::componentFramework::RepositoryIf.
|
virtual |
Creates a new datapoint in the repository with a specified type on a particular external Redis server.
This version of the CreateDataPoint method ignores the default server alias setting and allows to explicitly give a server alias as an argument.
| [in] | path | The datapoint path that should be created. |
| [in] | type | A type identifier object returned by typeid indicating the type of the new datapoint. See RepositoryIf::CreateDataPoint for a list of supported types. |
| [in] | server_alias | The symbolic name of the external Redis server, as configured in CII OLDB, on which the datapoint is created. |
Reimplemented from rtctk::componentFramework::RuntimeRepoIf.
|
overridevirtual |
Creates a new datapoint in the repository with a specified type on a particular external Redis server.
This version of the CreateDataPoint method ignores the default server alias setting and allows to explicitly give a server alias as an argument.
| [in] | path | The datapoint path that should be created. |
| [in] | type | A type identifier object returned by typeid indicating the type of the new datapoint. See RepositoryIf::CreateDataPoint for a list of supported types. |
| [in] | server_alias | The symbolic name of the external Redis server, as configured in CII OLDB, on which the datapoint is created. |
Reimplemented from rtctk::componentFramework::RuntimeRepoIf.
| void rtctk::componentFramework::RuntimeRepoIf::CreateDataPoint | ( | const DataPointPath & | path, |
| const T | default_value, | ||
| const std::string & | server_alias ) |
Creates a new datapoint in the repository with a default value on a particular external Redis server.
This version of the CreateDataPoint method ignores the default server alias setting and allows to explicitly give a server alias as an argument.
| T | The type of the datapoint to create. See RepositoryIf::CreateDataPoint for a list of supported types. |
| [in] | path | The datapoint path that should be created. |
| [in] | default_value | The initial value to set the new datapoint to. |
| [in] | server_alias | The symbolic name of the external Redis server, as configured in CII OLDB, on which the datapoint is created. |
|
overridevirtual |
Fetches the server alias for a specific datapoint.
| [in] | path | The datapoint path to query. |
Reimplemented from rtctk::componentFramework::RuntimeRepoIf.
|
static |
Initialises the type metadata in the CII configuration service for the Runtime Configuration Repository.
Metadata related to various data types needs to be initialised in the CII configuration service before the RuntimeRepoAdapterLegacy can be used with the standard types supported by the RTC Toolkit. This function will initialise the needed metadata if it is missing. If the metadata for the types already exists then this function will reset it to the default initial values.
| InitialisationException | For any error that occurs in the CII system. |
|
delete |
This class cannot be copy assigned.
|
default |
Objects of this class can be moved with the move assignment operator.
|
inlinestatic |