Main::Run Class Reference

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

#include <run.h>

Inheritance diagram for Main::Run:

GNet::EventHandler

List of all members.

Public Member Functions

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

Static Public Member Functions

static std::string versionNumber ()
 Returns the application version number string.


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 62 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]


Member Function Documentation

bool Main::Run::hidden (  )  const

Returns true if the program should run in hidden mode.

Definition at line 123 of file run.cpp.

References Main::CommandLine::contains().

bool Main::Run::prepare (  ) 

bool Main::Run::prepareError (  )  const

Returns true if prepare() failed.

Definition at line 92 of file run.cpp.

Referenced by main().

void Main::Run::run (  ) 

Runs the application.

Precondition: prepare() returned true

Definition at line 186 of file run.cpp.

References G_ERROR, and G_LOG.

Referenced by main().

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

Returns a configuration object.

Definition at line 97 of file run.cpp.

Referenced by prepare().

std::string Main::Run::versionNumber (  )  [static]

Returns the application version number string.

Definition at line 57 of file run.cpp.

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

Provides a signal which is activated when something changes.

Definition at line 616 of file run.cpp.

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

Final override from GNet::EventHandler.

Implements GNet::EventHandler.

Definition at line 469 of file run.cpp.

References G_ERROR.


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

Generated on Fri Apr 18 15:56:14 2008 for E-MailRelay by  doxygen 1.5.5