#include <hydranode.h>
Inheritance diagram for HydraNode:


Definition at line 109 of file hydranode.h.
Public Member Functions | |
| DECLARE_EVENT_TABLE (HydraNode *, HNEvent) | |
| void | init (int argc, char **argv) |
| Initialize HydraNode core. | |
| int | run (int argc, char **argv) |
| Runs the hydranode core, performing initialization, mainloop until exit command is received, and then cleanup. | |
| int | cleanup () |
| Called on shutdown, this method performs all cleanup and saving all settings. | |
| int | mainLoop () |
| Main event loop. | |
| void | doLoop () |
| Perform a single event loop. | |
| boost::filesystem::path | getConfigDir () |
| Accessor, retrieves configuration directory. | |
| void | exit () |
| Exit the application. | |
| uint32_t | getAppVer () const |
| Retrieve the application version. | |
| std::string | getAppVerLong () const |
| Get a human-readable application version string. | |
| bool | isRunning () const |
| Check if the application is running. | |
Static Public Member Functions | |
| static HydraNode & | instance () |
| Returns the single instance of this Singleton. | |
Private Member Functions | |
| boost::filesystem::path | checkCreateDir (boost::filesystem::path dir, const std::string &alt) |
| Check for directories existance, and create it if neccesery. | |
| void | onEvent (HydraNode *hn, HNEvent evt) |
| Event handler for our own events, used for some regular tasks. | |
Various initialization functions | |
| void | initConfig () |
| void | initLog () |
| void | initSockets () |
| void | initModules () |
| void | initFiles () |
Singleton | |
| HydraNode () | |
| Forbidden. | |
| HydraNode (const HydraNode &) | |
| Forbidden. | |
| HydraNode & | operator= (HydraNode &) |
| Forbidden. | |
| ~HydraNode () | |
| Forbidden. | |
Private Attributes | |
| bool | m_running |
| Keeps track if we are running. | |
| boost::filesystem::path | m_confDir |
| Global configuration directory. | |
| uint32_t | m_buildDate |
| Application binary build/modification date. | |
|
|
Forbidden. Note: Don't do initialization here. That's what run() member function is for. Definition at line 49 of file hydranode.cpp. |
|
|
Forbidden.
|
|
|
Forbidden.
Definition at line 50 of file hydranode.cpp. |
|
||||||||||||
|
Check for directories existance, and create it if neccesery.
Definition at line 128 of file hydranode.cpp. References logError(), and s_argv. Referenced by initConfig(). |
Here is the call graph for this function:

|
|
Called on shutdown, this method performs all cleanup and saving all settings.
Definition at line 104 of file hydranode.cpp. References SchedBase::exit(), getConfigDir(), MetaDb::instance(), FilesList::instance(), Prefs::instance(), SchedBase::instance(), ModManager::instance(), logMsg(), ModManager::onExit(), Config::save(), and FilesList::savePartFiles(). Referenced by run(). |
Here is the call graph for this function:

|
||||||||||||
|
|
|
|
Perform a single event loop.
Definition at line 314 of file hydranode.cpp. References EventMain::handlePending(), EventMain::instance(), and SocketWatcher::poll(). Referenced by mainLoop(). |
Here is the call graph for this function:

|
|
Exit the application.
Definition at line 167 of file hydranode.h. |
|
|
Retrieve the application version. The return value bytes are set as follows: [null] [major] [minor] [patch] Thus version 2.5.3 would return a 4-byte value with the following content: 0253 Definition at line 331 of file hydranode.cpp. References APPVER_MAJOR, APPVER_MINOR, and APPVER_PATCH. |
|
|
Get a human-readable application version string. The returned string is something like this: "HydraNode v0.4.6" Definition at line 335 of file hydranode.cpp. Referenced by initLog(). |
|
|
Accessor, retrieves configuration directory.
Definition at line 160 of file hydranode.h. Referenced by cleanup(), initFiles(), initLog(), and onEvent(). |
|
||||||||||||
|
Initialize HydraNode core.
Definition at line 58 of file hydranode.cpp. References Log::addPreStr(), Utils::getModDate(), initConfig(), initFiles(), initLog(), initModules(), initSockets(), Log::instance(), logMsg(), m_buildDate, m_running, onEvent(), Log::remPreStr(), s_argc, and s_argv. Referenced by run(). |
Here is the call graph for this function:

|
|
Definition at line 157 of file hydranode.cpp. References checkCreateDir(), Prefs::instance(), Config::load(), logMsg(), m_confDir, s_argv, and Config::write(). Referenced by init(). |
Here is the call graph for this function:

|
|
Definition at line 243 of file hydranode.cpp. References FilesList::addSharedDir(), FilesList::addTempDir(), EVT_SAVE_MDB, getConfigDir(), Prefs::instance(), MetaDb::instance(), FilesList::instance(), MetaDb::load(), logError(), logMsg(), METADB_SAVETIME, Config::read(), and Config::setPath(). Referenced by init(). |
Here is the call graph for this function:

|
|
Definition at line 208 of file hydranode.cpp. References Log::addLogFile(), getAppVerLong(), getConfigDir(), Log::instance(), logMsg(), and m_buildDate. Referenced by init(). |
Here is the call graph for this function:

|
|
Definition at line 319 of file hydranode.cpp. References Prefs::instance(), ModManager::instance(), ModManager::loadModule(), ModManager::onInit(), Config::read(), and Config::write(). Referenced by init(). |
Here is the call graph for this function:

|
|
Definition at line 234 of file hydranode.cpp. References SchedBase::instance(). Referenced by init(). |
Here is the call graph for this function:

|
|
Returns the single instance of this Singleton.
Definition at line 52 of file hydranode.cpp. Referenced by main(). |
|
|
Check if the application is running. This indicates whether the application is inside main loop, e.g. not starting up or shutting down. Definition at line 189 of file hydranode.h. |
|
|
Main event loop. This method enters HydraNode main loop, calling doLoop() until m_running is true, and then exits the application.
Definition at line 302 of file hydranode.cpp. References doLoop(), EVT_EXIT, EventMain::handlePending(), EventMain::initialize(), EventMain::instance(), and m_running. Referenced by run(). |
Here is the call graph for this function:

|
||||||||||||
|
Event handler for our own events, used for some regular tasks.
Definition at line 339 of file hydranode.cpp. References EVT_SAVE_MDB, getConfigDir(), MetaDb::instance(), FilesList::instance(), Prefs::instance(), logMsg(), METADB_SAVETIME, Config::save(), and FilesList::savePartFiles(). Referenced by init(). |
Here is the call graph for this function:

|
|
Forbidden.
|
|
||||||||||||
|
Runs the hydranode core, performing initialization, mainloop until exit command is received, and then cleanup.
Definition at line 98 of file hydranode.cpp. References cleanup(), init(), and mainLoop(). Referenced by main(). |
Here is the call graph for this function:

|
|
Application binary build/modification date.
Definition at line 224 of file hydranode.h. |
|
|
Global configuration directory.
Definition at line 221 of file hydranode.h. Referenced by initConfig(). |
|
|
Keeps track if we are running.
Definition at line 218 of file hydranode.h. Referenced by init(), and mainLoop(). |