libcyberradio  22.01.24
App Class Reference

Provides basic application functionality. More...

#include <App.h>

Public Member Functions

 App ()
 Constructs an App object.
 
virtual ~App ()
 Destroys an App object.
 
virtual int run (int argc, char *argv[])
 Runs the application. More...
 

Data Fields

std::string description
 The application description.
 
std::string version
 The application version.
 

Protected Member Functions

virtual void defineOptions (const char *argv0)
 Defines which command-line options are supported by the application, as well as any help text that is displayed. More...
 
virtual int mainLoop ()
 Defines the application's main processing loop. More...
 

Detailed Description

Provides basic application functionality.

Applications using this class as a base should override the following:

The entry point for running the application processing loop is run().

Definition at line 434 of file App.h.

Member Function Documentation

◆ defineOptions()

void defineOptions ( const char *  argv0)
protectedvirtual

Defines which command-line options are supported by the application, as well as any help text that is displayed.

The option parser, available through member variable _optParser, is an AppOptionParser object.

Parameters
argv0The name of the executable, as passed into the program via argv[0].

Definition at line 661 of file App.cpp.

◆ mainLoop()

int mainLoop ( )
protectedvirtual

Defines the application's main processing loop.

The base-class implementation of this method does nothing, and returns 0. Derived classes must override this method for the application to perform any useful work.

Definition at line 673 of file App.cpp.

◆ run()

int run ( int  argc,
char *  argv[] 
)
virtual

Runs the application.

Parameters
argcThe number of arguments specified on the command line, counting the executable name itself.
argvThe list of arguments specified on the command line, including the executable name itself.
Returns
An integer whose return value is passed up to the host operating system as a return code. This is application-dependent, but the following return codes are generated as a result of command-line argument/option processing:
  • 1 = error encountered in option processing
  • 2 = usage information was requested
  • 3 = version information was requested

Definition at line 652 of file App.cpp.


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