OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
UgridFunctions.cc
Go to the documentation of this file.
1 // UgridFunctions.cc
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) 2013 OPeNDAP, Inc.
7 // Author: James Gallagher <jgallagher@opendap.org>
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 //
23 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
24 
25 #include <iostream>
26 
27 using std::endl;
28 
29 #include "UgridFunctions.h"
30 #include "ServerFunctionsList.h"
31 #include "BESDebug.h"
32 #include "ugr5.h"
33 
34 //namespace ugrid {
35 
36 static string getFunctionNames(){
37  vector<string> names;
38  libdap::ServerFunctionsList::TheList()->getFunctionNames(&names);
39 
40  string msg;
41  for(std::vector<string>::iterator it = names.begin(); it != names.end(); ++it) {
42  if(!msg.empty())
43  msg += ", ";
44 
45  msg += *it;
46  }
47  return msg;
48 }
49 void UgridFunctions::initialize(const string &/*modname*/) {
50  BESDEBUG( "UgridFunctions", "initialize() - BEGIN" << endl );
51  BESDEBUG("UgridFunctions", "initialize() - function names: " << getFunctionNames()<< endl);
52 #if 0
53 
54  BESDEBUG("UgridFunctions", "initialize() - Adding gf3::UGridRestrictFunction_03()" << endl);
55  libdap::ServerFunctionsList::TheList()->add_function(new gf3::UGridRestrictFunction_03());
56  BESDEBUG("UgridFunctions", "initialize() - function names: " << getFunctionNames()<< endl);
57 
58  BESDEBUG("UgridFunctions", "initialize() - Adding ugrid_restrict::UGridRestrictFunction()" << endl);
59  libdap::ServerFunctionsList::TheList()->add_function(new ugrid_restrict::UGridRestrictFunction());
60  BESDEBUG("UgridFunctions", "initialize() - function names: " << getFunctionNames()<< endl);
61  BESDEBUG("UgridFunctions", "initialize() - Adding UGR4 function..." << endl);
62  ugrid::UGR4 *ugr4 = new ugrid::UGR4();
63  libdap::ServerFunctionsList::TheList()->add_function(ugr4);
64  BESDEBUG("UgridFunctions", "initialize() - function names: " << getFunctionNames()<< endl);
65 #endif
66 
67  BESDEBUG("UgridFunctions", "initialize() - Adding UGR5 function..." << endl);
68 
69  ugrid::UGR5 *ugr5 = new ugrid::UGR5();
70  libdap::ServerFunctionsList::TheList()->add_function(ugr5);
71 
72  BESDEBUG("UgridFunctions", "initialize() - function names: " << getFunctionNames()<< endl);
73 
74  BESDEBUG( "UgridFunctions", "initialize() - END" << endl );
75 }
76 
77 void UgridFunctions::terminate(const string &/*modname*/) {
78  BESDEBUG( "UgridFunctions", "Removing UgridFunctions Modules (this does nothing)." << endl );
79 }
80 
87 void UgridFunctions::dump(ostream &strm) const {
88  strm << BESIndent::LMarg << "UgridFunctions::dump - (" << (void *) this << ")" << endl;
89 }
90 
91 extern "C" {
93  return new UgridFunctions;
94  }
95 }
96 
97 
98 
99 
100 //} // namespace ugrid
101 
102 
virtual void dump(ostream &strm) const
dumps information about this object
static ostream & LMarg(ostream &strm)
Definition: BESIndent.cc:73
The UGR4 class encapsulates the function 'ugr4::ugr4' along with additional meta-data regarding its u...
Definition: ugr5.h:46
void ugr5(int argc, BaseType *argv[], DDS &dds, BaseType **btpp)
Subset an irregular mesh (aka unstructured grid).
Definition: ugr5.cc:439
virtual void terminate(const string &modname)
BESAbstractModule * maker()
#define BESDEBUG(x, y)
macro used to send debug information to the debug stream
Definition: BESDebug.h:64
virtual void initialize(const string &modname)