bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
ReadTypeFactory.cc
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
27#include <string>
28
29#include <libdap/Byte.h>
30#include <libdap/Int16.h>
31#include <libdap/UInt16.h>
32#include <libdap/Int32.h>
33#include <libdap/UInt32.h>
34#include <libdap/Float32.h>
35#include <libdap/Float64.h>
36#include <libdap/Str.h>
37#include <libdap/Url.h>
38#include <libdap/Array.h>
39#include <libdap/Structure.h>
40#include <ReadSequence.h>
41#include <libdap/Grid.h>
42#include <libdap/debug.h>
43
44#include "ReadTypeFactory.h"
45
46Byte *
47ReadTypeFactory::NewByte(const string &n) const
48{
49 return new Byte(n);
50}
51
52Int16 *
53ReadTypeFactory::NewInt16(const string &n) const
54{
55 return new Int16(n);
56}
57
58UInt16 *
59ReadTypeFactory::NewUInt16(const string &n) const
60{
61 return new UInt16(n);
62}
63
64Int32 *
65ReadTypeFactory::NewInt32(const string &n) const
66{
67 DBG(cerr << "Inside ReadTypeFactory::NewInt32" << endl);
68 return new Int32(n);
69}
70
71UInt32 *
72ReadTypeFactory::NewUInt32(const string &n) const
73{
74 return new UInt32(n);
75}
76
77Float32 *
78ReadTypeFactory::NewFloat32(const string &n) const
79{
80 return new Float32(n);
81}
82
83Float64 *
84ReadTypeFactory::NewFloat64(const string &n) const
85{
86 return new Float64(n);
87}
88
89Str *
90ReadTypeFactory::NewStr(const string &n) const
91{
92 return new Str(n);
93}
94
95Url *
96ReadTypeFactory::NewUrl(const string &n) const
97{
98 return new Url(n);
99}
100
101Array *
102ReadTypeFactory::NewArray(const string &n , BaseType *v) const
103{
104 return new Array(n, v);
105}
106
107Structure *
108ReadTypeFactory::NewStructure(const string &n) const
109{
110 return new Structure(n);
111}
112
113Sequence *
114ReadTypeFactory::NewSequence(const string &n) const
115{
116 DBG(cerr << "Inside ReadTypeFactory::NewSequence" << endl);
117 return new ReadSequence(n);
118}
119
120Grid *
121ReadTypeFactory::NewGrid(const string &n) const
122{
123 return new Grid(n);
124}
125