libdap++ Updated for version 3.8.2
|
00001 00002 // -*- mode: c++; c-basic-offset:4 -*- 00003 00004 // This file is part of libdap, A C++ implementation of the OPeNDAP Data 00005 // Access Protocol. 00006 00007 // Copyright (c) 2002,2003 OPeNDAP, Inc. 00008 // Author: James Gallagher <jgallagher@opendap.org> 00009 // 00010 // This library is free software; you can redistribute it and/or 00011 // modify it under the terms of the GNU Lesser General Public 00012 // License as published by the Free Software Foundation; either 00013 // version 2.1 of the License, or (at your option) any later version. 00014 // 00015 // This library is distributed in the hope that it will be useful, 00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 // Lesser General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU Lesser General Public 00021 // License along with this library; if not, write to the Free Software 00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 // 00024 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. 00025 00026 // (c) COPYRIGHT URI/MIT 1997-1999 00027 // Please read the full copyright statement in the file COPYRIGHT_URI. 00028 // 00029 // Authors: 00030 // jhrg,jimg James Gallagher <jgallagher@gso.uri.edu> 00031 00032 // Specialize DDS for returned data. This currently means adding version 00033 // information about the source of the data. Was it from a version 1, 2 or 00034 // later server? 00035 // 00036 // jhrg 9/19/97 00037 00038 #ifndef _datadds_h 00039 #define _datadds_h 1 00040 00041 #include <iostream> 00042 #include <string> 00043 00044 #ifndef _dds_h 00045 #include "DDS.h" 00046 #endif 00047 00048 namespace libdap 00049 { 00050 00077 class DataDDS : public DDS 00078 { 00079 private: 00080 string d_server_version; 00081 int d_server_version_major; 00082 int d_server_version_minor; 00083 00084 string d_protocol_version; 00085 int d_server_protocol_major; 00086 int d_server_protocol_minor; 00087 00088 void m_version_string_to_numbers(); 00089 void m_protocol_string_to_numbers(); 00090 00091 public: 00092 DataDDS(BaseTypeFactory *factory, const string &n = "", 00093 const string &v = "", const string &p = ""); 00094 // #ifdef DEFAULT_BASETYPE_FACTORY 00095 // DataDDS(const string &n = "", const string &v = ""); 00096 // #endif 00097 virtual ~DataDDS() 00098 {} 00099 00103 void set_version(const string &v) 00104 { 00105 d_server_version = v; 00106 m_version_string_to_numbers(); 00107 } 00109 string get_version() const 00110 { 00111 return d_server_version; 00112 } 00114 int get_version_major() const 00115 { 00116 return d_server_version_major; 00117 } 00119 int get_version_minor() const 00120 { 00121 return d_server_version_minor; 00122 } 00123 00124 void set_protocol(const string &p) 00125 { 00126 d_protocol_version = p; 00127 m_protocol_string_to_numbers(); 00128 } 00129 string get_protocol() const 00130 { 00131 return d_protocol_version; 00132 } 00133 int get_protocol_major() const 00134 { 00135 return d_server_protocol_major; 00136 } 00137 int get_protocol_minor() const 00138 { 00139 return d_server_protocol_minor; 00140 } 00141 00142 virtual void dump(ostream &strm) const ; 00143 }; 00144 00145 } // namespace libdap 00146 00147 #endif // _datadds_h