Go to the documentation of this file.
4 #include <gmock/gmock.h>
5 #include <mal/utility/Uri.hpp>
10 using ::testing::InSequence;
11 using ::testing::SetArgPointee;
16 using ::elt::mal::Uri;
37 if(req.m_type == std::type_index(
typeid(
bool)))
38 ReadBool(req.m_path, (
bool*)req.m_buffer);
39 else if(req.m_type == std::type_index(
typeid(
int32_t)))
40 ReadInt(req.m_path, (
int32_t*)req.m_buffer);
41 else if(req.m_type == std::type_index(
typeid(
float)))
42 ReadFloat(req.m_path, (
float*)req.m_buffer);
43 else if(req.m_type == std::type_index(
typeid(
double)))
44 ReadDouble(req.m_path, (
double*)req.m_buffer);
45 else if(req.m_type == std::type_index(
typeid(std::vector<float>)))
46 ReadVectorFloat(req.m_path, (std::vector<float>*)req.m_buffer);
50 ReadVoid(req.m_path, req.m_buffer);
60 if(req.m_type == std::type_index(
typeid(
bool)))
61 WriteBool(req.m_path, *(
bool*)req.m_buffer);
62 else if(req.m_type == std::type_index(
typeid(
int32_t)))
63 WriteInt(req.m_path, *(
int32_t*)req.m_buffer);
64 else if(req.m_type == std::type_index(
typeid(
float)))
65 WriteFloat(req.m_path, *(
float*)req.m_buffer);
66 else if(req.m_type == std::type_index(
typeid(
double)))
67 WriteDouble(req.m_path, *(
double*)req.m_buffer);
68 else if(req.m_type == std::type_index(
typeid(std::vector<float>)))
69 WriteVectorFloat(req.m_path, *(std::vector<float>*)req.m_buffer);
73 WriteVoid(req.m_path, req.m_buffer);
MOCK_CONST_METHOD2(ReadDouble, void(const DataPointPath &path, double *))
MOCK_CONST_METHOD2(WriteFloat, void(const DataPointPath &path, float))
MOCK_CONST_METHOD2(ReadInt, void(const DataPointPath &path, int32_t *))
MOCK_CONST_METHOD2(ReadMatrixFloat, void(const DataPointPath &path, MatrixBuffer< float > *))
void CreateDataPoint(const DataPointPath &path, const std::string &type) override
Creates a new datapoint in the repository with a specified type.
Definition: mockOldb.hpp:25
MOCK_CONST_METHOD2(ReadFloat, void(const DataPointPath &path, float *))
A request object to pass information about datapoints that should be read (written) from (to) the rep...
Definition: repositoryIf.hpp:37
Definition: fileRepository.hpp:44
Response SendReadRequest(const Request &request) const override
Sends a request to read data from the repository.
Definition: mockOldb.hpp:34
Definition: rtcComponent.hpp:17
Header file for OldbApiIf, which defines the API for OldbAdapters.
Declaration of the MatrixBuffer template class used in APIs.
MOCK_CONST_METHOD2(ReadVoid, void(const DataPointPath &path, void *))
std::pair< StringList, StringList > GetChildren(const DataPointPath &path) const override
Queries the datapoints and child paths for a given path.
Definition: mockOldb.hpp:30
string path
Definition: rtctkExampleDataTaskRobotTest.py:228
MOCK_CONST_METHOD2(WriteVoid, void(const DataPointPath &path, void *))
const std::vector< Parameters > & GetParams() const
Definition: repositoryIf.hpp:62
std::vector< std::string > StringList
Definition: repositoryIf.hpp:30
Definition: oldbApiIf.hpp:18
MOCK_CONST_METHOD2(WriteMatrixFloat, void(const DataPointPath &path, MatrixBuffer< float > &))
MOCK_CONST_METHOD2(WriteVectorFloat, void(const DataPointPath &path, std::vector< float >))
void DeleteDataPoint(const DataPointPath &path) override
Deletes a datapoint.
Definition: mockOldb.hpp:26
rtctk::componentFramework::RepositoryIf::Response Response
Definition: testFileRepository.cpp:15
MOCK_CONST_METHOD2(WriteInt, void(const DataPointPath &path, int))
Declaration of FileRepository that provides a simple file based repository.
Definition: mockOldb.hpp:21
bool DataPointExists(const DataPointPath &path) const override
Checks for the existence of a datapoint in the repository.
Definition: mockOldb.hpp:29
int int32_t
Definition: mudpi.h:17
MOCK_CONST_METHOD2(WriteBool, void(const DataPointPath &path, bool))
MockOldb(const ::elt::mal::Uri &datauri)
Definition: mockOldb.hpp:23
size_t GetDataPointSize(const DataPointPath &path) const override
Fetches the size of the datapoint's data.
Definition: mockOldb.hpp:28
Definition: dataPointPath.hpp:30
Response SendWriteRequest(const Request &request) override
Sends a request to write data to the repository.
Definition: mockOldb.hpp:57
An object used to wait for a request to complete.
Definition: repositoryIf.hpp:74
MOCK_CONST_METHOD2(WriteDouble, void(const DataPointPath &path, double))
virtual ~MockOldb()
Definition: mockOldb.hpp:24
std::string GetDataPointType(const DataPointPath &path) const override
Fetches the type of the datapoint.
Definition: mockOldb.hpp:27
MOCK_CONST_METHOD2(ReadBool, void(const DataPointPath &path, bool *))
Definition: matrixBuffer.hpp:19
MOCK_CONST_METHOD2(ReadVectorFloat, void(const DataPointPath &path, std::vector< float > *))