RTC Toolkit  2.0.0
populateConfig.hpp
Go to the documentation of this file.
1 
13 #ifndef RTCTK_RTCSUPERVISOR_POPULATECONFIG_HPP
14 #define RTCTK_RTCSUPERVISOR_POPULATECONFIG_HPP
15 
16 #include <functional>
17 #include <map>
18 #include <typeindex>
19 
22 
23 namespace rtctk::rtcSupervisor {
24 
35 public:
39 
45  public:
50  explicit InvalidConfigException(const DataPointPath& path);
51 
58  explicit InvalidConfigException(const DataPointPath& path, const std::string& explanation);
59  };
60 
62  PopulateConfig() = delete;
63 
65  PopulateConfig(const PopulateConfig&) = delete;
66 
69 
72 
75 
90 
111 
128 
164 
178  void CopyHierarchy(const DataPointPath& source, const DataPointPath& target);
179 
193  void CopyDataPoint(const DataPointPath& source, const DataPointPath& target);
194 
195 private:
197  const PersistentRepoIf& m_persistent_repo;
198 
200  RuntimeRepoIf& m_runtime_repo;
201 
203  struct IoFunctionMapEntry {
204  using CopyFunction = std::function<void(
205  const PersistentRepoIf&, const DataPointPath&, RuntimeRepoIf&, const DataPointPath&)>;
206 
207  CopyFunction m_copy_function;
208  };
209 
210  using IoFunctionMap = std::map<std::type_index, IoFunctionMapEntry>;
211 
216  template <typename T>
217  static auto MakeMapEntry();
218 
220  static const IoFunctionMap S_IO_FUNCTIONS;
221 };
222 
223 } // namespace rtctk::rtcSupervisor
224 
225 #endif // RTCTK_RTCSUPERVISOR_POPULATECONFIG_HPP
rtctk::rtcSupervisor
Definition: rtcCommandRequest.hpp:19
rtctk::componentFramework::PersistentRepoIf
Definition: persistentRepoIf.hpp:19
rtctk::rtcSupervisor::PopulateConfig::PopulateConfig
PopulateConfig(const PopulateConfig &)=delete
This class cannot be copy constructed.
persistentRepoIf.hpp
Header file for PersistentRepoIf, which defines the API for PersistentRepoAdapter.
rtctk::rtcSupervisor::PopulateConfig::IsSimplePopulateFlagSet
bool IsSimplePopulateFlagSet()
Checks if the simple_populate_runtime_repo flag has been set.
Definition: populateConfig.cpp:101
rtctk::componentFramework::RtctkException
The RtctkException class is the base class for all Rtctk exceptions.
Definition: exceptions.hpp:207
wscript.target
target
Definition: wscript:16
rtctk::rtcSupervisor::PopulateConfig::InvalidConfigException::InvalidConfigException
InvalidConfigException(const DataPointPath &path)
Constructs the exception indicating an invalid datapoint.
Definition: populateConfig.cpp:78
rtctk::rtcSupervisor::PopulateConfig::operator=
PopulateConfig & operator=(const PopulateConfig &)=delete
This class cannot be copy assigned.
rtctk::rtcSupervisor::PopulateConfig::InvalidConfigException
The InvalidConfigException is thrown when datapoints in the Persistent Configuration Repository are d...
Definition: populateConfig.hpp:44
rtctk::rtcSupervisor::PopulateConfig::PopulateConfig
PopulateConfig()=delete
Do not allow construction with no arguments.
rtctk::rtcSupervisor::PopulateConfig
A utility class used to populate the Runtime Configuration Repository.
Definition: populateConfig.hpp:34
rtctk::rtcSupervisor::PopulateConfig::PopulateConfig
PopulateConfig(PopulateConfig &&)=default
Objects of this class can be moved.
rtctk::rtcSupervisor::PopulateConfig::CopyDataPoint
void CopyDataPoint(const DataPointPath &source, const DataPointPath &target)
Copy a single datapoint from the source to the target repository.
Definition: populateConfig.cpp:166
rtctk::rtcSupervisor::PopulateConfig::CopyHierarchy
void CopyHierarchy(const DataPointPath &source, const DataPointPath &target)
Copy a hierarchy of datapoints from the source to the target repository.
Definition: populateConfig.cpp:154
rtctk::rtcSupervisor::PopulateConfig::CopyActiveDeploymentSet
void CopyActiveDeploymentSet()
Copies the active Deployment Set to the Runtime Configuration Repository.
Definition: populateConfig.cpp:110
rtctk::componentFramework::RuntimeRepoIf
Definition: runtimeRepoIf.hpp:20
rtctk::rtcSupervisor::PopulateConfig::IsDisablePopulateFlagSet
bool IsDisablePopulateFlagSet()
Checks if the disable_populate_runtime_repo flag has been set.
Definition: populateConfig.cpp:92
rtctk::componentFramework::DataPointPath
This class provides a wrapper for a data point path.
Definition: dataPointPath.hpp:65
runtimeRepoIf.hpp
Header file for RuntimeRepoIf, which defines the API for RuntimeRepoAdapters.
rtctk::rtcSupervisor::PopulateConfig::operator=
PopulateConfig & operator=(PopulateConfig &&)=default
Objects of this class can be moved with the move assignment operator.