Libspinscale: Add separate CMake project config

This commit is contained in:
2025-12-28 03:44:01 -04:00
parent 7acdfcc337
commit 5a4f498663
21 changed files with 328 additions and 100 deletions
+16 -16
View File
@@ -4,12 +4,12 @@
#include <spinscale/callback.h>
#include <spinscale/callableTracer.h>
#include <spinscale/component.h>
#include <spinscale/marionette.h>
#include <componentThread.h>
#include <deviceManager/deviceManager.h>
#include <mindManager/mindManager.h>
#include <marionette/marionette.h>
namespace smo {
namespace sscl {
namespace mrntt {
class MarionetteComponent::MrnttLifetimeMgmtOp
@@ -33,13 +33,13 @@ public:
)
{
auto self = sscl::ComponentThread::getSelf();
if (self->id != SmoThreadId::MRNTT)
if (self->id != smo::SmoThreadId::MRNTT)
{
throw std::runtime_error(std::string(__func__)
+ ": Must be executed on Marionette thread");
}
smo::mind::globalMind = std::make_shared<Mind>();
smo::mind::globalMind = std::make_shared<smo::Mind>();
smo::mind::globalMind->initializeReq({context, std::bind(
&MrnttLifetimeMgmtOp::initializeReq2,
this, context, std::placeholders::_1)});
@@ -58,7 +58,7 @@ public:
return;
}
device::DeviceManager::getInstance().initializeDeviceReattacher();
smo::device::DeviceManager::getInstance().initializeDeviceReattacher();
// Call negtrinEventInd on the Director in the final callback
smo::mind::globalMind->director.negtrinEventInd();
@@ -71,13 +71,13 @@ public:
)
{
auto self = sscl::ComponentThread::getSelf();
if (self->id != SmoThreadId::MRNTT)
if (self->id != smo::SmoThreadId::MRNTT)
{
throw std::runtime_error(std::string(__func__)
+ ": Must be executed on Marionette thread");
}
device::DeviceManager::getInstance().finalizeDeviceReattacher();
smo::device::DeviceManager::getInstance().finalizeDeviceReattacher();
/** FIXME:
* It may be necessary to add a delay here to ensure that all in-flight
@@ -133,24 +133,24 @@ public:
)
{
auto self = sscl::ComponentThread::getSelf();
if (self->id != SmoThreadId::MRNTT)
if (self->id != smo::SmoThreadId::MRNTT)
{
throw std::runtime_error(std::string(__func__)
+ ": Must be executed on Marionette thread");
}
mrntt::mrntt.finalizeReq({nullptr, std::bind(
&mrntt::marionetteFinalizeReqCb,
sscl::mrntt::mrntt.finalizeReq({nullptr, std::bind(
&sscl::mrntt::marionetteFinalizeReqCb,
std::placeholders::_1)});
}
};
void MarionetteComponent::initializeReq(
void sscl::mrntt::MarionetteComponent::initializeReq(
sscl::Callback<mrnttLifetimeMgmtOpCbFn> callback)
{
auto mrntt = sscl::ComponentThread::getSelf();
if (mrntt->id != SmoThreadId::MRNTT)
if (mrntt->id != smo::SmoThreadId::MRNTT)
{
throw std::runtime_error(std::string(__func__)
+ ": Must be executed on Marionette thread");
@@ -165,12 +165,12 @@ void MarionetteComponent::initializeReq(
request.get(), request)));
}
void MarionetteComponent::finalizeReq(
void sscl::mrntt::MarionetteComponent::finalizeReq(
sscl::Callback<mrnttLifetimeMgmtOpCbFn> callback)
{
auto mrntt = sscl::ComponentThread::getSelf();
if (mrntt->id != SmoThreadId::MRNTT)
if (mrntt->id != smo::SmoThreadId::MRNTT)
{
throw std::runtime_error(std::string(__func__)
+ ": Must be executed on Marionette thread");
@@ -185,7 +185,7 @@ void MarionetteComponent::finalizeReq(
request.get(), request)));
}
void MarionetteComponent::exceptionInd()
void sscl::mrntt::MarionetteComponent::exceptionInd()
{
auto faultyThread = sscl::ComponentThread::getSelf();
auto mrntt = sscl::ComponentThread::getMrntt();
@@ -200,4 +200,4 @@ void MarionetteComponent::exceptionInd()
}
} // namespace mrntt
} // namespace smo
} // namespace sscl