libdap Updated for version 3.20.10
libdap4 is an implementation of OPeNDAP's DAP protocol.
D4BaseTypeFactory.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) 2012 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#ifndef dap4_base_type_factory_h
27#define dap4_base_type_factory_h
28
29#include <string>
30
31#include "BaseTypeFactory.h"
32#include "Type.h"
33
34// Class declarations; Make sure to include the corresponding headers in the
35// implementation file.
36
37namespace libdap
38{
39
40class Byte;
41class Int8;
42class Int16;
43class UInt16;
44class Int32;
45class UInt32;
46class Int64;
47class UInt64;
48
49class Float32;
50class Float64;
51
52class Str;
53class Url;
54
55class D4Enum;
56class D4Opaque;
57
58class Array;
59
60class Structure;
61class D4Sequence;
62
63class D4Group;
64
65class BaseType;
66
73{
74public:
76 {}
77 virtual ~D4BaseTypeFactory()
78 {}
79
80 virtual BaseType *NewVariable(Type t, const string &name) const;
81
82 virtual BaseTypeFactory *ptr_duplicate() const {
83 return new D4BaseTypeFactory;
84 }
85
86 virtual Byte *NewByte(const string &n = "") const;
87
88 // The Int8 types are new for DAP4
89 virtual Int8 *NewInt8(const string &n = "") const;
90 virtual Byte *NewChar(const string &n = "") const;
91 virtual Byte *NewUInt8(const string &n = "") const;
92
93 virtual Int16 *NewInt16(const string &n = "") const;
94 virtual UInt16 *NewUInt16(const string &n = "") const;
95 virtual Int32 *NewInt32(const string &n = "") const;
96 virtual UInt32 *NewUInt32(const string &n = "") const;
97
98 // New for DAP4
99 virtual Int64 *NewInt64(const string &n = "") const;
100 virtual UInt64 *NewUInt64(const string &n = "") const;
101
102 virtual Float32 *NewFloat32(const string &n = "") const;
103 virtual Float64 *NewFloat64(const string &n = "") const;
104
105 virtual D4Enum *NewEnum(const string &n = "", Type type = dods_null_c) const;
106
107 virtual Str *NewStr(const string &n = "") const;
108 virtual Url *NewUrl(const string &n = "") const;
109 virtual Url *NewURL(const string &n = "") const;
110
111 virtual D4Opaque *NewOpaque(const string &n = "") const;
112
113 virtual Array *NewArray(const string &n = "", BaseType *v = 0) const;
114
115 virtual Structure *NewStructure(const string &n = "") const;
116 virtual D4Sequence *NewD4Sequence(const string &n = "") const;
117
118 virtual D4Group *NewGroup(const string &n = "") const;
119};
120
121} // namespace libdap
122
123#endif // dap4_base_type_factory_h
A multidimensional array of identical data types.
Definition Array.h:113
The basic data type for the DODS DAP types.
Definition BaseType.h:118
Holds a single byte.
Definition Byte.h:61
virtual D4Enum * NewEnum(const string &n="", Type type=dods_null_c) const
virtual BaseTypeFactory * ptr_duplicate() const
virtual BaseType * NewVariable(Type t, const string &name) const
virtual Url * NewURL(const string &n="") const
Holds a DAP4 enumeration.
Definition D4Enum.h:56
Holds a sequence.
Definition D4Sequence.h:134
Holds a 32-bit floating point value.
Definition Float32.h:62
Holds a 64-bit (double precision) floating point value.
Definition Float64.h:61
Holds a 16-bit signed integer value.
Definition Int16.h:60
Holds a 32-bit signed integer.
Definition Int32.h:66
Holds a64-bit signed integer.
Definition Int64.h:50
Holds an 8-bit signed integer value.
Definition Int8.h:43
Holds character string data.
Definition Str.h:63
Holds a structure (aggregate) type.
Definition Structure.h:84
Holds an unsigned 16-bit integer.
Definition UInt16.h:58
Holds a 32-bit unsigned integer.
Definition UInt32.h:60
Holds a 64-bit unsigned integer.
Definition UInt64.h:50
Holds an Internet address (URL).
Definition Url.h:69
top level DAP object to house generic methods
Type
Identifies the data type.
Definition Type.h:94