bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
HDFTypeFactory.cc
1
2// -*- mode: c++; c-basic-offset:4 -*-
3
4// This file is part of HDF_handler, a data handler for the OPeNDAP data
5// server.
6
7// Copyright (c) 2002,2003 OPeNDAP, IHDF.
8// Author: James Gallagher <jgallagher@opendap.org>
9//
10// This is free software; you can redistribute it and/or modify it under the
11// terms of the GNU Lesser General Public License as published by the Free
12// Software Foundation; either version 2.1 of the License, or (at your
13// option) any later version.
14//
15// This software is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18// License for more details.
19//
20// You should have received a copy of the GNU Lesser General Public
21// License along with this software; if not, write to the Free Software
22// Foundation, IHDF., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23//
24// You can contact OPeNDAP, IHDF. at PO Box 112, Saunderstown, RI. 02874-0112.
25
26#include <string>
27
28#include "HDFByte.h"
29#include "HDFInt16.h"
30#include "HDFUInt16.h"
31#include "HDFInt32.h"
32#include "HDFUInt32.h"
33#include "HDFFloat32.h"
34#include "HDFFloat64.h"
35#include "HDFStr.h"
36#include "HDFUrl.h"
37#include "HDFArray.h"
38#include "HDFStructure.h"
39#include "HDFSequence.h"
40#include "HDFGrid.h"
41#include "HDFTypeFactory.h"
42#include <libdap/debug.h>
43#include <BESDebug.h>
44
45using namespace libdap;
46
47Byte *HDFTypeFactory::NewByte(const string & n) const
48{
49 return new HDFByte(n, d_filename);
50}
51
52Int16 *HDFTypeFactory::NewInt16(const string & n) const
53{
54 return new HDFInt16(n, d_filename);
55}
56
57UInt16 *HDFTypeFactory::NewUInt16(const string & n) const
58{
59 return new HDFUInt16(n, d_filename);
60}
61
62Int32 *HDFTypeFactory::NewInt32(const string & n) const
63{
64 BESDEBUG("h4", "Inside HDFTypeFactory::NewInt32" << endl);
65 return new HDFInt32(n, d_filename);
66}
67
68UInt32 *HDFTypeFactory::NewUInt32(const string & n) const
69{
70 return new HDFUInt32(n, d_filename);
71}
72
73Float32 *HDFTypeFactory::NewFloat32(const string & n) const
74{
75 return new HDFFloat32(n, d_filename);
76}
77
78Float64 *HDFTypeFactory::NewFloat64(const string & n) const
79{
80 return new HDFFloat64(n, d_filename);
81}
82
83Str *HDFTypeFactory::NewStr(const string & n) const
84{
85 return new HDFStr(n, d_filename);
86}
87
88Url *HDFTypeFactory::NewUrl(const string & n) const
89{
90 return new HDFUrl(n, d_filename);
91}
92
93Array *HDFTypeFactory::NewArray(const string & n, BaseType * v) const
94{
95 return new HDFArray(n, d_filename, v);
96}
97
98Structure *HDFTypeFactory::NewStructure(const string & n) const
99{
100 return new HDFStructure(n, d_filename);
101}
102
103Sequence *HDFTypeFactory::NewSequence(const string & n) const
104{
105 BESDEBUG("h4", "Inside HDFTypeFactory::NewSequence" << endl);
106 return new HDFSequence(n, d_filename);
107}
108
109Grid *HDFTypeFactory::NewGrid(const string & n) const
110{
111 return new HDFGrid(n, d_filename);
112}