RTC Toolkit  1.0.0
repositoryIfUtils.hpp
Go to the documentation of this file.
1 
12 #ifndef RTCTK_COMPONENTFRAMEWORK_REPOSITORYIFUTILS_HPP
13 #define RTCTK_COMPONENTFRAMEWORK_REPOSITORYIFUTILS_HPP
14 
15 #include <optional>
16 
19 
20 #include <numapp/numapolicies.hpp>
21 
22 namespace rtctk::componentFramework {
23 
36 template <typename T>
37 bool GetOptionalParam(RepositoryIf& repo, const DataPointPath& path, T& value) {
38  if (repo.DataPointExists(path)) {
39  value = repo.GetDataPoint<T>(path);
40  return true;
41  } else {
42  return false;
43  }
44 }
45 
86 std::optional<numapp::NumaPolicies> GetNumaPolicies(RepositoryIf& repo, const DataPointPath& path);
87 
88 } // namespace rtctk::componentFramework
89 #endif // #ifndef RTCTK_COMPONENTFRAMEWORK_REPOSITORYIFUTILS_HPP
rtctk::componentFramework::RepositoryIf::GetDataPoint
T GetDataPoint(const DataPointPath &path) const
Fetches a datapoint from the repository.
Definition: repositoryIf.hpp:468
rtctk::componentFramework
Definition: commandReplier.cpp:20
rtctk::componentFramework::RepositoryIf::DataPointExists
virtual bool DataPointExists(const DataPointPath &path) const =0
Checks for the existence of a datapoint in the repository.
repositoryIf.hpp
Header file for RepositoryIf and related base classes.
rtctk::componentFramework::GetNumaPolicies
std::optional< numapp::NumaPolicies > GetNumaPolicies(RepositoryIf &repo, const DataPointPath &path)
Constructs a NumaPolicies object from the configuration datapoints found under the given datapoint pa...
Definition: repositoryIfUtils.cpp:32
rtctk::componentFramework::RepositoryIf
Abstract interface providing basic read and write facilities to a repository.
Definition: repositoryIf.hpp:35
logger.hpp
Logging Support Library based on log4cplus.
rtctk::componentFramework::GetOptionalParam
bool GetOptionalParam(RepositoryIf &repo, const DataPointPath &path, T &value)
Get optional datapoint.
Definition: repositoryIfUtils.hpp:37
rtctk::componentFramework::DataPointPath
This class provides a wraper for DataPoint paths which ensures that they only contain valid character...
Definition: dataPointPath.hpp:34