91ccd16b33
This makes the initialization sequence much cleaner and conceptually well encapsulated. We also now dynamically allocate the Mind objects. They're allocated dynamically by Mrntt inside of initializeReq. This means that we no longer have to worry about jolting and cleaning up the running threads of global mind object even when we never explicitly called Mind.initializeReq. Along with other conceptual improvements to our abstractions, this patch also gets us to a real "end of program initialization" point for the first time.
33 lines
592 B
C++
33 lines
592 B
C++
#ifndef _BODY_COMPONENT_H
|
|
#define _BODY_COMPONENT_H
|
|
|
|
#include <component.h>
|
|
#include <functional>
|
|
|
|
namespace smo {
|
|
|
|
class Mind;
|
|
class ComponentThread;
|
|
|
|
namespace body {
|
|
|
|
class Body
|
|
: public MindComponent
|
|
{
|
|
public:
|
|
Body(Mind &parent, const std::shared_ptr<ComponentThread> &thread);
|
|
~Body() = default;
|
|
|
|
typedef std::function<void(bool)> bodyLifetimeMgmtOpCbFn;
|
|
void initializeReq(bodyLifetimeMgmtOpCbFn callback);
|
|
void finalizeReq(bodyLifetimeMgmtOpCbFn callback);
|
|
|
|
private:
|
|
class InitializeReq;
|
|
class FinalizeReq;
|
|
};
|
|
|
|
} // namespace body
|
|
} // namespace smo
|
|
|
|
#endif // _BODY_COMPONENT_H
|