SenseApiMgr: Provide ComponentThread::getSelf access to libs
This commit is contained in:
@@ -60,6 +60,15 @@ struct SmoCallbacks
|
|||||||
*/
|
*/
|
||||||
std::optional<std::string> (*searchForLibInSmoSearchPaths)(
|
std::optional<std::string> (*searchForLibInSmoSearchPaths)(
|
||||||
const std::string& libraryPath);
|
const std::string& libraryPath);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the current ComponentThread instance
|
||||||
|
* @return Shared pointer to the current ComponentThread
|
||||||
|
*
|
||||||
|
* This function provides access to the current ComponentThread instance,
|
||||||
|
* equivalent to calling ComponentThread::getSelf().
|
||||||
|
*/
|
||||||
|
std::shared_ptr<ComponentThread> (*ComponentThread_getSelf)(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Sal_Mgmt_LibOps
|
struct Sal_Mgmt_LibOps
|
||||||
|
|||||||
@@ -66,12 +66,19 @@ static std::optional<std::string> searchForLibInSmoSearchPaths(
|
|||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Local static function to wrap ComponentThread::getSelf for SmoCallbacks */
|
||||||
|
static std::shared_ptr<ComponentThread> ComponentThread_getSelf()
|
||||||
|
{
|
||||||
|
return ComponentThread::getSelf();
|
||||||
|
}
|
||||||
|
|
||||||
/* Hooks to be provided to senseApiLibs, enabling them to call into Salmanoff
|
/* Hooks to be provided to senseApiLibs, enabling them to call into Salmanoff
|
||||||
* code.
|
* code.
|
||||||
*/
|
*/
|
||||||
static SmoCallbacks smoCallbacks =
|
static SmoCallbacks smoCallbacks =
|
||||||
{
|
{
|
||||||
.searchForLibInSmoSearchPaths = searchForLibInSmoSearchPaths
|
.searchForLibInSmoSearchPaths = searchForLibInSmoSearchPaths,
|
||||||
|
.ComponentThread_getSelf = ComponentThread_getSelf
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Static file-scope threading model object for senseApi libraries */
|
/* Static file-scope threading model object for senseApi libraries */
|
||||||
|
|||||||
Reference in New Issue
Block a user