#include <application.h>
Inherited by ApplicationClient, and ApplicationServer.
Inheritance diagram for Application:


Public Member Functions | |
| Application () | |
| virtual | ~Application ()=0 |
| virtual void | init ()=0 |
| Inicialization of application. | |
| virtual void | run ()=0 |
| virtual void | clean ()=0 |
| virtual Game * | getGameCommon ()=0 |
| Get pointer to Game. | |
| virtual Commander & | getCommander ()=0 |
| Provide access to the commander. | |
| virtual TaskManager & | getTaskManager () |
| Provide access to task manager. | |
Protected Member Functions | |
| void | loadUserConfigFile (const char *file, const char *file_template) |
| Load user config file. | |
| void | saveUserConfigFile (const char *file, const char *file_template) |
Protected Attributes | |
| TaskManager | mTaskManager |
| global version of task manager | |
Private Member Functions | |
| void | initBasicSubsystems () |
| Does some basic inicialization. | |
| void | cleanBasicSubsystems () |
| Clean what initBasicSubsystems inicialized. | |
It serves as some kind of interface. For example if we will need application to provide something to common objects, we may use this. And Martin wished to have this class :-) This is abstract class that can't be created directly. It should only be usede as base class for ApplicationServer and/or ApplicationClient.
Definition at line 31 of file application.h.
|
|
Definition at line 18 of file application.cpp. References initBasicSubsystems(). Here is the call graph for this function: ![]() |
|
|
Definition at line 23 of file application.cpp. References cleanBasicSubsystems(). Here is the call graph for this function: ![]() |
|
|
Implemented in ApplicationClient, and ApplicationServer. |
|
|
Clean what initBasicSubsystems inicialized. quit SDL. Definition at line 57 of file application.cpp. References TIN. Referenced by ~Application(). |
|
|
Provide access to the commander. This may be used to push commands to commander anywhere from the code. Implemented in ApplicationClient, and ApplicationServer. |
|
|
Get pointer to Game. If you are in client or server code use getGame() which return server or client version of Game so you have acces to more features :-) Please never retype this GameClient or GameServer.
Implemented in ApplicationClient, and ApplicationServer. Referenced by World::createProjectile(), World::createTank(), Tank::initSpecific(), and Projectile::initSpecific(). |
|
|
Provide access to task manager. This task manager groups all task that needed to be called periodicaly. So if you have some loop you should call app.getTaskManager().update(); Or if you have you own task manager you may add it as task to your manager. Definition at line 102 of file application.cpp. References mTaskManager. |
|
|
Inicialization of application.
Implemented in ApplicationClient, and ApplicationServer. Referenced by main(). |
|
|
Does some basic inicialization. Loads settings, inicialize loging, inicialize SDL. clean for this inicialization is in cleanBasicSubsystems() Should be called early in application. Better it should be the first executed code - it is called in contructor of Application so it is quite early. It is important becase it sets up loging and loads configuration, co other objects may read variables in contructor from settings. Definition at line 28 of file application.cpp. References DIE(), g_settings, g_translator, Settings::getString(), gParams, Params::load(), Translator::loadFile(), Settings::loadSettings(), locateFile(), LOGE, LOGI, MAIN_SETTING_FILE, and TIN. Referenced by Application(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Load user config file. Create if doesn't exist
Definition at line 67 of file application.cpp. References checkConfigFile(), g_settings, Settings::getString(), Settings::loadSettings(), locateFile(), and LOGE. Referenced by ApplicationServer::init(), and ApplicationClient::init(). Here is the call graph for this function: ![]() |
|
|
Implemented in ApplicationClient, and ApplicationServer. |
|
||||||||||||
|
Definition at line 85 of file application.cpp. References checkConfigFile(), g_settings, Settings::getString(), locateFile(), LOGE, and Settings::saveSettings(). Referenced by ApplicationServer::clean(), and ApplicationClient::clean(). Here is the call graph for this function: ![]() |
|
|
global version of task manager
Definition at line 110 of file application.h. Referenced by getTaskManager(), ApplicationServer::init(), and ApplicationClient::init(). |
1.4.5