libdap Updated for version 3.21.1
libdap4 is an implementation of OPeNDAP's DAP protocol.
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#include "InternalErr.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 Int16;
41class UInt16;
42class Int32;
43class UInt32;
44class Float32;
45class Float64;
46class Str;
47class Url;
48class Array;
49class Structure;
50class Sequence;
51class Grid;
52class BaseType;
53
80public:
82 virtual ~BaseTypeFactory() {}
83
93 virtual BaseType *NewVariable(Type t, const string &name = "") const;
94
100 virtual BaseTypeFactory *ptr_duplicate() const { throw InternalErr(__FILE__, __LINE__, "Not Implemented."); }
101
102 virtual Byte *NewByte(const string &n = "") const;
103 virtual Int16 *NewInt16(const string &n = "") const;
104 virtual UInt16 *NewUInt16(const string &n = "") const;
105 virtual Int32 *NewInt32(const string &n = "") const;
106 virtual UInt32 *NewUInt32(const string &n = "") const;
107 virtual Float32 *NewFloat32(const string &n = "") const;
108 virtual Float64 *NewFloat64(const string &n = "") const;
109
110 virtual Str *NewStr(const string &n = "") const;
111 virtual Url *NewUrl(const string &n = "") const;
112
113 virtual Array *NewArray(const string &n = "", BaseType *v = 0) const;
114 virtual Structure *NewStructure(const string &n = "") const;
115 virtual Sequence *NewSequence(const string &n = "") const;
116 virtual Grid *NewGrid(const string &n = "") const;
117};
118
119} // namespace libdap
120
121#endif // base_type_factory_h
A multidimensional array of identical data types.
Definition Array.h:121
virtual BaseType * NewVariable(Type t, const string &name="") const
virtual Float32 * NewFloat32(const string &n="") const
virtual Int16 * NewInt16(const string &n="") const
virtual Str * NewStr(const string &n="") const
virtual UInt32 * NewUInt32(const string &n="") const
virtual Grid * NewGrid(const string &n="") const
virtual Int32 * NewInt32(const string &n="") const
virtual Float64 * NewFloat64(const string &n="") const
virtual Url * NewUrl(const string &n="") const
virtual Sequence * NewSequence(const string &n="") const
virtual BaseTypeFactory * ptr_duplicate() const
virtual Array * NewArray(const string &n="", BaseType *v=0) const
virtual Byte * NewByte(const string &n="") const
virtual Structure * NewStructure(const string &n="") const
virtual UInt16 * NewUInt16(const string &n="") const
The basic data type for the DODS DAP types.
Definition BaseType.h:118
Holds a single byte.
Definition Byte.h:59
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 the Grid data type.
Definition Grid.h:121
Holds a 16-bit signed integer value.
Definition Int16.h:57
Holds a 32-bit signed integer.
Definition Int32.h:63
A class for software fault reporting.
Definition InternalErr.h:61
Holds a sequence.
Definition Sequence.h:162
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 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