BaseTypeFactory.h
// -*- mode: c++; c-basic-offset:4 -*-
// This file is part of libdap, A C++ implementation of the OPeNDAP Data
// Access Protocol.
// Copyright (c) 2005 OPeNDAP, Inc.
// Author: James Gallagher <jgallagher@opendap.org>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
#ifndef base_type_factory_h
#define base_type_factory_h
#include <string>
#include "Type.h"
#include "InternalErr.h"
// Class declarations; Make sure to include the corresponding headers in the
// implementation file.
namespace libdap
{
class Byte;
class Int16;
class UInt16;
class Int32;
class UInt32;
class Float32;
class Float64;
class Str;
class Url;
class Array;
class Structure;
class Sequence;
class Grid;
class BaseType;
class BaseTypeFactory
{
public:
BaseTypeFactory()
{}
virtual ~BaseTypeFactory()
{}
virtual BaseType *NewVariable(Type t, const string &name = "") const;
virtual BaseTypeFactory *ptr_duplicate() const {
throw InternalErr(__FILE__, __LINE__, "Not Implemented.");
}
virtual Byte *NewByte(const string &n = "") const;
virtual Int16 *NewInt16(const string &n = "") const;
virtual UInt16 *NewUInt16(const string &n = "") const;
virtual Int32 *NewInt32(const string &n = "") const;
virtual UInt32 *NewUInt32(const string &n = "") const;
virtual Float32 *NewFloat32(const string &n = "") const;
virtual Float64 *NewFloat64(const string &n = "") const;
virtual Str *NewStr(const string &n = "") const;
virtual Url *NewUrl(const string &n = "") const;
virtual Array *NewArray(const string &n = "", BaseType *v = 0) const;
virtual Structure *NewStructure(const string &n = "") const;
virtual Sequence *NewSequence(const string &n = "") const;
virtual Grid *NewGrid(const string &n = "") const;
};
} // namespace libdap
#endif // base_type_factory_h
libdap::Array
A multidimensional array of identical data types.
Definition Array.h:123
libdap::BaseTypeFactory
Definition BaseTypeFactory.h:81
libdap::BaseTypeFactory::NewVariable
virtual BaseType * NewVariable(Type t, const string &name="") const
Definition BaseTypeFactory.cc:50
libdap::BaseTypeFactory::ptr_duplicate
virtual BaseTypeFactory * ptr_duplicate() const
Definition BaseTypeFactory.h:104
libdap::BaseType
The basic data type for the DODS DAP types.
Definition BaseType.h:120
libdap::Byte
Holds a single byte.
Definition Byte.h:61
libdap::Float32
Holds a 32-bit floating point value.
Definition Float32.h:62
libdap::Float64
Holds a 64-bit (double precision) floating point value.
Definition Float64.h:61
libdap::Grid
Holds the Grid data type.
Definition Grid.h:123
libdap::Int16
Holds a 16-bit signed integer value.
Definition Int16.h:60
libdap::Int32
Holds a 32-bit signed integer.
Definition Int32.h:66
libdap::InternalErr
A class for software fault reporting.
Definition InternalErr.h:65
libdap::Sequence
Holds a sequence.
Definition Sequence.h:163
libdap::Str
Holds character string data.
Definition Str.h:62
libdap::Structure
Holds a structure (aggregate) type.
Definition Structure.h:84
libdap::UInt16
Holds an unsigned 16-bit integer.
Definition UInt16.h:58
libdap::UInt32
Holds a 32-bit unsigned integer.
Definition UInt32.h:60
libdap::Url
Holds an Internet address (URL).
Definition Url.h:56
libdap
top level DAP object to house generic methods
Definition AlarmHandler.h:36
libdap::Type
Type
Identifies the data type.
Definition Type.h:94