New upstream version 8.1.0
This commit is contained in:
7
meta/source/program/Main.cpp
Normal file
7
meta/source/program/Main.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#include "Program.h"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
return Program::main(argc, argv);
|
||||
}
|
||||
|
||||
23
meta/source/program/Program.cpp
Normal file
23
meta/source/program/Program.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <common/toolkit/BuildTypeTk.h>
|
||||
#include "Program.h"
|
||||
|
||||
App* Program::app = NULL;
|
||||
|
||||
int Program::main(int argc, char** argv)
|
||||
{
|
||||
BuildTypeTk::checkDebugBuildTypes();
|
||||
|
||||
AbstractApp::runTimeInitsAndChecks(); // must be called before creating a new App
|
||||
|
||||
app = new App(argc, argv);
|
||||
|
||||
app->startInCurrentThread();
|
||||
|
||||
int appRes = app->getAppResult();
|
||||
|
||||
delete app;
|
||||
|
||||
return appRes;
|
||||
}
|
||||
|
||||
|
||||
30
meta/source/program/Program.h
Normal file
30
meta/source/program/Program.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include <app/App.h>
|
||||
|
||||
|
||||
/**
|
||||
* Represents the static program. It creates an App object to represent the running instance of
|
||||
* the program and provides a getter for the App object.
|
||||
*/
|
||||
class Program
|
||||
{
|
||||
public:
|
||||
static int main(int argc, char** argv);
|
||||
|
||||
|
||||
private:
|
||||
Program() {}
|
||||
|
||||
static App* app;
|
||||
|
||||
|
||||
public:
|
||||
// getters & setters
|
||||
static App* getApp()
|
||||
{
|
||||
return app;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user