libdap++  Updated for version 3.13.3
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 namespace libdap {
40 
41 class ServerFunctionsListUnitTest;
42 class ConstraintEvaluator;
43 
45 private:
46  static ServerFunctionsList * d_instance;
47  std::multimap<std::string, libdap::ServerFunction *> d_func_list;
48 
49  static void initialize_instance();
50  static void delete_instance();
51 
52  virtual ~ServerFunctionsList();
53 
55 
56 protected:
58 
59 public:
60  static ServerFunctionsList * TheList();
61 
62  virtual void add_function(libdap::ServerFunction *func);
63 
64  virtual bool find_function(const std::string &name, libdap::bool_func *f) const;
65  virtual bool find_function(const std::string &name, libdap::btp_func *f) const;
66  virtual bool find_function(const std::string &name, libdap::proj_func *f) const;
67 
68  //virtual void dump(ostream &strm) const;
69 
70  std::multimap<string,libdap::ServerFunction *>::iterator begin();
71  std::multimap<string,libdap::ServerFunction *>::iterator end();
72  ServerFunction *getFunction(std::multimap<string,libdap::ServerFunction *>::iterator it);
73 
74  virtual void getFunctionNames(vector<string> *names);
75 };
76 
77 }
78 
79 #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