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
@@ -4,7 +4,7 @@
#include <functional>
#include <memory>
#include <exception>
#include <componentThread.h>
#include <spinscale/componentThread.h>
#include <spinscale/callback.h>
#include <spinscale/callableTracer.h>
#include <spinscale/asynchronousContinuationChainLink.h>
@@ -154,19 +154,14 @@ public:
class ThreadLifetimeMgmtOp;
};
} // namespace sscl
namespace smo {
namespace mrntt {
extern std::shared_ptr<sscl::MarionetteThread> thread;
} // namespace mrntt
} // namespace smo
extern std::shared_ptr<MarionetteThread> thread;
// Forward declaration for sscl namespace functions and variables
// Forward declaration for marionette thread ID management
// Must be after sscl namespace so ThreadId is defined
namespace sscl {
extern sscl::ThreadId marionetteThreadId;
void setMarionetteThreadId(sscl::ThreadId id);
extern ThreadId marionetteThreadId;
void setMarionetteThreadId(ThreadId id);
} // namespace mrntt
}
#endif // COMPONENT_THREAD_H
@@ -0,0 +1,58 @@
#ifndef _MARIONETTE_H
#define _MARIONETTE_H
#include <cstdint>
#include <atomic>
#include <memory>
#include <spinscale/component.h>
namespace sscl {
class MarionetteThread;
namespace mrntt {
class MarionetteComponent
: public sscl::Component
{
public:
MarionetteComponent(const std::shared_ptr<sscl::ComponentThread> &thread);
~MarionetteComponent() = default;
public:
typedef std::function<void(bool)> mrnttLifetimeMgmtOpCbFn;
void initializeReq(sscl::Callback<mrnttLifetimeMgmtOpCbFn> callback);
void finalizeReq(sscl::Callback<mrnttLifetimeMgmtOpCbFn> callback);
// Intentionally doesn't take a callback.
void exceptionInd();
private:
class MrnttLifetimeMgmtOp;
class TerminationEvent;
};
extern std::shared_ptr<sscl::MarionetteThread> thread;
extern std::atomic<int> exitCode;
void exitMarionetteLoop();
void marionetteFinalizeReqCb(bool success);
extern MarionetteComponent mrntt;
} // namespace mrntt
struct CrtCommandLineArgs
{
CrtCommandLineArgs(int argc, char *argv[], char *envp[])
: argc(argc), argv(argv), envp(envp)
{}
int argc;
char **argv;
char **envp;
static void set(int argc, char *argv[], char *envp[]);
};
} // namespace sscl
#endif // _MARIONETTE_H
@@ -7,7 +7,7 @@
#include <chrono>
#include <iostream>
#include <optional>
#include <componentThread.h>
#include <spinscale/componentThread.h>
#include <spinscale/lockSet.h>
#include <spinscale/asynchronousContinuation.h>
#include <spinscale/lockerAndInvokerBase.h>