Fixed DevStudio 2003 build with memory check code.
[pwlib.git] / src / ptclib / rfc1155.cxx
blob850a3c8f129de45f6292f7d6ea4b16f4b823c2a5
1 //
2 // rfc1155.cxx
3 //
4 // Code automatically generated by asnparse.
5 //
7 #ifdef P_USE_PRAGMA
8 #pragma implementation "rfc1155.h"
9 #endif
11 #include <ptlib.h>
12 #include <ptclib/rfc1155.h>
14 #define new PNEW
17 #ifdef P_SNMP
20 // ObjectName
23 PRFC1155_ObjectName::PRFC1155_ObjectName(unsigned tag, PASN_Object::TagClass tagClass)
24 : PASN_ObjectId(tag, tagClass)
29 PObject * PRFC1155_ObjectName::Clone() const
31 #ifndef PASN_LEANANDMEAN
32 PAssert(IsClass(PRFC1155_ObjectName::Class()), PInvalidCast);
33 #endif
34 return new PRFC1155_ObjectName(*this);
39 // ObjectSyntax
42 PRFC1155_ObjectSyntax::PRFC1155_ObjectSyntax(unsigned tag, PASN_Object::TagClass tagClass)
43 : PASN_Choice(tag, tagClass, 2, FALSE
44 //#ifndef PASN_NOPRINTON
45 // ,(const PASN_Names *)Names_PRFC1155_ObjectSyntax,0
46 //#endif
52 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
53 PRFC1155_ObjectSyntax::operator PRFC1155_SimpleSyntax &() const
54 #else
55 PRFC1155_ObjectSyntax::operator PRFC1155_SimpleSyntax &()
57 #ifndef PASN_LEANANDMEAN
58 PAssert(PIsDescendant(PAssertNULL(choice), PRFC1155_SimpleSyntax), PInvalidCast);
59 #endif
60 return *(PRFC1155_SimpleSyntax *)choice;
64 PRFC1155_ObjectSyntax::operator const PRFC1155_SimpleSyntax &() const
65 #endif
67 #ifndef PASN_LEANANDMEAN
68 PAssert(PIsDescendant(PAssertNULL(choice), PRFC1155_SimpleSyntax), PInvalidCast);
69 #endif
70 return *(PRFC1155_SimpleSyntax *)choice;
74 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
75 PRFC1155_ObjectSyntax::operator PRFC1155_ApplicationSyntax &() const
76 #else
77 PRFC1155_ObjectSyntax::operator PRFC1155_ApplicationSyntax &()
79 #ifndef PASN_LEANANDMEAN
80 PAssert(PIsDescendant(PAssertNULL(choice), PRFC1155_ApplicationSyntax), PInvalidCast);
81 #endif
82 return *(PRFC1155_ApplicationSyntax *)choice;
86 PRFC1155_ObjectSyntax::operator const PRFC1155_ApplicationSyntax &() const
87 #endif
89 #ifndef PASN_LEANANDMEAN
90 PAssert(PIsDescendant(PAssertNULL(choice), PRFC1155_ApplicationSyntax), PInvalidCast);
91 #endif
92 return *(PRFC1155_ApplicationSyntax *)choice;
96 BOOL PRFC1155_ObjectSyntax::CreateObject()
98 choice = new PRFC1155_SimpleSyntax(tag, tagClass);
99 if (((PASN_Choice*)choice)->CreateObject())
100 return TRUE;
101 delete choice;
103 choice = new PRFC1155_ApplicationSyntax(tag, tagClass);
104 if (((PASN_Choice*)choice)->CreateObject())
105 return TRUE;
106 delete choice;
108 choice = NULL;
109 return FALSE;
113 PObject * PRFC1155_ObjectSyntax::Clone() const
115 #ifndef PASN_LEANANDMEAN
116 PAssert(IsClass(PRFC1155_ObjectSyntax::Class()), PInvalidCast);
117 #endif
118 return new PRFC1155_ObjectSyntax(*this);
123 #ifndef PASN_NOPRINTON
124 const static PASN_Names Names_PRFC1155_SimpleSyntax[]={
125 {"number",2}
126 ,{"string",4}
127 ,{"object",6}
128 ,{"empty",5}
130 #endif
132 // SimpleSyntax
135 PRFC1155_SimpleSyntax::PRFC1155_SimpleSyntax(unsigned tag, PASN_Object::TagClass tagClass)
136 : PASN_Choice(tag, tagClass, 4, FALSE
137 #ifndef PASN_NOPRINTON
138 ,(const PASN_Names *)Names_PRFC1155_SimpleSyntax,4
139 #endif
145 BOOL PRFC1155_SimpleSyntax::CreateObject()
147 switch (tag) {
148 case e_number :
149 choice = new PASN_Integer();
150 return TRUE;
151 case e_string :
152 choice = new PASN_OctetString();
153 return TRUE;
154 case e_object :
155 choice = new PASN_ObjectId();
156 return TRUE;
157 case e_empty :
158 choice = new PASN_Null();
159 return TRUE;
162 choice = NULL;
163 return FALSE;
167 PObject * PRFC1155_SimpleSyntax::Clone() const
169 #ifndef PASN_LEANANDMEAN
170 PAssert(IsClass(PRFC1155_SimpleSyntax::Class()), PInvalidCast);
171 #endif
172 return new PRFC1155_SimpleSyntax(*this);
177 #ifndef PASN_NOPRINTON
178 const static PASN_Names Names_PRFC1155_ApplicationSyntax[]={
179 {"counter",1}
180 ,{"gauge",2}
181 ,{"ticks",3}
182 ,{"arbitrary",4}
184 #endif
186 // ApplicationSyntax
189 PRFC1155_ApplicationSyntax::PRFC1155_ApplicationSyntax(unsigned tag, PASN_Object::TagClass tagClass)
190 : PASN_Choice(tag, tagClass, 5, FALSE
191 #ifndef PASN_NOPRINTON
192 ,(const PASN_Names *)Names_PRFC1155_ApplicationSyntax,4
193 #endif
199 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
200 PRFC1155_ApplicationSyntax::operator PRFC1155_NetworkAddress &() const
201 #else
202 PRFC1155_ApplicationSyntax::operator PRFC1155_NetworkAddress &()
204 #ifndef PASN_LEANANDMEAN
205 PAssert(PIsDescendant(PAssertNULL(choice), PRFC1155_NetworkAddress), PInvalidCast);
206 #endif
207 return *(PRFC1155_NetworkAddress *)choice;
211 PRFC1155_ApplicationSyntax::operator const PRFC1155_NetworkAddress &() const
212 #endif
214 #ifndef PASN_LEANANDMEAN
215 PAssert(PIsDescendant(PAssertNULL(choice), PRFC1155_NetworkAddress), PInvalidCast);
216 #endif
217 return *(PRFC1155_NetworkAddress *)choice;
221 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
222 PRFC1155_ApplicationSyntax::operator PRFC1155_Counter &() const
223 #else
224 PRFC1155_ApplicationSyntax::operator PRFC1155_Counter &()
226 #ifndef PASN_LEANANDMEAN
227 PAssert(PIsDescendant(PAssertNULL(choice), PRFC1155_Counter), PInvalidCast);
228 #endif
229 return *(PRFC1155_Counter *)choice;
233 PRFC1155_ApplicationSyntax::operator const PRFC1155_Counter &() const
234 #endif
236 #ifndef PASN_LEANANDMEAN
237 PAssert(PIsDescendant(PAssertNULL(choice), PRFC1155_Counter), PInvalidCast);
238 #endif
239 return *(PRFC1155_Counter *)choice;
243 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
244 PRFC1155_ApplicationSyntax::operator PRFC1155_Gauge &() const
245 #else
246 PRFC1155_ApplicationSyntax::operator PRFC1155_Gauge &()
248 #ifndef PASN_LEANANDMEAN
249 PAssert(PIsDescendant(PAssertNULL(choice), PRFC1155_Gauge), PInvalidCast);
250 #endif
251 return *(PRFC1155_Gauge *)choice;
255 PRFC1155_ApplicationSyntax::operator const PRFC1155_Gauge &() const
256 #endif
258 #ifndef PASN_LEANANDMEAN
259 PAssert(PIsDescendant(PAssertNULL(choice), PRFC1155_Gauge), PInvalidCast);
260 #endif
261 return *(PRFC1155_Gauge *)choice;
265 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
266 PRFC1155_ApplicationSyntax::operator PRFC1155_TimeTicks &() const
267 #else
268 PRFC1155_ApplicationSyntax::operator PRFC1155_TimeTicks &()
270 #ifndef PASN_LEANANDMEAN
271 PAssert(PIsDescendant(PAssertNULL(choice), PRFC1155_TimeTicks), PInvalidCast);
272 #endif
273 return *(PRFC1155_TimeTicks *)choice;
277 PRFC1155_ApplicationSyntax::operator const PRFC1155_TimeTicks &() const
278 #endif
280 #ifndef PASN_LEANANDMEAN
281 PAssert(PIsDescendant(PAssertNULL(choice), PRFC1155_TimeTicks), PInvalidCast);
282 #endif
283 return *(PRFC1155_TimeTicks *)choice;
287 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
288 PRFC1155_ApplicationSyntax::operator PRFC1155_Opaque &() const
289 #else
290 PRFC1155_ApplicationSyntax::operator PRFC1155_Opaque &()
292 #ifndef PASN_LEANANDMEAN
293 PAssert(PIsDescendant(PAssertNULL(choice), PRFC1155_Opaque), PInvalidCast);
294 #endif
295 return *(PRFC1155_Opaque *)choice;
299 PRFC1155_ApplicationSyntax::operator const PRFC1155_Opaque &() const
300 #endif
302 #ifndef PASN_LEANANDMEAN
303 PAssert(PIsDescendant(PAssertNULL(choice), PRFC1155_Opaque), PInvalidCast);
304 #endif
305 return *(PRFC1155_Opaque *)choice;
309 BOOL PRFC1155_ApplicationSyntax::CreateObject()
311 switch (tag) {
312 case e_counter :
313 choice = new PRFC1155_Counter();
314 return TRUE;
315 case e_gauge :
316 choice = new PRFC1155_Gauge();
317 return TRUE;
318 case e_ticks :
319 choice = new PRFC1155_TimeTicks();
320 return TRUE;
321 case e_arbitrary :
322 choice = new PRFC1155_Opaque();
323 return TRUE;
326 choice = new PRFC1155_NetworkAddress(tag, tagClass);
327 if (((PASN_Choice*)choice)->CreateObject())
328 return TRUE;
329 delete choice;
331 choice = NULL;
332 return FALSE;
336 PObject * PRFC1155_ApplicationSyntax::Clone() const
338 #ifndef PASN_LEANANDMEAN
339 PAssert(IsClass(PRFC1155_ApplicationSyntax::Class()), PInvalidCast);
340 #endif
341 return new PRFC1155_ApplicationSyntax(*this);
346 #ifndef PASN_NOPRINTON
347 const static PASN_Names Names_PRFC1155_NetworkAddress[]={
348 {"internet",0}
350 #endif
352 // NetworkAddress
355 PRFC1155_NetworkAddress::PRFC1155_NetworkAddress(unsigned tag, PASN_Object::TagClass tagClass)
356 : PASN_Choice(tag, tagClass, 1, FALSE
357 #ifndef PASN_NOPRINTON
358 ,(const PASN_Names *)Names_PRFC1155_NetworkAddress,1
359 #endif
365 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
366 PRFC1155_NetworkAddress::operator PRFC1155_IpAddress &() const
367 #else
368 PRFC1155_NetworkAddress::operator PRFC1155_IpAddress &()
370 #ifndef PASN_LEANANDMEAN
371 PAssert(PIsDescendant(PAssertNULL(choice), PRFC1155_IpAddress), PInvalidCast);
372 #endif
373 return *(PRFC1155_IpAddress *)choice;
377 PRFC1155_NetworkAddress::operator const PRFC1155_IpAddress &() const
378 #endif
380 #ifndef PASN_LEANANDMEAN
381 PAssert(PIsDescendant(PAssertNULL(choice), PRFC1155_IpAddress), PInvalidCast);
382 #endif
383 return *(PRFC1155_IpAddress *)choice;
387 BOOL PRFC1155_NetworkAddress::CreateObject()
389 switch (tag) {
390 case e_internet :
391 choice = new PRFC1155_IpAddress();
392 return TRUE;
395 choice = NULL;
396 return FALSE;
400 PObject * PRFC1155_NetworkAddress::Clone() const
402 #ifndef PASN_LEANANDMEAN
403 PAssert(IsClass(PRFC1155_NetworkAddress::Class()), PInvalidCast);
404 #endif
405 return new PRFC1155_NetworkAddress(*this);
410 // IpAddress
413 PRFC1155_IpAddress::PRFC1155_IpAddress(unsigned tag, PASN_Object::TagClass tagClass)
414 : PASN_OctetString(tag, tagClass)
416 SetConstraints(PASN_Object::FixedConstraint, 4);
420 PRFC1155_IpAddress::PRFC1155_IpAddress(const char * v)
422 SetValue(v);
426 PRFC1155_IpAddress::PRFC1155_IpAddress(const PString & v)
428 SetValue(v);
432 PRFC1155_IpAddress::PRFC1155_IpAddress(const PBYTEArray & v)
434 SetValue(v);
438 PRFC1155_IpAddress & PRFC1155_IpAddress::operator=(const char * v)
440 SetValue(v);
441 return *this;
445 PRFC1155_IpAddress & PRFC1155_IpAddress::operator=(const PString & v)
447 SetValue(v);
448 return *this;
452 PRFC1155_IpAddress & PRFC1155_IpAddress::operator=(const PBYTEArray & v)
454 SetValue(v);
455 return *this;
459 PObject * PRFC1155_IpAddress::Clone() const
461 #ifndef PASN_LEANANDMEAN
462 PAssert(IsClass(PRFC1155_IpAddress::Class()), PInvalidCast);
463 #endif
464 return new PRFC1155_IpAddress(*this);
469 // Counter
472 PRFC1155_Counter::PRFC1155_Counter(unsigned tag, PASN_Object::TagClass tagClass)
473 : PASN_Integer(tag, tagClass)
475 SetConstraints(PASN_Object::FixedConstraint, 0, 4294967295U);
479 PRFC1155_Counter & PRFC1155_Counter::operator=(int v)
481 SetValue(v);
482 return *this;
486 PRFC1155_Counter & PRFC1155_Counter::operator=(unsigned v)
488 SetValue(v);
489 return *this;
493 PObject * PRFC1155_Counter::Clone() const
495 #ifndef PASN_LEANANDMEAN
496 PAssert(IsClass(PRFC1155_Counter::Class()), PInvalidCast);
497 #endif
498 return new PRFC1155_Counter(*this);
503 // Gauge
506 PRFC1155_Gauge::PRFC1155_Gauge(unsigned tag, PASN_Object::TagClass tagClass)
507 : PASN_Integer(tag, tagClass)
509 SetConstraints(PASN_Object::FixedConstraint, 0, 4294967295U);
513 PRFC1155_Gauge & PRFC1155_Gauge::operator=(int v)
515 SetValue(v);
516 return *this;
520 PRFC1155_Gauge & PRFC1155_Gauge::operator=(unsigned v)
522 SetValue(v);
523 return *this;
527 PObject * PRFC1155_Gauge::Clone() const
529 #ifndef PASN_LEANANDMEAN
530 PAssert(IsClass(PRFC1155_Gauge::Class()), PInvalidCast);
531 #endif
532 return new PRFC1155_Gauge(*this);
537 // TimeTicks
540 PRFC1155_TimeTicks::PRFC1155_TimeTicks(unsigned tag, PASN_Object::TagClass tagClass)
541 : PASN_Integer(tag, tagClass)
543 SetConstraints(PASN_Object::FixedConstraint, 0, 4294967295U);
547 PRFC1155_TimeTicks & PRFC1155_TimeTicks::operator=(int v)
549 SetValue(v);
550 return *this;
554 PRFC1155_TimeTicks & PRFC1155_TimeTicks::operator=(unsigned v)
556 SetValue(v);
557 return *this;
561 PObject * PRFC1155_TimeTicks::Clone() const
563 #ifndef PASN_LEANANDMEAN
564 PAssert(IsClass(PRFC1155_TimeTicks::Class()), PInvalidCast);
565 #endif
566 return new PRFC1155_TimeTicks(*this);
571 // Opaque
574 PRFC1155_Opaque::PRFC1155_Opaque(unsigned tag, PASN_Object::TagClass tagClass)
575 : PASN_OctetString(tag, tagClass)
580 PRFC1155_Opaque::PRFC1155_Opaque(const char * v)
582 SetValue(v);
586 PRFC1155_Opaque::PRFC1155_Opaque(const PString & v)
588 SetValue(v);
592 PRFC1155_Opaque::PRFC1155_Opaque(const PBYTEArray & v)
594 SetValue(v);
598 PRFC1155_Opaque & PRFC1155_Opaque::operator=(const char * v)
600 SetValue(v);
601 return *this;
605 PRFC1155_Opaque & PRFC1155_Opaque::operator=(const PString & v)
607 SetValue(v);
608 return *this;
612 PRFC1155_Opaque & PRFC1155_Opaque::operator=(const PBYTEArray & v)
614 SetValue(v);
615 return *this;
619 PObject * PRFC1155_Opaque::Clone() const
621 #ifndef PASN_LEANANDMEAN
622 PAssert(IsClass(PRFC1155_Opaque::Class()), PInvalidCast);
623 #endif
624 return new PRFC1155_Opaque(*this);
628 #endif // if ! H323_DISABLE_PRFC1155
631 // End of rfc1155.cxx