Go to the documentation of this file.
18 template <
class IDType,
class FinderInfoType>
34 absPackageDataDir = packageFinder.
getDataDir();
35 if (absPackageDataDir.empty())
38 throw LocalException() <<
"Could not find package '" <<
packageName <<
"'.";
42 ARMARX_INFO <<
"PriorKnowledgeFinder root directory: " << absPackageDataDir;
61 relPackageDataPath = p;
73 return relPackageDataPath;
80 return absPackageDataDir;
87 return absPackageDataDir /
packageName / relPackageDataPath;
90 virtual bool accept(
const std::filesystem::path& idPath)
const = 0;
92 virtual bool check(
const IDType&
id)
const = 0;
93 virtual std::optional<FinderInfoType>
find(
const IDType&
id)
const = 0;
94 virtual std::vector<FinderInfoType>
findAll()
const = 0;
100 if (!std::filesystem::exists(absPackageDataDir))
102 ARMARX_ERROR <<
"PriorKnowledgeFinder is not initialized yet. Could not resolve "
103 "absolute path for package '"
112 std::filesystem::path relPackageDataPath;
113 std::filesystem::path absPackageDataDir;
116 template <
class IDType,
118 class FinderInfoType>
130 std::filesystem::path
136 virtual bool checkAll(
const DatasetType& dataset)
const = 0;
137 virtual bool check(
const DatasetType& dataset,
const IDType&
id)
const = 0;
138 virtual std::optional<FinderInfoType>
find(
const DatasetType& dataset,
139 const IDType&
id)
const = 0;
140 virtual std::vector<FinderInfoType>
findAll(
const DatasetType& dataset)
const = 0;
virtual bool checkAll() const =0
std::filesystem::path getAbsolutePackagePath() const
virtual std::optional< FinderInfoType > find(const IDType &id) const =0
std::filesystem::path getRelativePath() const
The CMakePackageFinder class provides an interface to the CMake Package finder capabilities.
virtual bool accept(const std::filesystem::path &idPath) const =0
std::filesystem::path getFullPath(const std::filesystem::path &relPath) const
virtual std::vector< FinderInfoType > findAll() const =0
FinderBase & operator=(FinderBase &&)=default
std::string getPackageName() const
DatasetFinderBase(const std::string &packageName, const std::filesystem::path &relDir)
std::string getDataDir() const
Base Class for all Logging classes.
static void addDataPaths(const std::string &dataPathList)
virtual bool check(const IDType &id) const =0
FinderBase(const std::string &packageName, const std::filesystem::path &relDir)
void setRelativePath(const std::filesystem::path &p)
virtual std::optional< FinderInfoType > find(const DatasetType &dataset, const IDType &id) const =0
virtual bool check(const DatasetType &dataset, const IDType &id) const =0
void checkAbsolutePathIsValid() const
void recalculateBasePath()
std::filesystem::path getFullPath() const