RTC Toolkit 5.0.0
Loading...
Searching...
No Matches
runtimeRepoIf.hpp
Go to the documentation of this file.
1
13#ifndef RTCTK_COMPONENTFRAMEWORK_RUNTIMEREPOIF_HPP
14#define RTCTK_COMPONENTFRAMEWORK_RUNTIMEREPOIF_HPP
15
17
18#include <mutex>
19
21
28public:
36 using AdapterIdType = elt::mal::Uri;
37
38 virtual ~RuntimeRepoIf() = default;
39
63 static std::unique_ptr<RuntimeRepoIf> CreateAdapter(const elt::mal::Uri& uri);
64
72 std::string GetDefaultServerAlias() const;
73
87 void SetDefaultServerAlias(const std::string& server_alias);
88
105 virtual void CreateDataPoint(const DataPointPath& path,
106 const std::type_info& type,
107 const std::string& server_alias);
108
109 using RepositoryIf::CreateDataPoint;
110
128 template <typename T>
129 void CreateDataPoint(const DataPointPath& path,
130 const T default_value,
131 const std::string& server_alias);
132
141 virtual std::string GetServerAlias(const DataPointPath& path) const;
142
143private:
151 mutable std::mutex m_mutex;
152
154 std::string m_server_alias;
155};
156
157template <typename T>
159 const T default_value,
160 const std::string& server_alias) {
161 CreateDataPoint(path, typeid(T), server_alias);
163}
164
165} // namespace rtctk::componentFramework
166
167#endif // RTCTK_COMPONENTFRAMEWORK_RUNTIMEREPOIF_HPP
This class provides a wrapper for a data point path.
Definition dataPointPath.hpp:74
void SetDataPoint(const DataPointPath &path, const T &value)
Sets a datapoint in the repository.
Definition repositoryIf.ipp:1720
Abstract interface providing I/O and additional subscription facilities for a repository.
Definition repositorySubscriberIf.hpp:27
Base interface for all Runtime Configuration Repository adapters.
Definition runtimeRepoIf.hpp:27
elt::mal::Uri AdapterIdType
The type used to distinguish between different adapters implementing RuntimeRepoIf.
Definition runtimeRepoIf.hpp:36
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...
Definition runtimeRepoIf.cpp:34
#define RTCTK_API
Helper to indicate that a class or function must be exported in the public symbol table.
Definition config.hpp:33
Definition commandReplier.cpp:22
elt::mal::future< std::string > InjectReqRepEvent(StateMachineEngine &engine)
Definition malEventInjector.hpp:23
Header file for RepositorySubscriberIf and related base classes.