OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
BESApp.h
Go to the documentation of this file.
1 // BESApp.h
2 
3 // This file is part of bes, A C++ back-end server implementation framework
4 // for the OPeNDAP Data Access Protocol.
5 
6 // Copyright (c) 2004-2009 University Corporation for Atmospheric Research
7 // Author: Patrick West <pwest@ucar.edu> and Jose Garcia <jgarcia@ucar.edu>
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License as published by the Free Software Foundation; either
12 // version 2.1 of the License, or (at your option) any later version.
13 //
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 //
23 // You can contact University Corporation for Atmospheric Research at
24 // 3080 Center Green Drive, Boulder, CO 80301
25 
26 // (c) COPYRIGHT University Corporation for Atmospheric Research 2004-2005
27 // Please read the full copyright statement in the file COPYRIGHT_UCAR.
28 //
29 // Authors:
30 // pwest Patrick West <pwest@ucar.edu>
31 // jgarcia Jose Garcia <jgarcia@ucar.edu>
32 
33 #ifndef A_BESApp_H
34 #define A_BESApp_H
35 
36 #include <string>
37 
38 using std::string ;
39 
40 #include "BESObj.h"
41 
57 class BESApp : public BESObj
58 {
59 protected:
60  string _appName ;
61  bool _debug ;
64  BESApp(void)
65  : _debug( false ),
66  _isInitialized( false ) {}
67 public:
68  virtual ~BESApp() {};
69 
82  virtual int main(int argC, char **argV) = 0;
83 
94  virtual int initialize(int argC, char **argV) = 0;
95 
102  virtual int run(void) = 0;
103 
113  virtual int terminate(int sig = 0) = 0;
114 
122  virtual void dump( ostream &strm ) const = 0 ;
123 
132  string appName( void ) const { return _appName ; }
133 
138  static BESApp * TheApplication(void) { return _theApplication; }
139 };
140 
141 #endif
142 
virtual ~BESApp()
Definition: BESApp.h:68
virtual int run(void)=0
The body of the application, implementing the primary functionality of the BES application.
static BESApp * _theApplication
Definition: BESApp.h:63
string _appName
Definition: BESApp.h:60
string appName(void) const
Returns the name of the application.
Definition: BESApp.h:132
Base object for bes objects.
Definition: BESObj.h:52
bool _debug
Definition: BESApp.h:61
virtual void dump(ostream &strm) const =0
dumps information about this object
BESApp(void)
Definition: BESApp.h:64
Application class for BES applications.
Definition: BESApp.h:57
bool _isInitialized
Definition: BESApp.h:62
virtual int main(int argC, char **argV)=0
main routine, the main entry point for any BES applications.
virtual int initialize(int argC, char **argV)=0
Initialize the application using the passed argc and argv values.
static BESApp * TheApplication(void)
Returns the BESApp application object for this application.
Definition: BESApp.h:138
virtual int terminate(int sig=0)=0
Clean up after the application.