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 Byte * 00047 BaseTypeFactory::NewByte(const string &n) const 00048 { 00049 return new Byte(n); 00050 } 00051 00052 Int16 * 00053 BaseTypeFactory::NewInt16(const string &n) const 00054 { 00055 return new Int16(n); 00056 } 00057 00058 UInt16 * 00059 BaseTypeFactory::NewUInt16(const string &n) const 00060 { 00061 return new UInt16(n); 00062 } 00063 00064 Int32 * 00065 BaseTypeFactory::NewInt32(const string &n) const 00066 { 00067 DBG(cerr << "Inside BaseTypeFactory::NewInt32" << endl); 00068 return new Int32(n); 00069 } 00070 00071 UInt32 * 00072 BaseTypeFactory::NewUInt32(const string &n) const 00073 { 00074 return new UInt32(n); 00075 } 00076 00077 Float32 * 00078 BaseTypeFactory::NewFloat32(const string &n) const 00079 { 00080 return new Float32(n); 00081 } 00082 00083 Float64 * 00084 BaseTypeFactory::NewFloat64(const string &n) const 00085 { 00086 return new Float64(n); 00087 } 00088 00089 Str * 00090 BaseTypeFactory::NewStr(const string &n) const 00091 { 00092 return new Str(n); 00093 } 00094 00095 Url * 00096 BaseTypeFactory::NewUrl(const string &n) const 00097 { 00098 return new Url(n); 00099 } 00100 00101 Array * 00102 BaseTypeFactory::NewArray(const string &n , BaseType *v) const 00103 { 00104 return new Array(n, v); 00105 } 00106 00107 Structure * 00108 BaseTypeFactory::NewStructure(const string &n) const 00109 { 00110 return new Structure(n); 00111 } 00112 00113 Sequence * 00114 BaseTypeFactory::NewSequence(const string &n) const 00115 { 00116 DBG(cerr << "Inside BaseTypeFactory::NewSequence" << endl); 00117 return new Sequence(n); 00118 } 00119 00120 Grid * 00121 BaseTypeFactory::NewGrid(const string &n) const 00122 { 00123 return new Grid(n); 00124 }