61 lines
1.4 KiB
C++
61 lines
1.4 KiB
C++
#ifndef _MIND_H
|
|
#define _MIND_H
|
|
|
|
#include <config.h>
|
|
#include <functional>
|
|
#include <memory>
|
|
#include <string>
|
|
#include <spinscale/callback.h>
|
|
|
|
#include <spinscale/puppetApplication.h>
|
|
#include <spinscale/component.h>
|
|
#include <componentThread.h>
|
|
#include <mindThread.h>
|
|
#include <director/director.h>
|
|
#include <simulator/simulator.h>
|
|
#include <body/body.h>
|
|
|
|
namespace smo {
|
|
|
|
class Mind
|
|
: public sscl::PuppetApplication
|
|
{
|
|
public:
|
|
Mind(void);
|
|
~Mind(void) = default;
|
|
|
|
typedef std::function<void(bool)> mindLifetimeMgmtOpCbFn;
|
|
void initializeReq(sscl::Callback<mindLifetimeMgmtOpCbFn> callback);
|
|
void finalizeReq(sscl::Callback<mindLifetimeMgmtOpCbFn> callback);
|
|
|
|
// ComponentThread access methods
|
|
std::shared_ptr<MindThread> getComponentThread(sscl::ThreadId id) const;
|
|
std::shared_ptr<MindThread> getComponentThread(
|
|
const std::string& name) const;
|
|
// Get all this Mind's component threads.
|
|
std::vector<std::shared_ptr<MindThread>> getMindThreads() const;
|
|
|
|
public:
|
|
director::Director director;
|
|
simulator::Simulator canvas;
|
|
sscl::PuppetComponent subconscious;
|
|
body::Body body;
|
|
sscl::PuppetComponent world;
|
|
|
|
private:
|
|
friend class body::Body;
|
|
bool bodyComponentInitialized = false;
|
|
|
|
private:
|
|
class MindLifetimeMgmtOp;
|
|
};
|
|
|
|
namespace mind {
|
|
// Global Mind instance will be defined in marionette.cpp
|
|
extern std::shared_ptr<Mind> globalMind;
|
|
} // namespace mind
|
|
|
|
} // namespace smo
|
|
|
|
#endif
|