bes
Updated for version 3.20.6
|
35 #include "BESRequestHandlerList.h"
36 #include "BESRequestHandler.h"
37 #include "BESInternalError.h"
57 _handler_list[handler_name] = handler_object;
79 BESRequestHandlerList::Handler_iter i;
80 i = _handler_list.find(handler_name);
81 if (i != _handler_list.end()) {
83 _handler_list.erase(i);
97 BESRequestHandlerList::Handler_citer i;
98 i = _handler_list.find(handler_name);
99 if (i != _handler_list.end()) {
114 return _handler_list.begin();
124 return _handler_list.end();
137 bool first_name =
true;
138 BESRequestHandlerList::Handler_citer i = _handler_list.begin();
139 for (; i != _handler_list.end(); i++) {
140 if (!first_name) ret +=
", ";
198 for (; i != ie; i++) {
272 if (!request_handler_method) {
274 +
"' does not handle the response type '" + dhi.
action +
"'", __FILE__, __LINE__);
277 request_handler_method(dhi);
290 strm << BESIndent::LMarg <<
"BESRequestHandlerList::dump - (" << (
void *)
this <<
")" << endl;
292 if (_handler_list.size()) {
293 strm << BESIndent::LMarg <<
"registered handlers:" << endl;
295 BESRequestHandlerList::Handler_citer i = _handler_list.begin();
296 BESRequestHandlerList::Handler_citer ie = _handler_list.end();
297 for (; i != ie; i++) {
301 BESIndent::UnIndent();
304 strm << BESIndent::LMarg <<
"registered handlers: none" << endl;
306 BESIndent::UnIndent();
310 BESRequestHandlerList::TheList()
312 if (_instance == 0) {
Represents a specific data type request handler.
BESContainer * container
pointer to current container in this interface
virtual BESRequestHandler * remove_handler(const std::string &handler_name)
remove and return the specified request handler
virtual p_request_handler_method find_method(const std::string &name)
find the method that can handle the specified response object type
virtual void execute_current(BESDataHandlerInterface &dhi)
Execute a single method for the current container that will fill in the response object rather than i...
virtual void execute_all(BESDataHandlerInterface &dhi)
for all of the registered request handlers, execute the given request
std::string action
the response object requested, e.g. das, dds
void next_container()
set the container pointer to the next * container in the list, null if at the end or no containers in...
The list of registered request handlers for this server; a singleton.
std::string get_container_type() const
retrieve the type of data this container holds, such as cedar or netcdf.
virtual void execute_each(BESDataHandlerInterface &dhi)
for each container in the given data handler interface, execute the given request
virtual bool add_handler(const std::string &handler_name, BESRequestHandler *handler)
add a request handler to the list of registered handlers for this server
virtual std::string access()=0
returns the true name of this container
virtual void dump(std::ostream &strm) const
dumps information about this object
exception thrown if internal error encountered
virtual Handler_citer get_last_handler()
return a constant iterator pointing to the end of the list
virtual void dump(std::ostream &strm) const
dumps information about this object
virtual Handler_citer get_first_handler()
return an iterator pointing to the first request handler in the list
void first_container()
set the container pointer to the first container in the containers list
Structure storing information used by the BES to handle the request.
virtual BESRequestHandler * find_handler(const std::string &handler_name)
find and return the specified request handler
virtual std::string get_handler_names()
Returns a comma separated string of request handlers registered with the server.