move utils to include. utils implimentations should be headers
This commit is contained in:
38
include/utils/Module/Module.h
Normal file
38
include/utils/Module/Module.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef MODULE_H
|
||||
#define MODULE_H
|
||||
|
||||
#include "pch.hpp"
|
||||
|
||||
namespace Archimedes {
|
||||
|
||||
class App;
|
||||
|
||||
class Module {
|
||||
|
||||
friend class App;
|
||||
|
||||
public:
|
||||
typedef Module* create_t(void*, App&);
|
||||
|
||||
Module(void* h, App& a) : handle(h), app(a) {};
|
||||
virtual ~Module() {}
|
||||
virtual void run() = 0;
|
||||
virtual void onLoad() = 0;
|
||||
|
||||
std::string getName() const { return name; }
|
||||
void* getHandle() { return handle; }
|
||||
|
||||
void setSelf(std::list<Module*>::iterator s) { self = s; }
|
||||
|
||||
protected:
|
||||
std::string name;
|
||||
void* handle;
|
||||
std::list<Module*>::iterator self;
|
||||
|
||||
App& app;
|
||||
|
||||
std::unordered_map<std::string, std::string> deps;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user