bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
|
Application class for BES applications. More...
#include <BESApp.h>
Public Member Functions | |
std::string | appName () const |
Returns the name of the application. | |
void | dump (std::ostream &strm) const override=0 |
dumps information about this object | |
virtual int | initialize (int argC, char **argV) |
Initialize the application using the passed argc and argv values. | |
virtual int | main (int argC, char **argV) |
main routine, the main entry point for any BES applications. | |
virtual int | run () |
The body of the application, implementing the primary functionality of the BES application. | |
virtual int | terminate (int sig=0) |
Clean up after the application. | |
Static Public Member Functions | |
static BESApp * | TheApplication () |
Returns the BESApp application object for this application. | |
Protected Attributes | |
std::string | _appName |
bool | _debug {false} |
bool | _isInitialized {false} |
Static Protected Attributes | |
static BESApp * | _theApplication = nullptr |
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.
|
inline |
|
overridepure virtual |
dumps information about this object
Displays information about this object, typically for debugging purposes.
strm | C++ i/o stream to dump the information to |
Displays the pointer value of this instance along with the name of the application, whether the application is initialized or not
strm | C++ i/o stream to dump the information to |
Implements BESObj.
Implemented in BESModuleApp, CmdApp, ServerApp, and StandAloneApp.
Initialize the application using the passed argc and argv values.
initialize the BES application
It is up to the derived classes of BESApp to implement the initialize method.
argC | number of arguments passed to the application, which is argc passed to the main function. |
argV | arguments passed to the application, which is argv passed to the main function. |
argC | argc value passed to the main function |
argV | argv value passed to the main function |
BESError | if any exceptions or errors are encountered |
Reimplemented in BESModuleApp, CmdApp, ServerApp, and StandAloneApp.
main routine, the main entry point for any BES applications.
main method of the BES application
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.
argC | number of arguments passed to the application, which is argc passed to the main function. |
argV | arguments passed to the application, which is argv passed to the main function. |
sets the appName to argv[0], then calls initialize, run, and terminate in that order. Exceptions should be caught in the individual methods initialize, run and terminate and handled there.
argC | argc value passed to the main function |
argV | argv value passed to the main function |
|
virtual |
The body of the application, implementing the primary functionality of the BES application.
the applications functionality is implemented in the run method
It is up to the derived classes of BESApp to implement the run method.
It is up to the derived class to implement this method.
BESError | if the derived class does not implement this method |
Reimplemented in CmdApp, ServerApp, and StandAloneApp.
Clean up after the application.
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.
sig | if the application is terminating due to a signal, pass the signal to terminate routine. |
Cleans up any global variables registered with BESGlobalIQ
sig | if the application is terminating due to a signal, otherwise 0 is passed. |
Reimplemented in BESModuleApp, ServerApp, and StandAloneApp.
|
inlinestatic |