libdap++  Updated for version 3.12.0
ServerFunctionsList.h
Go to the documentation of this file.
1 // ServerFunctionsList.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 // -*- mode: c++; c-basic-offset:4 -*-
7 
8 // This file is part of libdap, A C++ implementation of the OPeNDAP Data
9 // Access Protocol.
10 
11 // Copyright (c) 2013 OPeNDAP, Inc.
12 // Author: Nathan Potter <npotter@opendap.org>
13 //
14 // This library is free software; you can redistribute it and/or
15 // modify it under the terms of the GNU Lesser General Public
16 // License as published by the Free Software Foundation; either
17 // version 2.1 of the License, or (at your option) any later version.
18 //
19 // This library is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 // Lesser General Public License for more details.
23 //
24 // You should have received a copy of the GNU Lesser General Public
25 // License along with this library; if not, write to the Free Software
26 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
27 //
28 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
29 
30 #ifndef I_ServerFunctionsList_h
31 #define I_ServerFunctionsList_h 1
32 
33 #include <map>
34 #include <string>
35 #include <expr.h>
36 
37 #include "ServerFunction.h"
38 
39 
40 namespace libdap {
41 class ServerFunctionsListUnitTest;
42 class ConstraintEvaluator;
43 
44 //#include "BESObj.h"
45 
47 private:
48  static ServerFunctionsList * d_instance;
49  std::multimap<std::string, libdap::ServerFunction *> d_func_list;
50 
51  static void initialize_instance();
52  static void delete_instance();
53 
54  virtual ~ServerFunctionsList();
55 
57 
58 protected:
60 
61 public:
62  static ServerFunctionsList * TheList();
63 
64 
65  virtual void add_function(libdap::ServerFunction *func);
66 
67  virtual bool find_function(const std::string &name, libdap::bool_func *f) const;
68  virtual bool find_function(const std::string &name, libdap::btp_func *f) const;
69  virtual bool find_function(const std::string &name, libdap::proj_func *f) const;
70 
71  //virtual void dump(ostream &strm) const;
72 
73  std::multimap<string,libdap::ServerFunction *>::iterator begin();
74  std::multimap<string,libdap::ServerFunction *>::iterator end();
75  ServerFunction *getFunction(std::multimap<string,libdap::ServerFunction *>::iterator it);
76 
77  virtual void getFunctionNames(vector<string> *names);
78 
79 };
80 
81 }
82 
83 #endif // I_ServerFunctionsList_h
static ServerFunctionsList * TheList()
friend class libdap::ServerFunctionsListUnitTest
ServerFunction * getFunction(std::multimap< string, libdap::ServerFunction * >::iterator it)
Returns the ServerFunction pointed to by the passed iterator.
std::multimap< string, libdap::ServerFunction * >::iterator end()
Returns an iterator pointing to the last key pair in the ServerFunctionList.
virtual void getFunctionNames(vector< string > *names)
virtual void add_function(libdap::ServerFunction *func)
Adds the passed ServerFunction pointer to the list of ServerFunctions.
std::multimap< string, libdap::ServerFunction * >::iterator begin()
Returns an iterator pointing to the first key pair in the ServerFunctionList.
virtual bool find_function(const std::string &name, libdap::bool_func *f) const