bes  Updated for version 3.20.10
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 #include <memory>
30 
31 #include <libdap/D4BaseTypeFactory.h>
32 
33 namespace dmrpp {
34 
35 class DMZ;
41 class DmrppTypeFactory : public libdap::D4BaseTypeFactory {
42  std::shared_ptr<DMZ> d_dmz;
43 
44 public:
45  DmrppTypeFactory() = default;
46  DmrppTypeFactory(std::shared_ptr<DMZ> dmz) : d_dmz(dmz) { }
47 
48  virtual ~DmrppTypeFactory() = default;
49 
50  virtual BaseTypeFactory *ptr_duplicate() const { return new DmrppTypeFactory; }
51 
52  virtual libdap::BaseType *NewVariable(libdap::Type t, const std::string &name) const;
53 
54  virtual libdap::Byte *NewByte(const std::string &n = "") const;
55 
56  // New for DAP4
57  virtual libdap::Int8 *NewInt8(const std::string &n = "") const;
58  virtual libdap::Byte *NewUInt8(const std::string &n = "") const;
59  virtual libdap::Byte *NewChar(const std::string &n = "") const;
60 
61  virtual libdap::Int16 *NewInt16(const std::string &n = "") const;
62  virtual libdap::UInt16 *NewUInt16(const std::string &n = "") const;
63  virtual libdap::Int32 *NewInt32(const std::string &n = "") const;
64  virtual libdap::UInt32 *NewUInt32(const std::string &n = "") const;
65 
66  // New for DAP4
67  virtual libdap::Int64 *NewInt64(const std::string &n = "") const;
68  virtual libdap::UInt64 *NewUInt64(const std::string &n = "") const;
69 
70  virtual libdap::Float32 *NewFloat32(const std::string &n = "") const;
71  virtual libdap::Float64 *NewFloat64(const std::string &n = "") const;
72 
73  virtual libdap::D4Enum *NewEnum(const std::string &n = "", libdap::Type type = libdap::dods_null_c) const;
74 
75  virtual libdap::Str *NewStr(const std::string &n = "") const;
76  virtual libdap::Url *NewUrl(const std::string &n = "") const;
77  virtual libdap::Url *NewURL(const std::string &n = "") const;
78 
79  virtual libdap::D4Opaque *NewOpaque(const std::string &n = "") const;
80 
81  virtual libdap::Array *NewArray(const std::string &n = "", libdap::BaseType *v = 0) const;
82 
83  virtual libdap::Structure *NewStructure(const std::string &n = "") const;
84  virtual libdap::D4Sequence *NewD4Sequence(const std::string &n = "") const;
85 
86  virtual libdap::D4Group *NewGroup(const std::string &n = "") const;
87 };
88 
89 } // namespace dmrpp
90 
91 #endif // _dmrpp_type_factory_h
virtual libdap::Url * NewURL(const std::string &n="") const
Type
Type of JSON value.
Definition: rapidjson.h:664