GetName(), GetVersion(), GetParameterUsage(), and
Process().
NULL if
the constructor has never been called. Since well-behaved applications
begin processing via Main(), this should not happen.
inline int GetExitCode(void) const
Return the exit code.
inline WBA_Environment *GetEnvironment(void)
Return the environment.
inline GPL_Logger *GetLogger(void)
Return the logging mechanism.
virtual const char *GetName(void) const = 0
Return the application name.
const char *GetProgramName(void) const
Return the name of the program as it was invoked (e.g., /foo/bar).
WBA_ApplicationId GetId(void) const
Return the application ID.
virtual const GPL_Version & GetVersion(void) const
Return the application version.
virtual const char *GetBuildString(void) const
Return the application build string.
virtual const char *GetUsage(void) const
Return the application usage.
virtual const char *DumpEnvironment(void) const
Return the string which is a dump of the application environment.
virtual const char *GetParameterUsage(void) const = 0
Return the application usage of parameters.
virtual void SetExitCode(const int e)
Set exitCode to e.
virtual void Printf(char *format, ...)
Print on the application's standard error output device the string
described by format and the zero or more arguments following it.
format and the arguments should be suitable for osdSPrintf().
virtual int Main(void)
Calls Initialize(), Process(), and Finalize().
Returns exitCode.
virtual GPL_Boolean Initialize(void)
Perform initialization. This method will be called once at start-up and
whenever the application performs re-initialization (e.g., SIGHUP).
Return TRUE if initialization succeeds, FALSE if initialization
fails.
virtual void Finalize(void)
Perform finalization. This method will be called once at shut-down.
virtual void Exit(void)
Exit the process, setting the process exit code to
WBA_Application::exitCode.
virtual void Process(void) = 0
Perform the main functionality of the application. This function is
responsible for setting exitCode.
WBA_Application::Main().
WBA_Environment *environment
Execution environment.
GPL_Logger *logger
Logging mechanism.
OSD_Output standardError
Standard error output device.
GPL_Version version
Version.
static WBA_Application *singleton
Current application.
| WBA_APP | Macro for the current application as defined by
WBA_Application::GetCurrentApplication(). |
| WBA_ENV | Macro for the current environment as defined by
(*(WBA_ENV.GetArgumentTable())) |
| WBA_ARGS | Macro for the current argument table within the environment as defined by
*(WBA_Application::GetCurrentApplication()->)
code(environment.GetArgumentTable()). |