libdap  Updated for version 3.20.6
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 
37 namespace libdap
38 {
39 
40 class Byte;
41 class Int8;
42 class Int16;
43 class UInt16;
44 class Int32;
45 class UInt32;
46 class Int64;
47 class UInt64;
48 
49 class Float32;
50 class Float64;
51 
52 class Str;
53 class Url;
54 
55 class D4Enum;
56 class D4Opaque;
57 
58 class Array;
59 
60 class Structure;
61 class D4Sequence;
62 
63 class D4Group;
64 
65 class BaseType;
66 
73 {
74 public:
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
virtual BaseType * NewVariable(Type t, const string &name) const
Holds an 8-bit signed integer value.
Definition: Int8.h:42
Holds a64-bit signed integer.
Definition: Int64.h:49
Holds an Internet address (URL).
Definition: Url.h:68
Holds an unsigned 16-bit integer.
Definition: UInt16.h:57
virtual D4Enum * NewEnum(const string &n="", Type type=dods_null_c) const
Holds a structure (aggregate) type.
Definition: Structure.h:83
Type
Identifies the data type.
Definition: Type.h:94
Holds a 32-bit floating point value.
Definition: Float32.h:61
virtual BaseTypeFactory * ptr_duplicate() const
top level DAP object to house generic methods
Definition: AISConnect.cc:30
Holds character string data.
Definition: Str.h:62
Holds a DAP4 enumeration.
Definition: D4Enum.h:61
Holds a 16-bit signed integer value.
Definition: Int16.h:59
Holds a sequence.
Definition: D4Sequence.h:133
Holds a 64-bit unsigned integer.
Definition: UInt64.h:49
virtual Url * NewURL(const string &n="") const
The basic data type for the DODS DAP types.
Definition: BaseType.h:117
Holds a 64-bit (double precision) floating point value.
Definition: Float64.h:60
Holds a single byte.
Definition: Byte.h:60
Holds a 32-bit unsigned integer.
Definition: UInt32.h:59
A multidimensional array of identical data types.
Definition: Array.h:112
Holds a 32-bit signed integer.
Definition: Int32.h:65