libdap Updated for version 3.20.10
libdap4 is an implementation of OPeNDAP's DAP protocol.
DataDDS.h
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{
50
77class DataDDS : public DDS
78{
79private:
80 string d_server_version;
81 int d_server_version_major;
82 int d_server_version_minor;
83
84 string d_protocol_version;
85 int d_server_protocol_major;
86 int d_server_protocol_minor;
87
88 void m_version_string_to_numbers();
89 void m_protocol_string_to_numbers();
90
91public:
92 DataDDS(BaseTypeFactory *factory, const string &n = "",
93 const string &v = "", const string &p = "");
94 // #ifdef DEFAULT_BASETYPE_FACTORY
95 // DataDDS(const string &n = "", const string &v = "");
96 // #endif
97 virtual ~DataDDS()
98 {}
99
103 void set_version(const string &v)
104 {
105 d_server_version = v;
106 m_version_string_to_numbers();
107 }
109 string get_version() const
110 {
111 return d_server_version;
112 }
115 {
116 return d_server_version_major;
117 }
120 {
121 return d_server_version_minor;
122 }
123
124 void set_protocol(const string &p)
125 {
126 d_protocol_version = p;
127 m_protocol_string_to_numbers();
128 }
129 string get_protocol() const
130 {
131 return d_protocol_version;
132 }
133 int get_protocol_major() const
134 {
135 return d_server_protocol_major;
136 }
137 int get_protocol_minor() const
138 {
139 return d_server_protocol_minor;
140 }
141
142 virtual void dump(ostream &strm) const ;
143};
144
145} // namespace libdap
146
147#endif // _datadds_h
Holds a DAP2 DDS.
Definition DataDDS.h:78
string get_version() const
Get the server version string, unparsed.
Definition DataDDS.h:109
virtual void dump(ostream &strm) const
dumps information about this object
Definition DataDDS.cc:124
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:159
int get_version_major() const
Returns the major version number.
Definition DataDDS.h:114
void set_version(const string &v)
Definition DataDDS.h:103
int get_version_minor() const
Returns the minor version number.
Definition DataDDS.h:119
top level DAP object to house generic methods