Split: Split libspinscale off from SMO.
Now we can probably begin using libspinscale in Couresilient without worrying about excessive technical debt later on.
This commit is contained in:
@@ -1,23 +1,25 @@
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <spinscale/asynchronousContinuation.h>
|
||||
#include <spinscale/asynchronousLoop.h>
|
||||
#include <spinscale/callback.h>
|
||||
#include <spinscale/callableTracer.h>
|
||||
#include <spinscale/component.h>
|
||||
#include <spinscale/marionette.h>
|
||||
#include <marionette/marionette.h>
|
||||
#include <componentThread.h>
|
||||
#include <deviceManager/deviceManager.h>
|
||||
#include <mindManager/mindManager.h>
|
||||
|
||||
namespace sscl {
|
||||
namespace pptr {
|
||||
namespace smo {
|
||||
namespace mrntt {
|
||||
|
||||
class MarionetteComponent::MrnttLifetimeMgmtOp
|
||||
: public sscl::PostedAsynchronousContinuation<mrnttLifetimeMgmtOpCbFn>
|
||||
{
|
||||
public:
|
||||
MrnttLifetimeMgmtOp(
|
||||
MarionetteComponent &parent, const std::shared_ptr<sscl::ComponentThread> &caller,
|
||||
MarionetteComponent &parent,
|
||||
const std::shared_ptr<sscl::ComponentThread> &caller,
|
||||
sscl::Callback<mrnttLifetimeMgmtOpCbFn> callback)
|
||||
: sscl::PostedAsynchronousContinuation<mrnttLifetimeMgmtOpCbFn>(
|
||||
caller, callback),
|
||||
@@ -139,13 +141,13 @@ public:
|
||||
+ ": Must be executed on Marionette thread");
|
||||
}
|
||||
|
||||
sscl::pptr::mrntt.finalizeReq({nullptr, std::bind(
|
||||
&sscl::pptr::marionetteFinalizeReqCb,
|
||||
smo::mrntt::mrntt.finalizeReq({nullptr, std::bind(
|
||||
&smo::mrntt::marionetteFinalizeReqCb,
|
||||
std::placeholders::_1)});
|
||||
}
|
||||
};
|
||||
|
||||
void sscl::pptr::MarionetteComponent::initializeReq(
|
||||
void MarionetteComponent::initializeReq(
|
||||
sscl::Callback<mrnttLifetimeMgmtOpCbFn> callback)
|
||||
{
|
||||
auto mrntt = sscl::ComponentThread::getSelf();
|
||||
@@ -165,7 +167,7 @@ void sscl::pptr::MarionetteComponent::initializeReq(
|
||||
request.get(), request)));
|
||||
}
|
||||
|
||||
void sscl::pptr::MarionetteComponent::finalizeReq(
|
||||
void MarionetteComponent::finalizeReq(
|
||||
sscl::Callback<mrnttLifetimeMgmtOpCbFn> callback)
|
||||
{
|
||||
auto mrntt = sscl::ComponentThread::getSelf();
|
||||
@@ -185,10 +187,16 @@ void sscl::pptr::MarionetteComponent::finalizeReq(
|
||||
request.get(), request)));
|
||||
}
|
||||
|
||||
void sscl::pptr::MarionetteComponent::exceptionInd()
|
||||
void MarionetteComponent::handleLoopExceptionHook()
|
||||
{
|
||||
sscl::pptr::exitCode = EXIT_FAILURE;
|
||||
exceptionInd();
|
||||
}
|
||||
|
||||
void MarionetteComponent::exceptionInd()
|
||||
{
|
||||
auto faultyThread = sscl::ComponentThread::getSelf();
|
||||
auto mrntt = sscl::ComponentThread::getMrntt();
|
||||
auto mrntt = sscl::ComponentThread::getPptr();
|
||||
|
||||
auto request = std::make_shared<TerminationEvent>(
|
||||
faultyThread);
|
||||
@@ -199,5 +207,5 @@ void sscl::pptr::MarionetteComponent::exceptionInd()
|
||||
request.get(), request)));
|
||||
}
|
||||
|
||||
} // namespace pptr
|
||||
} // namespace sscl
|
||||
} // namespace mrntt
|
||||
} // namespace smo
|
||||
|
||||
Reference in New Issue
Block a user