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