libdap
Updated for version 3.17.0
|
00001 // -*- mode: c++; c-basic-offset:4 -*- 00002 00003 // This file is part of libdap, A C++ implementation of the OPeNDAP Data 00004 // Access Protocol. 00005 00006 // Copyright (c) 2013 OPeNDAP, Inc. 00007 // Author: James Gallagher <jgallagher@opendap.org> 00008 // 00009 // This library is free software; you can redistribute it and/or 00010 // modify it under the terms of the GNU Lesser General Public 00011 // License as published by the Free Software Foundation; either 00012 // version 2.1 of the License, or (at your option) any later version. 00013 // 00014 // This library is distributed in the hope that it will be useful, 00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 // Lesser General Public License for more details. 00018 // 00019 // You should have received a copy of the GNU Lesser General Public 00020 // License along with this library; if not, write to the Free Software 00021 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 // 00023 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. 00024 00025 #ifndef _dmr_h 00026 #define _dmr_h 1 00027 00028 #include <cassert> 00029 00030 #include <iostream> 00031 #include <string> 00032 #include <vector> 00033 00034 //#include "D4Group.h" 00035 //#include "XMLWriter.h" 00036 #include "DapObj.h" 00037 00038 namespace libdap 00039 { 00040 00041 class D4Group; 00042 class D4BaseTypeFactory; 00043 class XMLWriter; 00044 00045 class DDS; 00046 00055 class DMR : public DapObj 00056 { 00057 private: 00058 D4BaseTypeFactory *d_factory; 00059 00061 string d_name; 00063 string d_filename; 00064 00066 int d_dap_major; 00068 int d_dap_minor; 00070 string d_dap_version; 00071 00073 string d_dmr_version; 00074 00076 string d_request_xml_base; 00077 00079 string d_namespace; 00080 00082 long d_max_response_size; 00083 00085 D4Group *d_root; 00086 00087 friend class DMRTest; 00088 00089 protected: 00090 void m_duplicate(const DMR &dmr); 00091 00092 public: 00093 DMR(); 00094 DMR(const DMR &dmr); 00095 DMR(D4BaseTypeFactory *factory, const string &name = ""); 00096 00097 DMR(D4BaseTypeFactory *factory, DDS &dds); 00098 00099 virtual ~DMR(); 00100 00101 DMR &operator=(const DMR &rhs); 00102 00103 virtual void build_using_dds(DDS &dds); 00104 00109 bool OK() const { return (d_factory && d_root && !d_dap_version.empty()); } 00110 00117 string name() const { return d_name; } 00118 void set_name(const string &n) { d_name = n; } 00120 00125 virtual D4BaseTypeFactory *factory() { return d_factory; } 00126 virtual void set_factory(D4BaseTypeFactory *f) { d_factory = f; } 00128 00136 string filename() const { return d_filename; } 00137 void set_filename(const string &fn) { d_filename = fn;} 00139 00140 string dap_version() const { return d_dap_version; } 00141 void set_dap_version(const string &version_string); 00142 int dap_major() const { return d_dap_major; } 00143 int dap_minor() const { return d_dap_minor; } 00144 00145 string dmr_version() const { return d_dmr_version; } 00146 void set_dmr_version(const string &v) { d_dmr_version = v; } 00147 00149 string request_xml_base() const { return d_request_xml_base; } 00150 00152 void set_request_xml_base(const string &xb) { d_request_xml_base = xb; } 00153 00155 string get_namespace() const { return d_namespace; } 00156 00158 void set_namespace(const string &ns) { d_namespace = ns; } 00159 00160 // TODO Move the response_limit methods to D4ResponseBuilder? jhrg 5/1/13 00162 long response_limit() { return d_max_response_size; } 00163 00167 void set_response_limit(long size) { d_max_response_size = size; } 00168 00170 long request_size(bool constrained); 00171 00176 D4Group *root(); 00177 00178 void print_dap4(XMLWriter &xml, bool constrained = false); 00179 00180 virtual void dump(ostream &strm) const ; 00181 }; 00182 00183 } // namespace libdap 00184 00185 #endif // _dmr_h