Mind: Implement initialize/finalizeBodyReq()
We've done a lot of general work on the init sequencing.
This commit is contained in:
@@ -97,7 +97,7 @@ std::optional<std::string> SenseApiManager::searchForLibInSmoSearchPaths(
|
||||
|
||||
SenseApiLib& SenseApiManager::loadSenseApiLib(
|
||||
const std::string& libraryPath,
|
||||
std::shared_ptr<ComponentThread>& componentThread
|
||||
const std::shared_ptr<ComponentThread>& componentThread
|
||||
)
|
||||
{
|
||||
std::optional<std::string> fullPath = searchForLibInSmoSearchPaths(
|
||||
@@ -204,7 +204,7 @@ void SenseApiManager::unloadAllSenseApiLibs(void)
|
||||
}
|
||||
|
||||
void SenseApiManager::loadAllSenseApiLibsFromOptions(
|
||||
std::shared_ptr<ComponentThread>& componentThread
|
||||
const std::shared_ptr<ComponentThread>& componentThread
|
||||
)
|
||||
{
|
||||
const auto& options = OptionParser::getOptions();
|
||||
@@ -351,6 +351,11 @@ public:
|
||||
context->originalCbFn(context->loop);
|
||||
}
|
||||
|
||||
void callOriginalCallback()
|
||||
{
|
||||
originalCbFn(loop);
|
||||
}
|
||||
|
||||
public:
|
||||
AsynchronousLoop loop;
|
||||
};
|
||||
@@ -365,7 +370,7 @@ void SenseApiManager::attachAllSenseDevicesFromSpecsReq(
|
||||
|
||||
if (request->loop.nTotalIsZero())
|
||||
{
|
||||
cb(request->loop);
|
||||
request->callOriginalCallback();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -381,7 +386,7 @@ void SenseApiManager::attachAllSenseDevicesFromSpecsReq(
|
||||
} catch (const std::exception& e) {
|
||||
std::cerr << __func__ << ": Exception: " << e.what() << "\n";
|
||||
if (request->loop.incrementSuccessOrFailureAndTestForCompletionDueTo(false))
|
||||
{ cb(request->loop); }
|
||||
{ request->callOriginalCallback(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -418,6 +423,11 @@ public:
|
||||
|
||||
context->originalCbFn(context->loop);
|
||||
}
|
||||
|
||||
void callOriginalCallback()
|
||||
{
|
||||
originalCbFn(loop);
|
||||
}
|
||||
};
|
||||
|
||||
void SenseApiManager::detachAllSenseDevicesReq(
|
||||
@@ -429,7 +439,7 @@ void SenseApiManager::detachAllSenseDevicesReq(
|
||||
|
||||
if (request->loop.nTotalIsZero())
|
||||
{
|
||||
cb(request->loop);
|
||||
request->callOriginalCallback();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -445,7 +455,9 @@ void SenseApiManager::detachAllSenseDevicesReq(
|
||||
} catch (const std::exception& e) {
|
||||
std::cerr << __func__ << ": Exception: " << e.what() << "\n";
|
||||
if (request->loop.incrementSuccessOrFailureAndTestForCompletionDueTo(false))
|
||||
{ cb(request->loop); }
|
||||
{
|
||||
request->callOriginalCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user