bes  Updated for version 3.20.6
DmrppTypeFactory.h
1 
2 // -*- mode: c++; c-basic-offset:4 -*-
3 
4 // This file is part of the BES
5 
6 // Copyright (c) 2016 OPeNDAP, Inc.
7 // Author: James Gallagher <jgallagher@opendap.org>
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License as published by the Free Software Foundation; either
12 // version 2.1 of the License, or (at your option) any later version.
13 //
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 //
23 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
24 
25 #ifndef _dmrpp_type_factory_h
26 #define _dmrpp_type_factory_h
27 
28 #include <string>
29 
30 #include <D4BaseTypeFactory.h>
31 
32 namespace dmrpp {
33 
39 class DmrppTypeFactory : public libdap::D4BaseTypeFactory {
40 public:
41  DmrppTypeFactory() {}
42  virtual ~DmrppTypeFactory() {}
43 
44  virtual BaseTypeFactory *ptr_duplicate() const { return new DmrppTypeFactory; }
45 
46  virtual libdap::BaseType *NewVariable(libdap::Type t, const std::string &name) const;
47 
48  virtual libdap::Byte *NewByte(const std::string &n = "") const;
49 
50  // New for DAP4
51  virtual libdap::Int8 *NewInt8(const std::string &n = "") const;
52  virtual libdap::Byte *NewUInt8(const std::string &n = "") const;
53  virtual libdap::Byte *NewChar(const std::string &n = "") const;
54 
55  virtual libdap::Int16 *NewInt16(const std::string &n = "") const;
56  virtual libdap::UInt16 *NewUInt16(const std::string &n = "") const;
57  virtual libdap::Int32 *NewInt32(const std::string &n = "") const;
58  virtual libdap::UInt32 *NewUInt32(const std::string &n = "") const;
59 
60  // New for DAP4
61  virtual libdap::Int64 *NewInt64(const std::string &n = "") const;
62  virtual libdap::UInt64 *NewUInt64(const std::string &n = "") const;
63 
64  virtual libdap::Float32 *NewFloat32(const std::string &n = "") const;
65  virtual libdap::Float64 *NewFloat64(const std::string &n = "") const;
66 
67  virtual libdap::D4Enum *NewEnum(const std::string &n = "", libdap::Type type = libdap::dods_null_c) const;
68 
69  virtual libdap::Str *NewStr(const std::string &n = "") const;
70  virtual libdap::Url *NewUrl(const std::string &n = "") const;
71  virtual libdap::Url *NewURL(const std::string &n = "") const;
72 
73  virtual libdap::D4Opaque *NewOpaque(const std::string &n = "") const;
74 
75  virtual libdap::Array *NewArray(const std::string &n = "", libdap::BaseType *v = 0) const;
76 
77  virtual libdap::Structure *NewStructure(const std::string &n = "") const;
78  virtual libdap::D4Sequence *NewD4Sequence(const std::string &n = "") const;
79 
80  virtual libdap::D4Group *NewGroup(const std::string &n = "") const;
81 };
82 
83 } // namespace dmrpp
84 
85 #endif // _dmrpp_type_factory_h
BaseTypeFactory
dmrpp::DmrppTypeFactory
Definition: DmrppTypeFactory.h:39
Type
Type
Type of JSON value.
Definition: cmr_module/rapidjson/rapidjson.h:603
dmrpp::DmrppTypeFactory::NewURL
virtual libdap::Url * NewURL(const std::string &n="") const
Definition: DmrppTypeFactory.cc:219