mirror of
https://github.com/latentPrion/libspinscale.git
synced 2026-01-11 20:29:35 +00:00
Initial commit of libspinscale library
This commit is contained in:
58
include/spinscale/marionette.h
Normal file
58
include/spinscale/marionette.h
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user