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