Windows C++ Library
|
The base class for Console type applications. More...
#include <ConsoleApp.hpp>
Public Member Functions | |
ConsoleApp () | |
Default constructor. | |
virtual | ~ConsoleApp () |
Destructor. | |
CMainThread & | mainThread () |
Get the main thread. | |
bool | abort () const |
Get if the app should terminate. | |
virtual int | main (int argc, tchar *argv[], tistream &in, tostream &out, tostream &err) |
The application C++ entry point. | |
Static Public Member Functions | |
static ConsoleApp & | instance () |
Get the singleton object. | |
Protected Member Functions | |
virtual int | run (int nArgc, tchar *apszArgv[], tistream &in, tostream &out, tostream &err)=0 |
Run the application. | |
virtual void | showUsage (tostream &out)=0 |
Display the program options syntax. | |
virtual BOOL | onCtrlSignal (DWORD signal) |
The ctrl signal handler. | |
Static Protected Member Functions | |
static BOOL WINAPI | ctrlHandler (DWORD signal) |
The actual ctrl signal handler. | |
Protected Attributes | |
CMainThread | m_mainThread |
The main application thread. | |
volatile bool | m_abort |
The flag to signal aborting of the app. |
The base class for Console type applications.
Default constructor.
WCL::ConsoleApp::~ConsoleApp | ( | ) | [virtual] |
Destructor.
CMainThread & WCL::ConsoleApp::mainThread | ( | ) | [inline] |
Get the main thread.
bool WCL::ConsoleApp::abort | ( | ) | const [inline] |
Get if the app should terminate.
ConsoleApp & WCL::ConsoleApp::instance | ( | ) | [static] |
Get the singleton object.
int WCL::ConsoleApp::main | ( | int | argc, |
tchar * | argv[], | ||
tistream & | in, | ||
tostream & | out, | ||
tostream & | err | ||
) | [virtual] |
The application C++ entry point.
This should be invoked by the C based entry point to run the application.
virtual int WCL::ConsoleApp::run | ( | int | nArgc, |
tchar * | apszArgv[], | ||
tistream & | in, | ||
tostream & | out, | ||
tostream & | err | ||
) | [protected, pure virtual] |
Run the application.
virtual void WCL::ConsoleApp::showUsage | ( | tostream & | out | ) | [protected, pure virtual] |
Display the program options syntax.
BOOL WINAPI WCL::ConsoleApp::ctrlHandler | ( | DWORD | signal | ) | [static, protected] |
The actual ctrl signal handler.
BOOL WCL::ConsoleApp::onCtrlSignal | ( | DWORD | signal | ) | [protected, virtual] |
The ctrl signal handler.
CMainThread WCL::ConsoleApp::m_mainThread [protected] |
The main application thread.
volatile bool WCL::ConsoleApp::m_abort [protected] |
The flag to signal aborting of the app.