libdap Updated for version 3.21.1
libdap4 is an implementation of OPeNDAP's DAP protocol.
DataDDS.h
Go to the documentation of this file.
1
2// -*- mode: c++; c-basic-offset:4 -*-
3
4// This file is part of libdap, A C++ implementation of the OPeNDAP Data
5// Access Protocol.
6
7// Copyright (c) 2002,2003 OPeNDAP, Inc.
8// Author: James Gallagher <jgallagher@opendap.org>
9//
10// This library is free software; you can redistribute it and/or
11// modify it under the terms of the GNU Lesser General Public
12// License as published by the Free Software Foundation; either
13// version 2.1 of the License, or (at your option) any later version.
14//
15// This library is distributed in the hope that it will be useful,
16// but WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18// Lesser General Public License for more details.
19//
20// You should have received a copy of the GNU Lesser General Public
21// License along with this library; if not, write to the Free Software
22// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23//
24// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
25
26// (c) COPYRIGHT URI/MIT 1997-1999
27// Please read the full copyright statement in the file COPYRIGHT_URI.
28//
29// Authors:
30// jhrg,jimg James Gallagher <jgallagher@gso.uri.edu>
31
32// Specialize DDS for returned data. This currently means adding version
33// information about the source of the data. Was it from a version 1, 2 or
34// later server?
35//
36// jhrg 9/19/97
37
38#ifndef _datadds_h
39#define _datadds_h 1
40
41#include <iostream>
42#include <string>
43
44#ifndef _dds_h
45#include "DDS.h"
46#endif
47
48namespace libdap {
49
75
76class DataDDS : public DDS {
77private:
78 string d_server_version;
79 int d_server_version_major;
80 int d_server_version_minor;
81
82 string d_protocol_version;
83 int d_server_protocol_major;
84 int d_server_protocol_minor;
85
86 void m_version_string_to_numbers();
87 void m_protocol_string_to_numbers();
88
89public:
90 DataDDS(BaseTypeFactory *factory, const string &n = "", const string &v = "", const string &p = "");
91 // #ifdef DEFAULT_BASETYPE_FACTORY
92 // DataDDS(const string &n = "", const string &v = "");
93 // #endif
94 virtual ~DataDDS() {}
95
99 void set_version(const string &v) {
100 d_server_version = v;
101 m_version_string_to_numbers();
102 }
103
104 string get_version() const { return d_server_version; }
106 int get_version_major() const { return d_server_version_major; }
108 int get_version_minor() const { return d_server_version_minor; }
109
110 void set_protocol(const string &p) {
111 d_protocol_version = p;
112 m_protocol_string_to_numbers();
113 }
114 string get_protocol() const { return d_protocol_version; }
115 int get_protocol_major() const { return d_server_protocol_major; }
116 int get_protocol_minor() const { return d_server_protocol_minor; }
117
118 virtual void dump(ostream &strm) const;
119};
120
121} // namespace libdap
122
123#endif // _datadds_h
DDS(BaseTypeFactory *factory, const string &name="")
Definition DDS.cc:160
virtual ~DataDDS()
Definition DataDDS.h:94
string get_version() const
Get the server version string, unparsed.
Definition DataDDS.h:104
int get_protocol_major() const
Definition DataDDS.h:115
virtual void dump(ostream &strm) const
dumps information about this object
Definition DataDDS.cc:113
void set_protocol(const string &p)
Definition DataDDS.h:110
DataDDS(BaseTypeFactory *factory, const string &n="", const string &v="", const string &p="")
Make an instance of DataDDS A DataDDS instance is a DDS with additional information about the version...
Definition DataDDS.cc:140
int get_version_major() const
Returns the major version number.
Definition DataDDS.h:106
void set_version(const string &v)
Definition DataDDS.h:99
int get_protocol_minor() const
Definition DataDDS.h:116
int get_version_minor() const
Returns the minor version number.
Definition DataDDS.h:108
string get_protocol() const
Definition DataDDS.h:114
top level DAP object to house generic methods
Definition AISConnect.cc:30