OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
BESApp Class Referenceabstract

Application class for BES applications. More...

#include <BESApp.h>

Inheritance diagram for BESApp:
Inheritance graph
Collaboration diagram for BESApp:
Collaboration graph

Public Member Functions

string appName (void) const
 Returns the name of the application. More...
 
virtual void dump (ostream &strm) const =0
 dumps information about this object More...
 
virtual int initialize (int argC, char **argV)=0
 Initialize the application using the passed argc and argv values. More...
 
virtual int main (int argC, char **argV)=0
 main routine, the main entry point for any BES applications. More...
 
virtual int run (void)=0
 The body of the application, implementing the primary functionality of the BES application. More...
 
virtual int terminate (int sig=0)=0
 Clean up after the application. More...
 
virtual ~BESApp ()
 

Static Public Member Functions

static BESAppTheApplication (void)
 Returns the BESApp application object for this application. More...
 

Protected Member Functions

 BESApp (void)
 

Protected Attributes

string _appName
 
bool _debug
 
bool _isInitialized
 

Static Protected Attributes

static BESApp_theApplication = 0
 

Detailed Description

Application class for BES applications.

This class represents the application class for any BES applications. It provides information about the application, such as any parameters passed to the application, the name of the application, debugging for the application, etc...

This is a pure abstract class, not even main is implemented. It is up to the derived class to implement main, initialize, run, and terminate.

Provides a static method to retrieve the BESApp instance being used for this application.

See also
BESObj

Definition at line 57 of file BESApp.h.

Constructor & Destructor Documentation

◆ BESApp()

BESApp::BESApp ( void  )
inlineprotected

Definition at line 64 of file BESApp.h.

◆ ~BESApp()

virtual BESApp::~BESApp ( )
inlinevirtual

Definition at line 68 of file BESApp.h.

References dump(), initialize(), main(), run(), and terminate().

Here is the call graph for this function:

Member Function Documentation

◆ appName()

string BESApp::appName ( void  ) const
inline

Returns the name of the application.

The name of the application is typically argv[0] passed into the main function. But could be passed into the application or derived in a different way.

Returns
name of the application

Definition at line 132 of file BESApp.h.

References _appName.

Referenced by BESBaseApp::dump(), ServerApp::initialize(), CmdApp::signalBrokenPipe(), CmdApp::signalCannotConnect(), CmdApp::signalInterrupt(), CmdApp::signalTerminate(), CmdApp::~CmdApp(), and StandAloneApp::~StandAloneApp().

◆ dump()

virtual void BESApp::dump ( ostream &  strm) const
pure virtual

dumps information about this object

Displays information about this object, typically for debugging purposes.

Parameters
strmC++ i/o stream to dump the information to

Implements BESObj.

Implemented in BESModuleApp, CmdApp, BESBaseApp, ServerApp, and StandAloneApp.

Referenced by ~BESApp().

◆ initialize()

virtual int BESApp::initialize ( int  argC,
char **  argV 
)
pure virtual

Initialize the application using the passed argc and argv values.

It is up to the derived classes of BESApp to implement the initialize method.

Parameters
argCnumber of arguments passed to the application, which is argc passed to the main function.
argVarguments passed to the application, which is argv passed to the main function.

Implemented in BESModuleApp, CmdApp, BESBaseApp, ServerApp, and StandAloneApp.

Referenced by ~BESApp().

◆ main()

virtual int BESApp::main ( int  argC,
char **  argV 
)
pure virtual

main routine, the main entry point for any BES applications.

It is up to the derived classes of BESApp to implement the main routine. However, the main method should call initialize, run and terminate in that order and should pass to the initialize routine the arguments argc and argv passed to the main function.

Parameters
argCnumber of arguments passed to the application, which is argc passed to the main function.
argVarguments passed to the application, which is argv passed to the main function.

Implemented in BESBaseApp.

Referenced by ~BESApp().

◆ run()

virtual int BESApp::run ( void  )
pure virtual

The body of the application, implementing the primary functionality of the BES application.

It is up to the derived classes of BESApp to implement the run method.

Implemented in CmdApp, BESBaseApp, ServerApp, and StandAloneApp.

Referenced by ~BESApp().

◆ terminate()

virtual int BESApp::terminate ( int  sig = 0)
pure virtual

Clean up after the application.

It is up to the derived classes of BESApp to implement the terminate method. Memory cleanup, file descriptor cleanup, etc... might go in this method.

Parameters
sigif the applicaiton is terminating due to a signal, pass the signal to terminate routine.

Implemented in BESModuleApp, BESBaseApp, ServerApp, and StandAloneApp.

Referenced by ServerApp::signalInterrupt(), ServerApp::signalRestart(), ServerApp::signalTerminate(), and ~BESApp().

◆ TheApplication()

static BESApp* BESApp::TheApplication ( void  )
inlinestatic

Returns the BESApp application object for this application.

Returns
The application object

Definition at line 138 of file BESApp.h.

References _theApplication.

Referenced by ServerApp::initialize(), CmdApp::signalBrokenPipe(), CmdApp::signalCannotConnect(), ServerApp::signalInterrupt(), CmdApp::signalInterrupt(), ServerApp::signalRestart(), ServerApp::signalTerminate(), and CmdApp::signalTerminate().

Member Data Documentation

◆ _appName

string BESApp::_appName
protected

Definition at line 60 of file BESApp.h.

Referenced by appName(), and BESBaseApp::main().

◆ _debug

bool BESApp::_debug
protected

Definition at line 61 of file BESApp.h.

◆ _isInitialized

bool BESApp::_isInitialized
protected

Definition at line 62 of file BESApp.h.

Referenced by BESBaseApp::dump(), BESBaseApp::initialize(), and BESBaseApp::terminate().

◆ _theApplication

BESApp * BESApp::_theApplication = 0
staticprotected

Definition at line 63 of file BESApp.h.

Referenced by TheApplication().


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