2022-02-05 17:22:59 +01:00
|
|
|
#ifndef RCPP_FRAMEWORK_H
|
|
|
|
#define RCPP_FRAMEWORK_H
|
|
|
|
|
|
|
|
#include "core/string.h"
|
|
|
|
#include "core/containers/vector.h"
|
|
|
|
|
|
|
|
#include "core/object.h"
|
|
|
|
|
|
|
|
class RCPPFramework : Object {
|
|
|
|
RCPP_OBJECT(RCPPFramework, Object);
|
|
|
|
|
|
|
|
public:
|
2022-02-05 18:17:36 +01:00
|
|
|
// Helper methods to allocate and destroy the singleton.
|
|
|
|
// Note that creating / deleting an instance manually in your app will also work.
|
|
|
|
static void create();
|
|
|
|
static void destroy();
|
|
|
|
//Usie these if you don't want to mess with the default settings.
|
|
|
|
static void create_and_init();
|
|
|
|
static void create_and_init(int argc, char **argv, char **envp);
|
|
|
|
|
|
|
|
void initialize();
|
|
|
|
void uninitialize();
|
|
|
|
|
|
|
|
void setup_args(int argc, char **argv, char **envp);
|
2022-02-05 17:22:59 +01:00
|
|
|
|
|
|
|
void manage_object(Object* obj);
|
|
|
|
|
|
|
|
RCPPFramework();
|
|
|
|
~RCPPFramework();
|
|
|
|
|
|
|
|
static RCPPFramework *get_singleton();
|
|
|
|
|
|
|
|
protected:
|
2022-02-05 18:17:36 +01:00
|
|
|
virtual void _do_initialize();
|
|
|
|
virtual void _do_uninitialize();
|
|
|
|
|
|
|
|
bool _initialized;
|
|
|
|
|
2022-02-05 17:22:59 +01:00
|
|
|
Vector<Object *> _managed_objects;
|
|
|
|
|
|
|
|
static RCPPFramework *_instance;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|