DataDDS.h

Go to the documentation of this file.
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 
00074 class DataDDS : public DDS
00075 {
00076 private:
00077     string d_server_version;
00078     int d_server_version_major;
00079     int d_server_version_minor;
00080 
00081     string d_protocol_version;
00082     int d_server_protocol_major;
00083     int d_server_protocol_minor;
00084 
00085     void m_version_string_to_numbers();
00086     void m_protocol_string_to_numbers();
00087 
00088 public:
00089     DataDDS(BaseTypeFactory *factory, const string &n = "",
00090             const string &v = "", const string &p = "");
00091     // #ifdef DEFAULT_BASETYPE_FACTORY
00092     // DataDDS(const string &n = "", const string &v = "");
00093     // #endif
00094     virtual ~DataDDS()
00095     {}
00096 
00100     void set_version(const string &v)
00101     {
00102         d_server_version = v;
00103         m_version_string_to_numbers();
00104     }
00106     string get_version() const
00107     {
00108         return d_server_version;
00109     }
00111     int get_version_major() const
00112     {
00113         return d_server_version_major;
00114     }
00116     int get_version_minor() const
00117     {
00118         return d_server_version_minor;
00119     }
00120 
00121     void set_protocol(const string &p)
00122     {
00123         d_protocol_version = p;
00124         m_protocol_string_to_numbers();
00125     }
00126     string get_protocol() const
00127     {
00128         return d_protocol_version;
00129     }
00130     int get_protocol_major() const
00131     {
00132         return d_server_protocol_major;
00133     }
00134     int get_protocol_minor() const
00135     {
00136         return d_server_protocol_minor;
00137     }
00138 
00139     virtual void dump(ostream &strm) const ;
00140 };
00141 
00142 #endif // _datadds_h

Generated on Wed Jun 27 12:56:38 2007 for libdap++ by  doxygen 1.4.7