senseApiMgr: new method: loadAllSenseApisFromOptions
This method dlopens() all senseApi libs that were referenced by device specs.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user