make entryPoint a header
This commit is contained in:
41
src/example_apps/MinimalApp/MinimalApp.cpp
Normal file
41
src/example_apps/MinimalApp/MinimalApp.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
#include "MinimalApp.h"
|
||||
|
||||
namespace Archimedes {
|
||||
|
||||
|
||||
MinimalApp::MinimalApp() : App() {
|
||||
|
||||
}
|
||||
|
||||
MinimalApp::~MinimalApp() {
|
||||
|
||||
}
|
||||
|
||||
void MinimalApp::run() {
|
||||
std::cout << "\nTesting...\n";
|
||||
|
||||
for(auto* m : modules)
|
||||
m->onLoad();
|
||||
|
||||
for(auto* s : Archimedes::Module::GetModules())
|
||||
std::cout << "Module: " << (s ? *s : "nullptr") << std::endl;
|
||||
// Main loop
|
||||
while (!done && !modules.empty()) {
|
||||
|
||||
for(auto* m : modules) {
|
||||
m->run();
|
||||
}
|
||||
|
||||
for(auto it = toClose.begin(); it != toClose.end(); it++) {
|
||||
unload(it);
|
||||
}
|
||||
toClose.clear();
|
||||
|
||||
for(std::string s : toOpen) {
|
||||
load(s, getBlacklist());
|
||||
}
|
||||
toOpen.clear();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
32
src/example_apps/MinimalApp/MinimalApp.h
Normal file
32
src/example_apps/MinimalApp/MinimalApp.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef MINIMALAPP_H
|
||||
#define MINIMALAPP_H
|
||||
|
||||
#include "pch.hpp"
|
||||
#include "utils/App/App.h"
|
||||
#include "utils/Module/Module.h"
|
||||
|
||||
namespace Archimedes {
|
||||
|
||||
class MinimalApp : public App {
|
||||
|
||||
private:
|
||||
|
||||
void handleArgs(const int&, char*[]) {};
|
||||
|
||||
void printHelp() {};
|
||||
|
||||
public:
|
||||
MinimalApp();
|
||||
~MinimalApp();
|
||||
|
||||
void run();
|
||||
|
||||
void stopModule(std::list<Module*>::iterator);
|
||||
|
||||
void startModule(std::string);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,7 +0,0 @@
|
||||
#include "pch.hpp"
|
||||
#include "utils/App/App.h"
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
Archimedes::App app(argc, argv);
|
||||
app.run();
|
||||
}
|
||||
17
src/pch.hpp
17
src/pch.hpp
@@ -1,17 +0,0 @@
|
||||
#ifndef PCH_HPP
|
||||
#define PCH_HPP
|
||||
|
||||
#include <iostream>
|
||||
#include <cstring>
|
||||
#include <list>
|
||||
#include <array>
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <optional>
|
||||
//#include <chrono>
|
||||
//#include <thread>
|
||||
|
||||
#include <dlfcn.h>
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user