31 #include "DmrppByte.h"
33 #include "DmrppInt8.h"
35 #include "DmrppInt16.h"
36 #include "DmrppUInt16.h"
37 #include "DmrppInt32.h"
38 #include "DmrppUInt32.h"
40 #include "DmrppInt64.h"
41 #include "DmrppUInt64.h"
43 #include "DmrppFloat32.h"
44 #include "DmrppFloat64.h"
49 #include "DmrppD4Enum.h"
51 #include "DmrppD4Opaque.h"
53 #include "DmrppArray.h"
54 #include "DmrppStructure.h"
56 #include "DmrppD4Sequence.h"
57 #include "DmrppD4Group.h"
59 #include "DmrppTypeFactory.h"
64 #define prolog string("DmrppTypeFactory::").append(__func__).append("() - ")
65 #define MODULE "dmrpp"
69 BaseType *DmrppTypeFactory::NewVariable(
Type t,
const string &name)
const
78 return NewUInt8(name);
83 return NewInt16(name);
85 return NewUInt16(name);
87 return NewInt32(name);
89 return NewUInt32(name);
92 return NewInt64(name);
94 return NewUInt64(name);
97 return NewFloat32(name);
99 return NewFloat64(name);
107 return NewEnum(name);
110 return NewOpaque(name);
113 return NewArray(name);
115 case dods_structure_c:
116 return NewStructure(name);
118 case dods_sequence_c:
119 return NewD4Sequence(name);
122 return NewGroup(name);
125 throw BESError(
"Unimplemented type in DAP4.", BES_INTERNAL_ERROR, __FILE__, __LINE__);
130 DmrppTypeFactory::NewByte(
const string &n)
const
132 return new DmrppByte(n);
136 DmrppTypeFactory::NewChar(
const string &n)
const
138 Byte *b =
new DmrppByte(n);
139 b->set_type(dods_char_c);
144 DmrppTypeFactory::NewUInt8(
const string &n)
const
146 Byte *b =
new DmrppByte(n);
147 b->set_type(dods_uint8_c);
152 DmrppTypeFactory::NewInt8(
const string &n)
const
154 return new DmrppInt8(n);
158 DmrppTypeFactory::NewInt16(
const string &n)
const
160 return new DmrppInt16(n);
164 DmrppTypeFactory::NewUInt16(
const string &n)
const
166 return new DmrppUInt16(n);
170 DmrppTypeFactory::NewInt32(
const string &n)
const
172 BESDEBUG(MODULE, prolog <<
"Making a new DmrppInt32 object named: " << n << endl);
173 return new DmrppInt32(n);
177 DmrppTypeFactory::NewUInt32(
const string &n)
const
179 return new DmrppUInt32(n);
183 DmrppTypeFactory::NewInt64(
const string &n)
const
185 BESDEBUG(MODULE, prolog <<
"Making a new DmrppInt64 object named: " << n << endl);
186 return new DmrppInt64(n);
190 DmrppTypeFactory::NewUInt64(
const string &n)
const
192 return new DmrppUInt64(n);
196 DmrppTypeFactory::NewFloat32(
const string &n)
const
198 return new DmrppFloat32(n);
202 DmrppTypeFactory::NewFloat64(
const string &n)
const
204 return new DmrppFloat64(n);
208 DmrppTypeFactory::NewStr(
const string &n)
const
210 return new DmrppStr(n);
214 DmrppTypeFactory::NewUrl(
const string &n)
const
216 return new DmrppUrl(n);
222 DmrppTypeFactory::NewURL(
const string &n)
const
228 DmrppTypeFactory::NewOpaque(
const string &n)
const
234 DmrppTypeFactory::NewEnum(
const string &name,
Type type)
const
236 return new DmrppD4Enum(name, type);
240 DmrppTypeFactory::NewArray(
const string &n, BaseType *v)
const
242 return new DmrppArray(n, v);
246 DmrppTypeFactory::NewStructure(
const string &n)
const
248 return new DmrppStructure(n);
252 DmrppTypeFactory::NewD4Sequence(
const string &n)
const
254 return new DmrppD4Sequence(n);
258 DmrppTypeFactory::NewGroup(
const string &n)
const
260 return new DmrppD4Group(n);
Abstract exception class for the BES with basic string message.