senseApiMgr: new method: loadAllSenseApisFromOptions

This method dlopens() all senseApi libs that were referenced by
device specs.
This commit is contained in:
2025-01-08 15:06:31 -04:00
parent 04db7bf76c
commit 090f0d3b02
3 changed files with 13 additions and 0 deletions
@@ -24,6 +24,7 @@ public:
std::optional<std::reference_wrapper<SenseApiLib>> getSenseApiLib(
const std::string& libraryPath);
void unloadSenseApiLib(const std::string& libraryPath);
void loadAllSenseApiLibsFromOptions(void);
private:
SenseApiManager() = default;
+8
View File
@@ -116,5 +116,13 @@ void SenseApiManager::unloadSenseApiLib(const std::string& libraryPath)
<< libraryPath << '\n';
}
void SenseApiManager::loadAllSenseApiLibsFromOptions()
{
const auto& options = OptionParser::getOptions();
for (const auto& libPath : options.senseApiLibs) {
loadSenseApiLib(libPath);
}
}
} // namespace sense_api
} // namespace hk