libdap++  Updated for version 3.13.3
BaseTypeFactory.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) 2005 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 base_type_factory_h
27 #define base_type_factory_h
28 
29 #include <string>
30 
31 // Class declarations; Make sure to include the corresponding headers in the
32 // implementation file.
33 
34 namespace libdap
35 {
36 
37 class Byte;
38 class Int16;
39 class UInt16;
40 class Int32;
41 class UInt32;
42 class Float32;
43 class Float64;
44 class Str;
45 class Url;
46 class Array;
47 class Structure;
48 class Sequence;
49 class Grid;
50 class BaseType;
51 
78 {
79 public:
81  {}
82  virtual ~BaseTypeFactory()
83  {}
84 
85  virtual BaseType *NewVariable(Type type, const string &name = "") const;
86 
87  virtual Byte *NewByte(const string &n = "") const;
88  virtual Int16 *NewInt16(const string &n = "") const;
89  virtual UInt16 *NewUInt16(const string &n = "") const;
90  virtual Int32 *NewInt32(const string &n = "") const;
91  virtual UInt32 *NewUInt32(const string &n = "") const;
92  virtual Float32 *NewFloat32(const string &n = "") const;
93  virtual Float64 *NewFloat64(const string &n = "") const;
94 
95  virtual Str *NewStr(const string &n = "") const;
96  virtual Url *NewUrl(const string &n = "") const;
97 
98  virtual Array *NewArray(const string &n = "", BaseType *v = 0) const;
99  virtual Structure *NewStructure(const string &n = "") const;
100  virtual Sequence *NewSequence(const string &n = "") const;
101  virtual Grid *NewGrid(const string &n = "") const;
102 };
103 
104 } // namespace libdap
105 
106 #endif // base_type_factory_h
Holds an Internet address (URL).
Definition: Url.h:63
virtual Structure * NewStructure(const string &n="") const
virtual Sequence * NewSequence(const string &n="") const
Holds an unsigned 16-bit integer.
Definition: UInt16.h:57
virtual Byte * NewByte(const string &n="") const
virtual Str * NewStr(const string &n="") const
Holds a structure (aggregate) type.
Definition: Structure.h:85
Type
Identifies the data type.
Definition: BaseType.h:137
virtual Url * NewUrl(const string &n="") const
Holds a 32-bit floating point value.
Definition: Float32.h:59
Holds character string data.
Definition: Str.h:62
Holds a 16-bit signed integer value.
Definition: Int16.h:57
virtual BaseType * NewVariable(Type type, const string &name="") const
virtual Float32 * NewFloat32(const string &n="") const
virtual Float64 * NewFloat64(const string &n="") const
Holds the Grid data type.
Definition: Grid.h:121
Holds a sequence.
Definition: Sequence.h:172
virtual Array * NewArray(const string &n="", BaseType *v=0) const
virtual Grid * NewGrid(const string &n="") const
virtual Int16 * NewInt16(const string &n="") const
The basic data type for the DODS DAP types.
Definition: BaseType.h:199
virtual Int32 * NewInt32(const string &n="") const
Holds a 64-bit (double precision) floating point value.
Definition: Float64.h:60
virtual UInt16 * NewUInt16(const string &n="") const
Holds a single byte.
Definition: Byte.h:60
Holds a 32-bit unsigned integer.
Definition: UInt32.h:59
virtual UInt32 * NewUInt32(const string &n="") const
A multidimensional array of identical data types.
Definition: Array.h:103
Holds a 32-bit signed integer.
Definition: Int32.h:64