782bcd4567
This change enables us to finally implement the tracing of continuations backward from the point of acquisition for deadlock debugging.
60 lines
1018 B
C++
60 lines
1018 B
C++
#ifndef COMPONENT_H
|
|
#define COMPONENT_H
|
|
|
|
#include <config.h>
|
|
#include <memory>
|
|
#include <functional>
|
|
#include <callback.h>
|
|
|
|
namespace smo {
|
|
|
|
class Mind;
|
|
class ComponentThread;
|
|
|
|
class Component
|
|
{
|
|
public:
|
|
Component(const std::shared_ptr<ComponentThread> &thread);
|
|
~Component() = default;
|
|
|
|
public:
|
|
std::shared_ptr<ComponentThread> thread;
|
|
|
|
public:
|
|
};
|
|
|
|
class MindComponent
|
|
: public Component
|
|
{
|
|
public:
|
|
MindComponent(Mind &parent, const std::shared_ptr<ComponentThread> &thread);
|
|
~MindComponent() = default;
|
|
|
|
public:
|
|
Mind &parent;
|
|
};
|
|
|
|
namespace mrntt {
|
|
|
|
class MarionetteComponent
|
|
: public Component
|
|
{
|
|
public:
|
|
MarionetteComponent(const std::shared_ptr<ComponentThread> &thread);
|
|
~MarionetteComponent() = default;
|
|
|
|
public:
|
|
typedef std::function<void(bool)> mrnttLifetimeMgmtOpCbFn;
|
|
void initializeReq(Callback<mrnttLifetimeMgmtOpCbFn> callback);
|
|
void finalizeReq(Callback<mrnttLifetimeMgmtOpCbFn> callback);
|
|
|
|
private:
|
|
class MrnttLifetimeMgmtOp;
|
|
};
|
|
|
|
} // namespace mrntt
|
|
|
|
} // namespace smo
|
|
|
|
#endif // COMPONENT_H
|