RTC Toolkit 4.0.1
Loading...
Searching...
No Matches
repositoryIfUtils.hpp
Go to the documentation of this file.
1
13#ifndef RTCTK_COMPONENTFRAMEWORK_REPOSITORYIFUTILS_HPP
14#define RTCTK_COMPONENTFRAMEWORK_REPOSITORYIFUTILS_HPP
15
16#include <optional>
17
20
21#include <numapp/numapolicies.hpp>
22
24
39template <typename T>
40bool GetOptionalParam(RepositoryIf& repo, const DataPointPath& path, T& value) {
41 if (repo.DataPointExists(path)) {
42 value = repo.GetDataPoint<T>(path);
43 return true;
44 } else {
45 return false;
46 }
47}
48
91std::optional<numapp::NumaPolicies> GetNumaPolicies(RepositoryIf& repo, const DataPointPath& path);
92
93} // namespace rtctk::componentFramework
94#endif // #ifndef RTCTK_COMPONENTFRAMEWORK_REPOSITORYIFUTILS_HPP
This class provides a wrapper for a data point path.
Definition: dataPointPath.hpp:73
Abstract interface providing basic read and write facilities to a repository.
Definition: repositoryIf.hpp:38
T GetDataPoint(const DataPointPath &path) const
Fetches a datapoint from the repository.
Definition: repositoryIf.hpp:574
virtual bool DataPointExists(const DataPointPath &path) const =0
Checks for the existence of a datapoint in the repository.
bool GetOptionalParam(RepositoryIf &repo, const DataPointPath &path, T &value)
Get optional datapoint.
Definition: repositoryIfUtils.hpp:40
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:33
Logging Support Library based on log4cplus.
Definition: commandReplier.cpp:22
Header file for RepositoryIf and related base classes.