Windows C++ Library
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes
WCL::ConsoleApp Class Reference

The base class for Console type applications. More...

#include <ConsoleApp.hpp>

List of all members.

Public Member Functions

 ConsoleApp ()
 Default constructor.
virtual ~ConsoleApp ()
 Destructor.
CMainThreadmainThread ()
 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 ConsoleAppinstance ()
 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.

Detailed Description

The base class for Console type applications.


Constructor & Destructor Documentation

Default constructor.

Destructor.


Member Function Documentation

Get the main thread.

bool WCL::ConsoleApp::abort ( ) const [inline]

Get if the app should terminate.

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.


Member Data Documentation

The main application thread.

volatile bool WCL::ConsoleApp::m_abort [protected]

The flag to signal aborting of the app.


The documentation for this class was generated from the following files: