bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
BESRequestHandlerList.h
1 // BESRequestHandlerList.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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 I_BESRequestHandlerList_h
34#define I_BESRequestHandlerList_h 1
35
36#include <map>
37#include <string>
38#include <mutex>
39
40#include "BESObj.h"
41#include "BESRequestHandler.h"
42
44
66class BESRequestHandlerList: public BESObj {
67private:
68 static BESRequestHandlerList * d_instance;
69 mutable std::recursive_mutex d_cache_lock_mutex;
70
71 static void initialize_instance();
72 static void delete_instance();
73
74 std::map<std::string, BESRequestHandler *> _handler_list;
75
76public:
77 BESRequestHandlerList() = default;
78 ~BESRequestHandlerList() override = default;
79
80 typedef std::map<std::string, BESRequestHandler *>::const_iterator Handler_citer;
81 typedef std::map<std::string, BESRequestHandler *>::iterator Handler_iter;
82
83 virtual bool add_handler(const std::string &handler_name, BESRequestHandler * handler);
84 virtual BESRequestHandler * remove_handler(const std::string &handler_name);
85 virtual BESRequestHandler * find_handler(const std::string &handler_name);
86
87 virtual Handler_citer get_first_handler();
88 virtual Handler_citer get_last_handler();
89
90 virtual std::string get_handler_names();
91
92 virtual void execute_each(BESDataHandlerInterface &dhi);
93 virtual void execute_all(BESDataHandlerInterface &dhi);
94
95 virtual void execute_current(BESDataHandlerInterface &dhi);
96
97 virtual void dump(std::ostream &strm) const;
98
99 static BESRequestHandlerList *TheList();
100};
101
102#endif // I_BESRequestHandlerList_h
103
Structure storing information used by the BES to handle the request.
top level BES object to house generic methods
Definition BESObj.h:54
virtual void dump(std::ostream &strm) const
dump the contents of this object to the specified ostream
Represents a specific data type request handler.