SenseApiMgr: add initialize/finalizeAllSenseApiLibs()
Also, SenseApiDesc: initializeInd() now takes void. We no longer try to pass a struct of marionette-role ops into the libs. We'll be using message queueing for the handshake side of async calls now.
This commit is contained in:
@@ -135,6 +135,11 @@ void SenseApiManager::unloadSenseApiLib(const std::string& libraryPath)
|
||||
<< libraryPath << '\n';
|
||||
}
|
||||
|
||||
void SenseApiManager::unloadAllSenseApiLibs(void)
|
||||
{
|
||||
senseApiLibs.clear();
|
||||
}
|
||||
|
||||
void SenseApiManager::loadAllSenseApiLibsFromOptions()
|
||||
{
|
||||
const auto& options = OptionParser::getOptions();
|
||||
@@ -152,5 +157,41 @@ std::string SenseApiManager::stringifyLibs() const
|
||||
return result;
|
||||
}
|
||||
|
||||
void SenseApiManager::initializeSenseApiLib(SenseApiLib& lib)
|
||||
{
|
||||
if (!lib.getSenseApiDesc()->sal_mgmt_libOps->initializeInd)
|
||||
{
|
||||
throw std::runtime_error(
|
||||
std::string(__func__) + ": initializeInd() is NULL for library '"
|
||||
+ lib.libraryPath + "'");
|
||||
}
|
||||
lib.getSenseApiDesc()->sal_mgmt_libOps->initializeInd();
|
||||
}
|
||||
|
||||
void SenseApiManager::finalizeSenseApiLib(SenseApiLib& lib)
|
||||
{
|
||||
if (!lib.getSenseApiDesc()->sal_mgmt_libOps->finalizeInd)
|
||||
{
|
||||
throw std::runtime_error(
|
||||
std::string(__func__) + ": finalizeInd() is NULL for library '"
|
||||
+ lib.libraryPath + "'");
|
||||
}
|
||||
lib.getSenseApiDesc()->sal_mgmt_libOps->finalizeInd();
|
||||
}
|
||||
|
||||
void SenseApiManager::initializeAllSenseApiLibs(void)
|
||||
{
|
||||
for (auto& lib : senseApiLibs) {
|
||||
initializeSenseApiLib(*lib);
|
||||
}
|
||||
}
|
||||
|
||||
void SenseApiManager::finalizeAllSenseApiLibs(void)
|
||||
{
|
||||
for (auto& lib : senseApiLibs) {
|
||||
finalizeSenseApiLib(*lib);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace sense_api
|
||||
} // namespace hk
|
||||
|
||||
Reference in New Issue
Block a user