13#ifndef RTCTK_COMPONENTFRAMEWORK_TEST_MOCKRUNTIMEREPOIF_HPP
14#define RTCTK_COMPONENTFRAMEWORK_TEST_MOCKRUNTIMEREPOIF_HPP
34 .WillByDefault([
this](
const DataPointPath& path) ->
const std::type_info& {
53 .WillByDefault([
this](
const DataPointPath& path) -> std::string
const {
54 return m_server_alias_map.at(path.
ToString());
61 (
const DataPointPath&,
const std::type_info&,
const std::string& alias),
83 const std::type_info& type,
84 const std::string& alias)
override {
85 m_server_alias_map[path.
ToString()] = alias;
87 this->CreateDataPoint1(path, type, alias);
92 std::map<std::string, std::string> m_server_alias_map;
This class provides a wrapper for a data point path.
Definition: dataPointPath.hpp:73
const std::string & ToString() const noexcept
Get string representing the DataPointPath.
Definition: dataPointPath.hpp:423
A request object to pass information about datapoints that should be read from the repository.
Definition: repositoryIf.hpp:49
An object used to wait for a request to complete.
Definition: repositoryIf.hpp:197
A request object to pass information about datapoints that should be written to the repository.
Definition: repositoryIf.hpp:122
virtual const std::type_info & GetDataPointType(const DataPointPath &path) const =0
Fetches the type of the datapoint.
virtual size_t GetDataPointSize(const DataPointPath &path) const =0
Fetches the size of the datapoint's data.
virtual std::pair< PathList, PathList > GetChildren(const DataPointPath &path) const =0
Queries the datapoints and child paths for a given path.
virtual void CreateDataPoint(const DataPointPath &path, const std::type_info &type)=0
Creates a new datapoint in the repository with a specified type.
virtual void DeleteDataPoint(const DataPointPath &path)=0
Deletes a datapoint.
virtual bool DataPointExists(const DataPointPath &path) const =0
Checks for the existence of a datapoint in the repository.
virtual Response SendWriteRequest(const WriteRequest &request)=0
Sends a request to write data to the repository.
virtual Response SendReadRequest(const ReadRequest &request) const =0
Sends a request to read data from the repository.
A request object to pass information about datapoints to subscribe to.
Definition: repositorySubscriberIf.hpp:37
A request object to pass information about datapoints to unsubscribe from.
Definition: repositorySubscriberIf.hpp:143
virtual RepositoryIf::Response SendUnsubscribeRequest(const UnsubscribeRequest &request) const =0
This is called to asynchronously send a request to unsubscribe from various notifications.
virtual RepositoryIf::Response SendSubscribeRequest(const SubscribeRequest &request) const =0
This is called to asynchronously send a subscription request for datapoints.
Base interface for all Runtime Configuration Repository adapters.
Definition: runtimeRepoIf.hpp:28
virtual std::string GetServerAlias(const DataPointPath &path) const =0
Fetches the server alias for a specific datapoint.
Implementation of an in-memory fake repository for testing.
Definition: fakeRepositoryIf.hpp:31
Response SendReadRequest(const ReadRequest &) const override
Sends a request to read data from the repository.
Definition: fakeRepositoryIf.cpp:99
const std::type_info & GetDataPointType(const DataPointPath &) const override
Fetches the type of the datapoint.
Definition: fakeRepositoryIf.cpp:41
Response SendWriteRequest(const WriteRequest &) override
Sends a request to write data to the repository.
Definition: fakeRepositoryIf.cpp:103
std::size_t GetDataPointSize(const DataPointPath &) const override
Fetches the size of the datapoint's data.
Definition: fakeRepositoryIf.cpp:50
bool DataPointExists(const DataPointPath &) const override
Checks for the existence of a datapoint in the repository.
Definition: fakeRepositoryIf.cpp:60
void DeleteDataPoint(const DataPointPath &) override
Deletes a datapoint.
Definition: fakeRepositoryIf.cpp:28
void CreateDataPoint(const DataPointPath &, const std::type_info &) override
Creates a new datapoint in the repository with a specified type.
Definition: fakeRepositoryIf.cpp:19
std::pair< PathList, PathList > GetChildren(const DataPointPath &) const override
Queries the datapoints and child paths for a given path.
Definition: fakeRepositoryIf.cpp:66
A mock of RuntimeRepoIf.
Definition: mockRuntimeRepoIf.hpp:26
MOCK_METHOD(void, DeleteDataPoint,(const DataPointPath &),(override))
MOCK_METHOD(Response, SendSubscribeRequest,(const SubscribeRequest &),(const override))
MOCK_METHOD(const std::type_info &, GetDataPointType,(const DataPointPath &),(const override))
void CreateDataPoint(const DataPointPath &path, const std::type_info &type) override
Creates a new datapoint in the repository with a specified type.
Definition: mockRuntimeRepoIf.hpp:78
MOCK_METHOD(void, CreateDataPoint1,(const DataPointPath &, const std::type_info &, const std::string &alias),())
void CreateDataPoint(const DataPointPath &path, const std::type_info &type, const std::string &alias) override
Creates a new datapoint in the repository with a specified type on a particular external Redis server...
Definition: mockRuntimeRepoIf.hpp:82
MOCK_METHOD(std::string, GetServerAlias,(const DataPointPath &),(const override))
MOCK_METHOD(Response, SendReadRequest,(const ReadRequest &),(const override))
MOCK_METHOD((std::pair< PathList, PathList >), GetChildren,(const DataPointPath &),(const override))
MOCK_METHOD(Response, SendUnsubscribeRequest,(const UnsubscribeRequest &),(const override))
MOCK_METHOD(std::size_t, GetDataPointSize,(const DataPointPath &),(const override))
MOCK_METHOD(bool, DataPointExists,(const DataPointPath &),(const override))
MOCK_METHOD(Response, SendWriteRequest,(const WriteRequest &),(override))
MockRuntimeRepoIf()
Definition: mockRuntimeRepoIf.hpp:28
Header file for an in-memory fake RepositoryIf.
Definition: fakeClock.cpp:15
Header file for RuntimeRepoIf, which defines the API for RuntimeRepoAdapters.