RTC Toolkit 4.0.2
Loading...
Searching...
No Matches
fakeRepositorySubscriber.hpp
Go to the documentation of this file.
1
13#ifndef RTCTK_COMPONENTFRAMEWORK_TEST_FAKEREPOSITORYSUBSCRIBER_HPP
14#define RTCTK_COMPONENTFRAMEWORK_TEST_FAKEREPOSITORYSUBSCRIBER_HPP
15
16#include <gmock/gmock.h>
17#include <gtest/gtest.h>
18#include <mutex>
19#include <typeinfo>
20
23
25
31 virtual public FakeRepositoryIf {
32public:
37 Response SendSubscribeRequest(const SubscribeRequest& request) const override;
38
42 Response SendUnsubscribeRequest(const UnsubscribeRequest& request) const override;
43
44 void PostDeleteDataPointHook(const DataPointPath&) const override;
45
46 void PostWriteDataPointHook(const DataPointPath&) const override;
47
48private:
49 struct SubscriptionParameters {
52
54 void* m_buffer;
55
57 const std::type_info& m_type;
58
60 std::function<void(const DataPointPath&)> m_removed_callback;
61 std::function<void(const DataPointPath&)> m_newvalue_callback;
62 };
63
64 mutable std::vector<SubscriptionParameters> m_params;
65 mutable std::mutex m_mutex;
66};
67
68} // namespace rtctk::componentFramework::test
69
70#endif // RTCTK_COMPONENTFRAMEWORK_TEST_FAKEREPOSITORYSUBSCRIBER_HPP
This class provides a wrapper for a data point path.
Definition: dataPointPath.hpp:73
An object used to wait for a request to complete.
Definition: repositoryIf.hpp:197
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
Abstract interface providing subscription facilities for a repository.
Definition: repositorySubscriberIf.hpp:29
Implementation of an in-memory fake repository for testing.
Definition: fakeRepositoryIf.hpp:31
A very simple fake implementation of RepositorySubscriberIf to allow testing the interactions and cal...
Definition: fakeRepositorySubscriber.hpp:31
Response SendSubscribeRequest(const SubscribeRequest &request) const override
Simulates sending a subscription request and registering it in an internal list.
Definition: fakeRepositorySubscriber.cpp:38
Response SendUnsubscribeRequest(const UnsubscribeRequest &request) const override
Simulates sending an unsubscribe request and deregistering it from the internal list.
Definition: fakeRepositorySubscriber.cpp:58
void PostWriteDataPointHook(const DataPointPath &) const override
Hook that is run after a DataPoint is created with the given DataPointPath.
Definition: fakeRepositorySubscriber.cpp:95
void PostDeleteDataPointHook(const DataPointPath &) const override
Hook that is run after a DataPoint is deleted with the given DataPointPath.
Definition: fakeRepositorySubscriber.cpp:84
Header file for an in-memory fake RepositoryIf.
Definition: fakeClock.cpp:15
DataPointPath m_path
Definition: populateConfig.cpp:165
Header file for RepositorySubscriberIf and related base classes.