- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | List of all members
Main::Run Class Reference

A top-level class for the process. More...

`#include <run.h>`

Inheritance diagram for Main::Run:

## Public Member Functions
| Run (Output &output, const G::Arg &arg, const std::string &switch_spec)
| Constructor. Tries not to throw. More...
virtual | ~Run ()
| Destructor. More...
bool | hidden () const
| Returns true if the program should run in hidden mode. More...
bool | prepare ()
| Prepares to run() typically by parsing the commandline. More...
bool | prepareError () const
| Returns true if prepare() failed. More...
void | run ()
| Runs the application. More...
const Configuration & | config () const
| Returns a configuration object. More...
G::Signal3< std::string, std::string, std::string > & | signal ()
| Provides a signal which is activated when something changes. More...
virtual void | onException (std::exception &)
| Final override from GNet::EventHandler. More...

## Static Public Member Functions
static std::string | versionNumber ()
| Returns the application version number string. More...

## Detailed Description

A top-level class for the process.

Usage:

int main( int argc , char ** argv )
{
G::Arg arg( argc , argv ) ;
Output output ;
Main::Run run( output , arg , CommandLine::switchSpec() ) ;
if( run.prepare() )
run.run() ;
return 0 ;
}

Definition at line 71 of file run.h.

## Constructor & Destructor Documentation

Main::Run::Run | ( | Main::Output & | output,
|  | const G::Arg & | arg,
|  | const std::string & | switch_spec
| ) |  |

Constructor. Tries not to throw.

Definition at line 72 of file run.cpp.

References G::Signal2< P1, P2 >::connect(), GNet::ClientPtr< TClient >::doneSignal(), GNet::ClientPtr< TClient >::eventSignal(), and G::slot().

Main::Run::~Run | ( |  | ) |
| virtual

Destructor.

Definition at line 83 of file run.cpp.

## Member Function Documentation

const Main::Configuration & Main::Run::config | ( |  | ) | const

Returns a configuration object.

Definition at line 119 of file run.cpp.

bool Main::Run::hidden | ( |  | ) | const

Returns true if the program should run in hidden mode.

Definition at line 145 of file run.cpp.

void Main::Run::onException | ( | std::exception & | e | ) |
| virtual

Final override from GNet::EventHandler.

Implements GNet::EventHandler.

Definition at line 510 of file run.cpp.

References G_ERROR.

bool Main::Run::prepare | ( |  | ) |

Prepares to run() typically by parsing the commandline.

Error messages are sent to the Output interface. Returns true if run() should be called.

Definition at line 150 of file run.cpp.

References Main::Configuration::debug(), Main::Configuration::log(), Main::Configuration::logFile(), Main::Configuration::logTimestamp(), G::LogOutput::Mail, Main::Configuration::useSyslog(), and Main::Configuration::verbose().

Referenced by main().

bool Main::Run::prepareError | ( |  | ) | const

Returns true if prepare() failed.

Definition at line 114 of file run.cpp.

Referenced by main().

void Main::Run::run | ( |  | ) |

Runs the application.

Precondition: prepare() returned true

Definition at line 247 of file run.cpp.

References G_ERROR, and G_LOG.

Referenced by main().

G::Signal3< std::string, std::string, std::string > & Main::Run::signal | ( |  | ) |

Provides a signal which is activated when something changes.

Definition at line 654 of file run.cpp.

std::string Main::Run::versionNumber | ( |  | ) |
| static

Returns the application version number string.

Definition at line 67 of file run.cpp.

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

- run.h
- run.cpp