libdap++ Updated for version 3.8.2
|
00001 00002 // -*- mode: c++; c-basic-offset:4 -*- 00003 00004 // This file is part of libdap, A C++ implementation of the OPeNDAP Data 00005 // Access Protocol. 00006 00007 // Copyright (c) 2005 OPeNDAP, Inc. 00008 // Author: James Gallagher <jgallagher@opendap.org> 00009 // 00010 // This library is free software; you can redistribute it and/or 00011 // modify it under the terms of the GNU Lesser General Public 00012 // License as published by the Free Software Foundation; either 00013 // version 2.1 of the License, or (at your option) any later version. 00014 // 00015 // This library is distributed in the hope that it will be useful, 00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 // Lesser General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU Lesser General Public 00021 // License along with this library; if not, write to the Free Software 00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 // 00024 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. 00025 00026 00027 #include <string> 00028 00029 #include "Byte.h" 00030 #include "Int16.h" 00031 #include "UInt16.h" 00032 #include "Int32.h" 00033 #include "UInt32.h" 00034 #include "Float32.h" 00035 #include "Float64.h" 00036 #include "Str.h" 00037 #include "Url.h" 00038 #include "Array.h" 00039 #include "Structure.h" 00040 #include "Sequence.h" 00041 #include "Grid.h" 00042 00043 #include "BaseTypeFactory.h" 00044 #include "debug.h" 00045 00046 namespace libdap { 00047 00048 Byte * 00049 BaseTypeFactory::NewByte(const string &n) const 00050 { 00051 return new Byte(n); 00052 } 00053 00054 Int16 * 00055 BaseTypeFactory::NewInt16(const string &n) const 00056 { 00057 return new Int16(n); 00058 } 00059 00060 UInt16 * 00061 BaseTypeFactory::NewUInt16(const string &n) const 00062 { 00063 return new UInt16(n); 00064 } 00065 00066 Int32 * 00067 BaseTypeFactory::NewInt32(const string &n) const 00068 { 00069 DBG(cerr << "Inside BaseTypeFactory::NewInt32" << endl); 00070 return new Int32(n); 00071 } 00072 00073 UInt32 * 00074 BaseTypeFactory::NewUInt32(const string &n) const 00075 { 00076 return new UInt32(n); 00077 } 00078 00079 Float32 * 00080 BaseTypeFactory::NewFloat32(const string &n) const 00081 { 00082 return new Float32(n); 00083 } 00084 00085 Float64 * 00086 BaseTypeFactory::NewFloat64(const string &n) const 00087 { 00088 return new Float64(n); 00089 } 00090 00091 Str * 00092 BaseTypeFactory::NewStr(const string &n) const 00093 { 00094 return new Str(n); 00095 } 00096 00097 Url * 00098 BaseTypeFactory::NewUrl(const string &n) const 00099 { 00100 return new Url(n); 00101 } 00102 00103 Array * 00104 BaseTypeFactory::NewArray(const string &n , BaseType *v) const 00105 { 00106 return new Array(n, v); 00107 } 00108 00109 Structure * 00110 BaseTypeFactory::NewStructure(const string &n) const 00111 { 00112 return new Structure(n); 00113 } 00114 00115 Sequence * 00116 BaseTypeFactory::NewSequence(const string &n) const 00117 { 00118 DBG(cerr << "Inside BaseTypeFactory::NewSequence" << endl); 00119 return new Sequence(n); 00120 } 00121 00122 Grid * 00123 BaseTypeFactory::NewGrid(const string &n) const 00124 { 00125 return new Grid(n); 00126 } 00127 00128 } // namespace libdap