libdap
Updated for version 3.17.0
|
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) 2012 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00023 // 00024 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112. 00025 00026 #ifndef dap4_base_type_factory_h 00027 #define dap4_base_type_factory_h 00028 00029 #include <string> 00030 00031 #include "BaseTypeFactory.h" 00032 #include "Type.h" 00033 00034 // Class declarations; Make sure to include the corresponding headers in the 00035 // implementation file. 00036 00037 namespace libdap 00038 { 00039 00040 class Byte; 00041 class Int8; 00042 class Int16; 00043 class UInt16; 00044 class Int32; 00045 class UInt32; 00046 class Int64; 00047 class UInt64; 00048 00049 class Float32; 00050 class Float64; 00051 00052 class Str; 00053 class Url; 00054 00055 class D4Enum; 00056 class D4Opaque; 00057 00058 class Array; 00059 00060 class Structure; 00061 class D4Sequence; 00062 00063 class D4Group; 00064 00065 class BaseType; 00066 00072 class D4BaseTypeFactory: public BaseTypeFactory 00073 { 00074 public: 00075 D4BaseTypeFactory() 00076 {} 00077 virtual ~D4BaseTypeFactory() 00078 {} 00079 00080 virtual BaseType *NewVariable(Type t, const string &name) const; 00081 00082 virtual BaseTypeFactory *ptr_duplicate() const { 00083 return new D4BaseTypeFactory; 00084 } 00085 00086 virtual Byte *NewByte(const string &n = "") const; 00087 00088 // The Int8 types are new for DAP4 00089 virtual Int8 *NewInt8(const string &n = "") const; 00090 virtual Byte *NewChar(const string &n = "") const; 00091 virtual Byte *NewUInt8(const string &n = "") const; 00092 00093 virtual Int16 *NewInt16(const string &n = "") const; 00094 virtual UInt16 *NewUInt16(const string &n = "") const; 00095 virtual Int32 *NewInt32(const string &n = "") const; 00096 virtual UInt32 *NewUInt32(const string &n = "") const; 00097 00098 // New for DAP4 00099 virtual Int64 *NewInt64(const string &n = "") const; 00100 virtual UInt64 *NewUInt64(const string &n = "") const; 00101 00102 virtual Float32 *NewFloat32(const string &n = "") const; 00103 virtual Float64 *NewFloat64(const string &n = "") const; 00104 00105 virtual D4Enum *NewEnum(const string &n = "", Type type = dods_null_c) const; 00106 00107 virtual Str *NewStr(const string &n = "") const; 00108 virtual Url *NewUrl(const string &n = "") const; 00109 virtual Url *NewURL(const string &n = "") const; 00110 00111 virtual D4Opaque *NewOpaque(const string &n = "") const; 00112 00113 virtual Array *NewArray(const string &n = "", BaseType *v = 0) const; 00114 00115 virtual Structure *NewStructure(const string &n = "") const; 00116 virtual D4Sequence *NewD4Sequence(const string &n = "") const; 00117 00118 virtual D4Group *NewGroup(const string &n = "") const; 00119 }; 00120 00121 } // namespace libdap 00122 00123 #endif // dap4_base_type_factory_h