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