TC::Application Class Reference
[Base Classes and Functions]

Base class for all applications Class stores and reads settings form application.init file Class stores, handles and reads messages from files. More...

#include <TCApplication.h>

Inheritance diagram for TC::Application:

Inheritance graph
[legend]
Collaboration diagram for TC::Application:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Application ()
 default constructor
virtual ~Application ()
 destructor
virtual void Init (sint32 numArg, char **argv, const std::string &name, const std::string &version)
 Init the app.
const std::string & GetProgrammName () const
const std::string & GetProgrammVersion () const
void ErrorMessage (const std::string &routineName, const char *message_id,...)
 displays an error message methode sets up the message string and calls with this displayErrorMessage if m_display_std_out is on the message is also written to the standart output
void WarningMessage (const std::string &routineName, const char *message_id,...)
 displays an warning message methode sets up the message string and calls with this displayWarningMessage if m_display_std_out is on the message is also written to the standart output
void InfoMessage (const std::string &routineName, const char *message_id,...)
 displays an info message methode sets up the message string and calls with this displayInfoMessage if m_display_std_out is on the message is also written to the standart output
void ErrorMessageBox (const std::string &routineName, const char *message_id,...)
 displays an error message box methode sets up the message string and calls with this displayErrorMessageBox if m_display_std_out is on the message is also written to the standart output
void WarningMessageBox (const std::string &routineName, const char *message_id,...)
 displays an warning message box methode sets up the message string and calls with this displayWarningMessageBox if m_display_std_out is on the message is also written to the standart output
void AlwaysStdOut (bool output)
 set if messages should also be displayed on standart output

Static Public Member Functions

static ApplicationGetInstance ()

Protected Member Functions

void displayUsage ()
std::string getMessageOfId (const char *message_id, va_list arguments)
virtual void processArguments (const std::vector< std::string > &)
virtual std::string getUsage ()
virtual void displayErrorMessage (const std::string &, const std::string &)
virtual void displayWarningMessage (const std::string &, const std::string &)
virtual void displayInfoMessage (const std::string &, const std::string &)
virtual void displayErrorMessageBox (const std::string &routineName, const std::string &message)
virtual void displayWarningMessageBox (const std::string &routineName, const std::string &message)

Protected Attributes

std::vector< std::string > m_programm_arguments
std::string m_programm_name
std::string m_programm_version
bool m_display_std_out

Static Private Attributes

static Applicationm_application


Detailed Description

Base class for all applications Class stores and reads settings form application.init file Class stores, handles and reads messages from files.

Author:
Thomas Goessler

Definition at line 67 of file TCApplication.h.


Constructor & Destructor Documentation

TC::Application::Application (  ) 

default constructor

virtual TC::Application::~Application (  )  [virtual]

destructor


Member Function Documentation

virtual void TC::Application::Init ( sint32  numArg,
char **  argv,
const std::string &  name,
const std::string &  version 
) [virtual]

Init the app.

static Application* TC::Application::GetInstance (  )  [static]

Returns:
the one and only existing BaseApplication object

const std::string& TC::Application::GetProgrammName (  )  const [inline]

Returns:
the name of the program e.g. TC

Definition at line 83 of file TCApplication.h.

const std::string& TC::Application::GetProgrammVersion (  )  const [inline]

Returns:
the version of the program e.g. 1.0

Definition at line 85 of file TCApplication.h.

void TC::Application::ErrorMessage ( const std::string &  routineName,
const char *  message_id,
  ... 
)

displays an error message methode sets up the message string and calls with this displayErrorMessage if m_display_std_out is on the message is also written to the standart output

Parameters:
routineName name of the methode or file where the message is called from
messID message id for finding the message in the loaded messages

void TC::Application::WarningMessage ( const std::string &  routineName,
const char *  message_id,
  ... 
)

displays an warning message methode sets up the message string and calls with this displayWarningMessage if m_display_std_out is on the message is also written to the standart output

Parameters:
routineName name of the methode or file where the message is called from
messID message id for finding the message in the loaded messages

void TC::Application::InfoMessage ( const std::string &  routineName,
const char *  message_id,
  ... 
)

displays an info message methode sets up the message string and calls with this displayInfoMessage if m_display_std_out is on the message is also written to the standart output

Parameters:
routineName name of the methode or file where the message is called from
messID message id for finding the message in the loaded messages

void TC::Application::ErrorMessageBox ( const std::string &  routineName,
const char *  message_id,
  ... 
)

displays an error message box methode sets up the message string and calls with this displayErrorMessageBox if m_display_std_out is on the message is also written to the standart output

Parameters:
routineName name of the methode or file where the message is called from
messID message id for finding the message in the loaded messages

void TC::Application::WarningMessageBox ( const std::string &  routineName,
const char *  message_id,
  ... 
)

displays an warning message box methode sets up the message string and calls with this displayWarningMessageBox if m_display_std_out is on the message is also written to the standart output

Parameters:
routineName name of the methode or file where the message is called from
messID message id for finding the message in the loaded messages

void TC::Application::AlwaysStdOut ( bool  output  )  [inline]

set if messages should also be displayed on standart output

Parameters:
output true or false if it should be displayed

Definition at line 131 of file TCApplication.h.

void TC::Application::displayUsage (  )  [protected]

std::string TC::Application::getMessageOfId ( const char *  message_id,
va_list  arguments 
) [protected]

virtual void TC::Application::processArguments ( const std::vector< std::string > &   )  [inline, protected, virtual]

Definition at line 138 of file TCApplication.h.

virtual std::string TC::Application::getUsage (  )  [inline, protected, virtual]

Definition at line 139 of file TCApplication.h.

virtual void TC::Application::displayErrorMessage ( const std::string &  ,
const std::string &   
) [inline, protected, virtual]

Definition at line 141 of file TCApplication.h.

virtual void TC::Application::displayWarningMessage ( const std::string &  ,
const std::string &   
) [inline, protected, virtual]

Definition at line 143 of file TCApplication.h.

virtual void TC::Application::displayInfoMessage ( const std::string &  ,
const std::string &   
) [inline, protected, virtual]

Definition at line 145 of file TCApplication.h.

virtual void TC::Application::displayErrorMessageBox ( const std::string &  routineName,
const std::string &  message 
) [inline, protected, virtual]

Definition at line 147 of file TCApplication.h.

virtual void TC::Application::displayWarningMessageBox ( const std::string &  routineName,
const std::string &  message 
) [inline, protected, virtual]

Definition at line 149 of file TCApplication.h.


Member Data Documentation

std::vector< std::string > TC::Application::m_programm_arguments [protected]

Definition at line 150 of file TCApplication.h.

std::string TC::Application::m_programm_name [protected]

Definition at line 155 of file TCApplication.h.

std::string TC::Application::m_programm_version [protected]

Definition at line 156 of file TCApplication.h.

Definition at line 158 of file TCApplication.h.

Definition at line 161 of file TCApplication.h.


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

Copyright (c) Thomas Goessler 2003 - 2008