bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
FONcModule.cc
1// FONcModule.cc
2
3// This file is part of BES filout NetCDF Module.
4
5// Copyright (c) 2004,2005 University Corporation for Atmospheric Research
6// Author: Patrick West <pwest@ucar.edu> and Jose Garcia <jgarcia@ucar.edu>
7//
8// This library is free software; you can redistribute it and/or
9// modify it under the terms of the GNU Lesser General Public
10// License as published by the Free Software Foundation; either
11// version 2.1 of the License, or (at your option) any later version.
12//
13// This library is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16// Lesser General Public License for more details.
17//
18// You should have received a copy of the GNU Lesser General Public
19// License along with this library; if not, write to the Free Software
20// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21//
22// You can contact University Corporation for Atmospheric Research at
23// 3080 Center Green Drive, Boulder, CO 80301
24
25// (c) COPYRIGHT University Corporation for Atmospheric Research 2004-2005
26// Please read the full copyright statement in the file COPYRIGHT_UCAR.
27//
28// Authors:
29// pwest Patrick West <pwest@ucar.edu>
30// jgarcia Jose Garcia <jgarcia@ucar.edu>
31
32#include "config.h"
33
34#include <iostream>
35
36using std::endl;
37
38#include "FONcNames.h"
39#include "FONcBaseType.h"
40#include "FONcModule.h"
41#include "FONcTransmitter.h"
42#include "FONcRequestHandler.h"
43#include "BESRequestHandlerList.h"
44
45#include <BESReturnManager.h>
46
47#include <BESServiceRegistry.h>
48#include <BESDapNames.h>
49
50#include <TheBESKeys.h>
51#include <BESDebug.h>
52
63void FONcModule::initialize(const string &modname)
64{
65 BESDEBUG("fonc", "Initializing module " << modname << endl);
66
67 BESRequestHandler *handler = new FONcRequestHandler(modname);
68 BESRequestHandlerList::TheList()->add_handler(modname, handler);
69
70 BESReturnManager::TheManager()->add_transmitter(FONC_RETURN_AS_NETCDF3, new FONcTransmitter());
71
72 BESServiceRegistry::TheRegistry()->add_format(OPENDAP_SERVICE, DATA_SERVICE, FONC_RETURN_AS_NETCDF3);
73
74 BESReturnManager::TheManager()->add_transmitter(FONC_RETURN_AS_NETCDF4, new FONcTransmitter());
75
76 BESServiceRegistry::TheRegistry()->add_format(OPENDAP_SERVICE, DATA_SERVICE, FONC_RETURN_AS_NETCDF4);
77
78 //BESReturnManager::TheManager()->add_transmitter( RETURNAS_NETCDF4, new FONcTransmitter());
79
80 BESServiceRegistry::TheRegistry()->add_format(OPENDAP_SERVICE, DAP4DATA_SERVICE, FONC_RETURN_AS_NETCDF4);
81
82
83 BESDebug::Register("fonc");
84
85 BESDEBUG("fonc", "Done Initializing module " << modname << endl);
86}
87
96void FONcModule::terminate(const string &modname)
97{
98 BESDEBUG("fonc", "Cleaning module " << modname << endl);
99
100 BESReturnManager::TheManager()->del_transmitter(FONC_RETURN_AS_NETCDF3);
101
102 BESReturnManager::TheManager()->del_transmitter(FONC_RETURN_AS_NETCDF4);
103
104 BESRequestHandler *rh = BESRequestHandlerList::TheList()->remove_handler(modname);
105 delete rh;
106
107 BESDEBUG("fonc", "Done Cleaning module " << modname << endl);
108}
109
116void FONcModule::dump(ostream &strm) const
117{
118 strm << BESIndent::LMarg << "FONcModule::dump - (" << (void *) this << ")" << endl;
119}
120
124extern "C"
125BESAbstractModule *maker()
126{
127 return new FONcModule;
128}
129
static void Register(const std::string &flagName)
register the specified debug flag
Definition BESDebug.h:126
Represents a specific data type request handler.
Module that allows for OPeNDAP Data objects to be returned as netcdf files.
Definition FONcModule.h:52
virtual void dump(std::ostream &strm) const
dumps information about this object for debugging purposes
virtual void initialize(const std::string &modname)
initialize the module by adding callbacks and registering objects with the framework
Definition FONcModule.cc:63
virtual void terminate(const std::string &modname)
removes any registered callbacks or objects from the framework
Definition FONcModule.cc:96
A Request Handler for the Fileout NetCDF request.
BESTransmitter class named "netcdf" that transmits an OPeNDAP data object as a netcdf file.
STL class.