|
RTC Toolkit 6.0.0-pre2
|
Implementation of a fake of OldbIf for testing. More...
#include <rtctk/componentFramework/test/fakeOldbIf.hpp>
Public Member Functions | |
| elt::mal::Uri | GetUri () const override |
| Get the URI used when creating this adapter object. | |
Public Member Functions inherited from rtctk::componentFramework::OldbIf | |
| ~OldbIf () override=default | |
Public Member Functions inherited from rtctk::componentFramework::RepositorySubscriberIf | |
| 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. | |
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 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 |
Additional Inherited Members | |
Public Types inherited from rtctk::componentFramework::OldbIf | |
| using | AdapterIdType = elt::mal::Uri |
| The type used to distinguish between different adapters implementing OldbIf. | |
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. | |
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 Member Functions inherited from rtctk::componentFramework::RepositoryIf | |
| static const std::type_info & | StringToType (const std::string &arg) |
| Converts an RTC datapoint type string to a type_info. | |
| static std::string | TypeToString (const std::type_info &arg) |
| Converts a type_info to an RTC datapoint type string. | |
| static std::any | MakeAnyBuffer (const MetaData &metadata) |
| Helper method to create an std::any buffer compatible with a specific datapoint. | |
Protected Types inherited from rtctk::componentFramework::RepositoryIf | |
| using | RequestList = std::vector<std::any> |
Protected Member Functions inherited from rtctk::componentFramework::test::FakeRepositorySubscriber | |
| template<typename T> | |
| void | CreateImpl (detail::CreateRequest< T > &req) |
| template<typename T> | |
| void | ReadImpl (detail::ReadRequest< T > &req) |
| template<typename T> | |
| void | WriteImpl (detail::WriteRequest< T > &req) |
| template<typename T> | |
| void | PartialReadImpl (detail::PartialReadRequest< T > &req) |
| template<typename T> | |
| void | PartialWriteImpl (detail::PartialWriteRequest< T > &req) |
| void | ReadMetaDataImpl (detail::ReadMetaDataRequest &req) |
| void | WriteMetaDataImpl (detail::WriteMetaDataRequest &req) |
| void | DeleteImpl (detail::DeleteRequest &req) |
| void | ExistsImpl (detail::ExistsRequest &req) |
| void | GetChildrenImpl (detail::GetChildrenRequest &req) |
| void | CreateLinkImpl (detail::CreateSymlinkRequest &req) |
| void | UpdateLinkImpl (detail::UpdateSymlinkRequest &req) |
| void | SubscribeImpl (detail::ValueSubscribeRequest &req) |
| void | CreateDeleteSubscribeImpl (detail::CreateDeleteSubscribeRequest &req) |
| void | UnsubscribeImpl (detail::UnsubscribeRequest &req) |
| Data & | GetDataNode (const DataPointPath &path) override |
| void | InvokeRequestHandler (std::any &request) override |
| void | InvokeCreateCallbacks (const DataPointPath &) |
| void | InvokeDeleteCallbacks (const DataPointPath &) |
| void | InvokeWriteCallbacks (const DataPointPath &) |
| bool | ShouldInvokeErrorCallbacks () |
| void | InvokeErrorCallbacks () |
| FakeRepositorySubscriber () | |
| ~FakeRepositorySubscriber () override=default | |
| template<typename T> | |
| Lut::TableEntries | BindTypeHandlers () |
Protected Member Functions inherited from rtctk::componentFramework::test::FakeRepository | |
| template<typename T> | |
| void | CreateImpl (detail::CreateRequest< T > &req) |
| template<typename T> | |
| void | ReadImpl (detail::ReadRequest< T > &req) |
| template<typename T> | |
| void | WriteImpl (detail::WriteRequest< T > &req) |
| template<typename T> | |
| void | PartialReadImpl (detail::PartialReadRequest< T > &req) |
| template<typename T> | |
| void | PartialWriteImpl (detail::PartialWriteRequest< T > &req) |
| void | ReadMetaDataImpl (detail::ReadMetaDataRequest &req) |
| void | WriteMetaDataImpl (detail::WriteMetaDataRequest &req) |
| void | DeleteImpl (detail::DeleteRequest &req) |
| void | ExistsImpl (detail::ExistsRequest &req) |
| std::pair< PathList, PathList > | GetChildrenImpl (const DataPointPath &path) |
| std::pair< PathList, PathList > | GetChildrenRecursive (const DataPointPath &path) |
| void | GetChildrenImpl (detail::GetChildrenRequest &req) |
| void | CreateLinkImpl (detail::CreateSymlinkRequest &req) |
| void | UpdateLinkImpl (detail::UpdateSymlinkRequest &req) |
| template<typename Request> | |
| void | InvokeCallback (const Request &req) const |
| template<typename T> | |
| void | ReadData (Data &data_node, const DataPointPath &path, gsl::span< T > &data, std::optional< std::reference_wrapper< MetaData > > &metadata, size_t offset) |
| template<typename T> | |
| void | WriteData (const DataPointPath &path, const gsl::span< const T > &data, const MetaData &metadata, std::optional< std::reference_wrapper< MetaData > >, size_t offset) |
| void | ReadMetaData (const DataPointPath &path, MetaData &metadata, bool check_sequence_id=false) |
| void | WriteMetaData (Data &data_node, const MetaData &metadata) |
| DataPointPath | ResolvePath (const DataPointPath &path) |
| Data & | CreateNewDataNode (const DataPointPath &path) |
| std::optional< std::reference_wrapper< FakeRepository::Data > > | GetDataNodeNoThrow (const DataPointPath &path) |
| void | CheckDataNodeExists (const DataPointPath &path) |
| BatchResponse | ProcessRequests (const RequestList &requests) override |
| bool | RequestsToFailContains (size_t index) const |
| FakeRepository () | |
| ~FakeRepository () override=default | |
| template<typename T> | |
| Lut::TableEntries | BindTypeHandlers () |
Static Protected Member Functions inherited from rtctk::componentFramework::test::FakeRepositorySubscriber | |
| template<typename T> | |
| static RequestDispatcher< FakeRepositorySubscriber >::TableEntries | BindTypeHandlers () |
Static Protected Member Functions inherited from rtctk::componentFramework::test::FakeRepository | |
| template<typename T> | |
| static RequestDispatcher< FakeRepository >::TableEntries | BindTypeHandlers () |
Protected Attributes inherited from rtctk::componentFramework::test::FakeRepositorySubscriber | |
| std::list< ValueSubscription > | m_value_subscriptions |
| std::list< CreateDeleteSubscription > | m_create_delete_subscriptions |
| Data | m_invoke_error_callbacks |
| Stores a boolean flag indicating if subscription callbacks should produce errors for testing. | |
Protected Attributes inherited from rtctk::componentFramework::test::FakeRepository | |
| std::mutex | m_mutex |
| Mutex for synchronising access to m_data. | |
| std::map< DataPointPath, Data > | m_data |
| DynamicThreadPool | m_thread_pool {"repo_worker"} |
| Data | m_requests_to_fail |
| Stores a vector of integer indices indicating which requests to forcefully fail in a batch request. | |
| Data | m_requests_to_skip |
| Stores a vector of integer indices indicating which requests to skip in a batch request. | |
Static Protected Attributes inherited from rtctk::componentFramework::test::FakeRepositorySubscriber | |
| static const RequestDispatcher< FakeRepositorySubscriber > | S_REQUEST_DISPATCHER |
Static Protected Attributes inherited from rtctk::componentFramework::test::FakeRepository | |
| static const RequestDispatcher< FakeRepository > | S_REQUEST_DISPATCHER |
Implementation of a fake of OldbIf for testing.
|
inlineoverridevirtual |
Get the URI used when creating this adapter object.
Implements rtctk::componentFramework::OldbIf.