OSDN Git Service

Add MS7619SE
[uclinux-h8/uClinux-dist.git] / lib / libopenh323 / src / x880.cxx
1 //
2 // x880.cxx
3 //
4 // Code automatically generated by asnparse.
5 //
6
7 #ifdef P_USE_PRAGMA
8 #pragma implementation "x880.h"
9 #endif
10
11 #include <ptlib.h>
12 #include "x880.h"
13
14 #define new PNEW
15
16
17 #if ! H323_DISABLE_X880
18
19
20 #ifndef PASN_NOPRINTON
21 const static PASN_Names Names_X880_ROS[]={
22       {"invoke",0}
23      ,{"returnResult",1}
24      ,{"returnError",2}
25      ,{"reject",3}
26 };
27 #endif
28 //
29 // ROS
30 //
31
32 X880_ROS::X880_ROS(unsigned tag, PASN_Object::TagClass tagClass)
33   : PASN_Choice(tag, tagClass, 4, FALSE
34 #ifndef PASN_NOPRINTON
35     ,(const PASN_Names *)Names_X880_ROS,4
36 #endif
37 )
38 {
39 }
40
41
42 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
43 X880_ROS::operator X880_Invoke &() const
44 #else
45 X880_ROS::operator X880_Invoke &()
46 {
47 #ifndef PASN_LEANANDMEAN
48   PAssert(PIsDescendant(PAssertNULL(choice), X880_Invoke), PInvalidCast);
49 #endif
50   return *(X880_Invoke *)choice;
51 }
52
53
54 X880_ROS::operator const X880_Invoke &() const
55 #endif
56 {
57 #ifndef PASN_LEANANDMEAN
58   PAssert(PIsDescendant(PAssertNULL(choice), X880_Invoke), PInvalidCast);
59 #endif
60   return *(X880_Invoke *)choice;
61 }
62
63
64 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
65 X880_ROS::operator X880_ReturnResult &() const
66 #else
67 X880_ROS::operator X880_ReturnResult &()
68 {
69 #ifndef PASN_LEANANDMEAN
70   PAssert(PIsDescendant(PAssertNULL(choice), X880_ReturnResult), PInvalidCast);
71 #endif
72   return *(X880_ReturnResult *)choice;
73 }
74
75
76 X880_ROS::operator const X880_ReturnResult &() const
77 #endif
78 {
79 #ifndef PASN_LEANANDMEAN
80   PAssert(PIsDescendant(PAssertNULL(choice), X880_ReturnResult), PInvalidCast);
81 #endif
82   return *(X880_ReturnResult *)choice;
83 }
84
85
86 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
87 X880_ROS::operator X880_ReturnError &() const
88 #else
89 X880_ROS::operator X880_ReturnError &()
90 {
91 #ifndef PASN_LEANANDMEAN
92   PAssert(PIsDescendant(PAssertNULL(choice), X880_ReturnError), PInvalidCast);
93 #endif
94   return *(X880_ReturnError *)choice;
95 }
96
97
98 X880_ROS::operator const X880_ReturnError &() const
99 #endif
100 {
101 #ifndef PASN_LEANANDMEAN
102   PAssert(PIsDescendant(PAssertNULL(choice), X880_ReturnError), PInvalidCast);
103 #endif
104   return *(X880_ReturnError *)choice;
105 }
106
107
108 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
109 X880_ROS::operator X880_Reject &() const
110 #else
111 X880_ROS::operator X880_Reject &()
112 {
113 #ifndef PASN_LEANANDMEAN
114   PAssert(PIsDescendant(PAssertNULL(choice), X880_Reject), PInvalidCast);
115 #endif
116   return *(X880_Reject *)choice;
117 }
118
119
120 X880_ROS::operator const X880_Reject &() const
121 #endif
122 {
123 #ifndef PASN_LEANANDMEAN
124   PAssert(PIsDescendant(PAssertNULL(choice), X880_Reject), PInvalidCast);
125 #endif
126   return *(X880_Reject *)choice;
127 }
128
129
130 BOOL X880_ROS::CreateObject()
131 {
132   switch (tag) {
133     case e_invoke :
134       choice = new X880_Invoke(1, ContextSpecificTagClass);
135       return TRUE;
136     case e_returnResult :
137       choice = new X880_ReturnResult(2, ContextSpecificTagClass);
138       return TRUE;
139     case e_returnError :
140       choice = new X880_ReturnError(3, ContextSpecificTagClass);
141       return TRUE;
142     case e_reject :
143       choice = new X880_Reject(4, ContextSpecificTagClass);
144       return TRUE;
145   }
146
147   choice = NULL;
148   return FALSE;
149 }
150
151
152 PObject * X880_ROS::Clone() const
153 {
154 #ifndef PASN_LEANANDMEAN
155   PAssert(IsClass(X880_ROS::Class()), PInvalidCast);
156 #endif
157   return new X880_ROS(*this);
158 }
159
160
161 //
162 // GeneralProblem
163 //
164
165 X880_GeneralProblem::X880_GeneralProblem(unsigned tag, PASN_Object::TagClass tagClass)
166   : PASN_Integer(tag, tagClass)
167 {
168 }
169
170
171 X880_GeneralProblem & X880_GeneralProblem::operator=(int v)
172 {
173   SetValue(v);
174   return *this;
175 }
176
177
178 X880_GeneralProblem & X880_GeneralProblem::operator=(unsigned v)
179 {
180   SetValue(v);
181   return *this;
182 }
183
184
185 PObject * X880_GeneralProblem::Clone() const
186 {
187 #ifndef PASN_LEANANDMEAN
188   PAssert(IsClass(X880_GeneralProblem::Class()), PInvalidCast);
189 #endif
190   return new X880_GeneralProblem(*this);
191 }
192
193
194 //
195 // InvokeProblem
196 //
197
198 X880_InvokeProblem::X880_InvokeProblem(unsigned tag, PASN_Object::TagClass tagClass)
199   : PASN_Integer(tag, tagClass)
200 {
201 }
202
203
204 X880_InvokeProblem & X880_InvokeProblem::operator=(int v)
205 {
206   SetValue(v);
207   return *this;
208 }
209
210
211 X880_InvokeProblem & X880_InvokeProblem::operator=(unsigned v)
212 {
213   SetValue(v);
214   return *this;
215 }
216
217
218 PObject * X880_InvokeProblem::Clone() const
219 {
220 #ifndef PASN_LEANANDMEAN
221   PAssert(IsClass(X880_InvokeProblem::Class()), PInvalidCast);
222 #endif
223   return new X880_InvokeProblem(*this);
224 }
225
226
227 //
228 // ReturnResultProblem
229 //
230
231 X880_ReturnResultProblem::X880_ReturnResultProblem(unsigned tag, PASN_Object::TagClass tagClass)
232   : PASN_Integer(tag, tagClass)
233 {
234 }
235
236
237 X880_ReturnResultProblem & X880_ReturnResultProblem::operator=(int v)
238 {
239   SetValue(v);
240   return *this;
241 }
242
243
244 X880_ReturnResultProblem & X880_ReturnResultProblem::operator=(unsigned v)
245 {
246   SetValue(v);
247   return *this;
248 }
249
250
251 PObject * X880_ReturnResultProblem::Clone() const
252 {
253 #ifndef PASN_LEANANDMEAN
254   PAssert(IsClass(X880_ReturnResultProblem::Class()), PInvalidCast);
255 #endif
256   return new X880_ReturnResultProblem(*this);
257 }
258
259
260 //
261 // ReturnErrorProblem
262 //
263
264 X880_ReturnErrorProblem::X880_ReturnErrorProblem(unsigned tag, PASN_Object::TagClass tagClass)
265   : PASN_Integer(tag, tagClass)
266 {
267 }
268
269
270 X880_ReturnErrorProblem & X880_ReturnErrorProblem::operator=(int v)
271 {
272   SetValue(v);
273   return *this;
274 }
275
276
277 X880_ReturnErrorProblem & X880_ReturnErrorProblem::operator=(unsigned v)
278 {
279   SetValue(v);
280   return *this;
281 }
282
283
284 PObject * X880_ReturnErrorProblem::Clone() const
285 {
286 #ifndef PASN_LEANANDMEAN
287   PAssert(IsClass(X880_ReturnErrorProblem::Class()), PInvalidCast);
288 #endif
289   return new X880_ReturnErrorProblem(*this);
290 }
291
292
293 //
294 // RejectProblem
295 //
296
297 X880_RejectProblem::X880_RejectProblem(unsigned tag, PASN_Object::TagClass tagClass)
298   : PASN_Integer(tag, tagClass)
299 {
300 }
301
302
303 X880_RejectProblem & X880_RejectProblem::operator=(int v)
304 {
305   SetValue(v);
306   return *this;
307 }
308
309
310 X880_RejectProblem & X880_RejectProblem::operator=(unsigned v)
311 {
312   SetValue(v);
313   return *this;
314 }
315
316
317 PObject * X880_RejectProblem::Clone() const
318 {
319 #ifndef PASN_LEANANDMEAN
320   PAssert(IsClass(X880_RejectProblem::Class()), PInvalidCast);
321 #endif
322   return new X880_RejectProblem(*this);
323 }
324
325
326 //
327 // InvokeId
328 //
329
330 X880_InvokeId::X880_InvokeId(unsigned tag, PASN_Object::TagClass tagClass)
331   : PASN_Integer(tag, tagClass)
332 {
333 }
334
335
336 X880_InvokeId & X880_InvokeId::operator=(int v)
337 {
338   SetValue(v);
339   return *this;
340 }
341
342
343 X880_InvokeId & X880_InvokeId::operator=(unsigned v)
344 {
345   SetValue(v);
346   return *this;
347 }
348
349
350 PObject * X880_InvokeId::Clone() const
351 {
352 #ifndef PASN_LEANANDMEAN
353   PAssert(IsClass(X880_InvokeId::Class()), PInvalidCast);
354 #endif
355   return new X880_InvokeId(*this);
356 }
357
358
359
360 #ifndef PASN_NOPRINTON
361 const static PASN_Names Names_X880_Code[]={
362       {"local",0}
363      ,{"global",1}
364 };
365 #endif
366 //
367 // Code
368 //
369
370 X880_Code::X880_Code(unsigned tag, PASN_Object::TagClass tagClass)
371   : PASN_Choice(tag, tagClass, 2, FALSE
372 #ifndef PASN_NOPRINTON
373     ,(const PASN_Names *)Names_X880_Code,2
374 #endif
375 )
376 {
377 }
378
379
380 BOOL X880_Code::CreateObject()
381 {
382   switch (tag) {
383     case e_local :
384       choice = new PASN_Integer();
385       return TRUE;
386     case e_global :
387       choice = new PASN_ObjectId();
388       return TRUE;
389   }
390
391   choice = NULL;
392   return FALSE;
393 }
394
395
396 PObject * X880_Code::Clone() const
397 {
398 #ifndef PASN_LEANANDMEAN
399   PAssert(IsClass(X880_Code::Class()), PInvalidCast);
400 #endif
401   return new X880_Code(*this);
402 }
403
404
405 //
406 // ReturnResult_result
407 //
408
409 X880_ReturnResult_result::X880_ReturnResult_result(unsigned tag, PASN_Object::TagClass tagClass)
410   : PASN_Sequence(tag, tagClass, 0, TRUE, 0)
411 {
412 }
413
414
415 #ifndef PASN_NOPRINTON
416 void X880_ReturnResult_result::PrintOn(ostream & strm) const
417 {
418   int indent = strm.precision() + 2;
419   strm << "{\n";
420   strm << setw(indent+9) << "opcode = " << setprecision(indent) << m_opcode << '\n';
421   strm << setw(indent+9) << "result = " << setprecision(indent) << m_result << '\n';
422   strm << setw(indent-1) << setprecision(indent-2) << "}";
423 }
424 #endif
425
426
427 PObject::Comparison X880_ReturnResult_result::Compare(const PObject & obj) const
428 {
429 #ifndef PASN_LEANANDMEAN
430   PAssert(PIsDescendant(&obj, X880_ReturnResult_result), PInvalidCast);
431 #endif
432   const X880_ReturnResult_result & other = (const X880_ReturnResult_result &)obj;
433
434   Comparison result;
435
436   if ((result = m_opcode.Compare(other.m_opcode)) != EqualTo)
437     return result;
438   if ((result = m_result.Compare(other.m_result)) != EqualTo)
439     return result;
440
441   return PASN_Sequence::Compare(other);
442 }
443
444
445 PINDEX X880_ReturnResult_result::GetDataLength() const
446 {
447   PINDEX length = 0;
448   length += m_opcode.GetObjectLength();
449   length += m_result.GetObjectLength();
450   return length;
451 }
452
453
454 BOOL X880_ReturnResult_result::Decode(PASN_Stream & strm)
455 {
456   if (!PreambleDecode(strm))
457     return FALSE;
458
459   if (!m_opcode.Decode(strm))
460     return FALSE;
461   if (!m_result.Decode(strm))
462     return FALSE;
463
464   return UnknownExtensionsDecode(strm);
465 }
466
467
468 void X880_ReturnResult_result::Encode(PASN_Stream & strm) const
469 {
470   PreambleEncode(strm);
471
472   m_opcode.Encode(strm);
473   m_result.Encode(strm);
474
475   UnknownExtensionsEncode(strm);
476 }
477
478
479 PObject * X880_ReturnResult_result::Clone() const
480 {
481 #ifndef PASN_LEANANDMEAN
482   PAssert(IsClass(X880_ReturnResult_result::Class()), PInvalidCast);
483 #endif
484   return new X880_ReturnResult_result(*this);
485 }
486
487
488
489 #ifndef PASN_NOPRINTON
490 const static PASN_Names Names_X880_Reject_problem[]={
491       {"general",0}
492      ,{"invoke",1}
493      ,{"returnResult",2}
494      ,{"returnError",3}
495 };
496 #endif
497 //
498 // Reject_problem
499 //
500
501 X880_Reject_problem::X880_Reject_problem(unsigned tag, PASN_Object::TagClass tagClass)
502   : PASN_Choice(tag, tagClass, 4, FALSE
503 #ifndef PASN_NOPRINTON
504     ,(const PASN_Names *)Names_X880_Reject_problem,4
505 #endif
506 )
507 {
508 }
509
510
511 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
512 X880_Reject_problem::operator X880_GeneralProblem &() const
513 #else
514 X880_Reject_problem::operator X880_GeneralProblem &()
515 {
516 #ifndef PASN_LEANANDMEAN
517   PAssert(PIsDescendant(PAssertNULL(choice), X880_GeneralProblem), PInvalidCast);
518 #endif
519   return *(X880_GeneralProblem *)choice;
520 }
521
522
523 X880_Reject_problem::operator const X880_GeneralProblem &() const
524 #endif
525 {
526 #ifndef PASN_LEANANDMEAN
527   PAssert(PIsDescendant(PAssertNULL(choice), X880_GeneralProblem), PInvalidCast);
528 #endif
529   return *(X880_GeneralProblem *)choice;
530 }
531
532
533 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
534 X880_Reject_problem::operator X880_InvokeProblem &() const
535 #else
536 X880_Reject_problem::operator X880_InvokeProblem &()
537 {
538 #ifndef PASN_LEANANDMEAN
539   PAssert(PIsDescendant(PAssertNULL(choice), X880_InvokeProblem), PInvalidCast);
540 #endif
541   return *(X880_InvokeProblem *)choice;
542 }
543
544
545 X880_Reject_problem::operator const X880_InvokeProblem &() const
546 #endif
547 {
548 #ifndef PASN_LEANANDMEAN
549   PAssert(PIsDescendant(PAssertNULL(choice), X880_InvokeProblem), PInvalidCast);
550 #endif
551   return *(X880_InvokeProblem *)choice;
552 }
553
554
555 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
556 X880_Reject_problem::operator X880_ReturnResultProblem &() const
557 #else
558 X880_Reject_problem::operator X880_ReturnResultProblem &()
559 {
560 #ifndef PASN_LEANANDMEAN
561   PAssert(PIsDescendant(PAssertNULL(choice), X880_ReturnResultProblem), PInvalidCast);
562 #endif
563   return *(X880_ReturnResultProblem *)choice;
564 }
565
566
567 X880_Reject_problem::operator const X880_ReturnResultProblem &() const
568 #endif
569 {
570 #ifndef PASN_LEANANDMEAN
571   PAssert(PIsDescendant(PAssertNULL(choice), X880_ReturnResultProblem), PInvalidCast);
572 #endif
573   return *(X880_ReturnResultProblem *)choice;
574 }
575
576
577 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
578 X880_Reject_problem::operator X880_ReturnErrorProblem &() const
579 #else
580 X880_Reject_problem::operator X880_ReturnErrorProblem &()
581 {
582 #ifndef PASN_LEANANDMEAN
583   PAssert(PIsDescendant(PAssertNULL(choice), X880_ReturnErrorProblem), PInvalidCast);
584 #endif
585   return *(X880_ReturnErrorProblem *)choice;
586 }
587
588
589 X880_Reject_problem::operator const X880_ReturnErrorProblem &() const
590 #endif
591 {
592 #ifndef PASN_LEANANDMEAN
593   PAssert(PIsDescendant(PAssertNULL(choice), X880_ReturnErrorProblem), PInvalidCast);
594 #endif
595   return *(X880_ReturnErrorProblem *)choice;
596 }
597
598
599 BOOL X880_Reject_problem::CreateObject()
600 {
601   switch (tag) {
602     case e_general :
603       choice = new X880_GeneralProblem();
604       return TRUE;
605     case e_invoke :
606       choice = new X880_InvokeProblem();
607       return TRUE;
608     case e_returnResult :
609       choice = new X880_ReturnResultProblem();
610       return TRUE;
611     case e_returnError :
612       choice = new X880_ReturnErrorProblem();
613       return TRUE;
614   }
615
616   choice = NULL;
617   return FALSE;
618 }
619
620
621 PObject * X880_Reject_problem::Clone() const
622 {
623 #ifndef PASN_LEANANDMEAN
624   PAssert(IsClass(X880_Reject_problem::Class()), PInvalidCast);
625 #endif
626   return new X880_Reject_problem(*this);
627 }
628
629
630 //
631 // Invoke
632 //
633
634 X880_Invoke::X880_Invoke(unsigned tag, PASN_Object::TagClass tagClass)
635   : PASN_Sequence(tag, tagClass, 2, FALSE, 0)
636 {
637   m_invokeId.SetConstraints(PASN_Object::FixedConstraint, 0, 65535);
638 }
639
640
641 #ifndef PASN_NOPRINTON
642 void X880_Invoke::PrintOn(ostream & strm) const
643 {
644   int indent = strm.precision() + 2;
645   strm << "{\n";
646   strm << setw(indent+11) << "invokeId = " << setprecision(indent) << m_invokeId << '\n';
647   if (HasOptionalField(e_linkedId))
648     strm << setw(indent+11) << "linkedId = " << setprecision(indent) << m_linkedId << '\n';
649   strm << setw(indent+9) << "opcode = " << setprecision(indent) << m_opcode << '\n';
650   if (HasOptionalField(e_argument))
651     strm << setw(indent+11) << "argument = " << setprecision(indent) << m_argument << '\n';
652   strm << setw(indent-1) << setprecision(indent-2) << "}";
653 }
654 #endif
655
656
657 PObject::Comparison X880_Invoke::Compare(const PObject & obj) const
658 {
659 #ifndef PASN_LEANANDMEAN
660   PAssert(PIsDescendant(&obj, X880_Invoke), PInvalidCast);
661 #endif
662   const X880_Invoke & other = (const X880_Invoke &)obj;
663
664   Comparison result;
665
666   if ((result = m_invokeId.Compare(other.m_invokeId)) != EqualTo)
667     return result;
668   if ((result = m_linkedId.Compare(other.m_linkedId)) != EqualTo)
669     return result;
670   if ((result = m_opcode.Compare(other.m_opcode)) != EqualTo)
671     return result;
672   if ((result = m_argument.Compare(other.m_argument)) != EqualTo)
673     return result;
674
675   return PASN_Sequence::Compare(other);
676 }
677
678
679 PINDEX X880_Invoke::GetDataLength() const
680 {
681   PINDEX length = 0;
682   length += m_invokeId.GetObjectLength();
683   if (HasOptionalField(e_linkedId))
684     length += m_linkedId.GetObjectLength();
685   length += m_opcode.GetObjectLength();
686   if (HasOptionalField(e_argument))
687     length += m_argument.GetObjectLength();
688   return length;
689 }
690
691
692 BOOL X880_Invoke::Decode(PASN_Stream & strm)
693 {
694   if (!PreambleDecode(strm))
695     return FALSE;
696
697   if (!m_invokeId.Decode(strm))
698     return FALSE;
699   if (HasOptionalField(e_linkedId) && !m_linkedId.Decode(strm))
700     return FALSE;
701   if (!m_opcode.Decode(strm))
702     return FALSE;
703   if (HasOptionalField(e_argument) && !m_argument.Decode(strm))
704     return FALSE;
705
706   return UnknownExtensionsDecode(strm);
707 }
708
709
710 void X880_Invoke::Encode(PASN_Stream & strm) const
711 {
712   PreambleEncode(strm);
713
714   m_invokeId.Encode(strm);
715   if (HasOptionalField(e_linkedId))
716     m_linkedId.Encode(strm);
717   m_opcode.Encode(strm);
718   if (HasOptionalField(e_argument))
719     m_argument.Encode(strm);
720
721   UnknownExtensionsEncode(strm);
722 }
723
724
725 PObject * X880_Invoke::Clone() const
726 {
727 #ifndef PASN_LEANANDMEAN
728   PAssert(IsClass(X880_Invoke::Class()), PInvalidCast);
729 #endif
730   return new X880_Invoke(*this);
731 }
732
733
734 //
735 // ReturnResult
736 //
737
738 X880_ReturnResult::X880_ReturnResult(unsigned tag, PASN_Object::TagClass tagClass)
739   : PASN_Sequence(tag, tagClass, 1, FALSE, 0)
740 {
741 }
742
743
744 #ifndef PASN_NOPRINTON
745 void X880_ReturnResult::PrintOn(ostream & strm) const
746 {
747   int indent = strm.precision() + 2;
748   strm << "{\n";
749   strm << setw(indent+11) << "invokeId = " << setprecision(indent) << m_invokeId << '\n';
750   if (HasOptionalField(e_result))
751     strm << setw(indent+9) << "result = " << setprecision(indent) << m_result << '\n';
752   strm << setw(indent-1) << setprecision(indent-2) << "}";
753 }
754 #endif
755
756
757 PObject::Comparison X880_ReturnResult::Compare(const PObject & obj) const
758 {
759 #ifndef PASN_LEANANDMEAN
760   PAssert(PIsDescendant(&obj, X880_ReturnResult), PInvalidCast);
761 #endif
762   const X880_ReturnResult & other = (const X880_ReturnResult &)obj;
763
764   Comparison result;
765
766   if ((result = m_invokeId.Compare(other.m_invokeId)) != EqualTo)
767     return result;
768   if ((result = m_result.Compare(other.m_result)) != EqualTo)
769     return result;
770
771   return PASN_Sequence::Compare(other);
772 }
773
774
775 PINDEX X880_ReturnResult::GetDataLength() const
776 {
777   PINDEX length = 0;
778   length += m_invokeId.GetObjectLength();
779   if (HasOptionalField(e_result))
780     length += m_result.GetObjectLength();
781   return length;
782 }
783
784
785 BOOL X880_ReturnResult::Decode(PASN_Stream & strm)
786 {
787   if (!PreambleDecode(strm))
788     return FALSE;
789
790   if (!m_invokeId.Decode(strm))
791     return FALSE;
792   if (HasOptionalField(e_result) && !m_result.Decode(strm))
793     return FALSE;
794
795   return UnknownExtensionsDecode(strm);
796 }
797
798
799 void X880_ReturnResult::Encode(PASN_Stream & strm) const
800 {
801   PreambleEncode(strm);
802
803   m_invokeId.Encode(strm);
804   if (HasOptionalField(e_result))
805     m_result.Encode(strm);
806
807   UnknownExtensionsEncode(strm);
808 }
809
810
811 PObject * X880_ReturnResult::Clone() const
812 {
813 #ifndef PASN_LEANANDMEAN
814   PAssert(IsClass(X880_ReturnResult::Class()), PInvalidCast);
815 #endif
816   return new X880_ReturnResult(*this);
817 }
818
819
820 //
821 // ReturnError
822 //
823
824 X880_ReturnError::X880_ReturnError(unsigned tag, PASN_Object::TagClass tagClass)
825   : PASN_Sequence(tag, tagClass, 1, FALSE, 0)
826 {
827 }
828
829
830 #ifndef PASN_NOPRINTON
831 void X880_ReturnError::PrintOn(ostream & strm) const
832 {
833   int indent = strm.precision() + 2;
834   strm << "{\n";
835   strm << setw(indent+11) << "invokeId = " << setprecision(indent) << m_invokeId << '\n';
836   strm << setw(indent+12) << "errorCode = " << setprecision(indent) << m_errorCode << '\n';
837   if (HasOptionalField(e_parameter))
838     strm << setw(indent+12) << "parameter = " << setprecision(indent) << m_parameter << '\n';
839   strm << setw(indent-1) << setprecision(indent-2) << "}";
840 }
841 #endif
842
843
844 PObject::Comparison X880_ReturnError::Compare(const PObject & obj) const
845 {
846 #ifndef PASN_LEANANDMEAN
847   PAssert(PIsDescendant(&obj, X880_ReturnError), PInvalidCast);
848 #endif
849   const X880_ReturnError & other = (const X880_ReturnError &)obj;
850
851   Comparison result;
852
853   if ((result = m_invokeId.Compare(other.m_invokeId)) != EqualTo)
854     return result;
855   if ((result = m_errorCode.Compare(other.m_errorCode)) != EqualTo)
856     return result;
857   if ((result = m_parameter.Compare(other.m_parameter)) != EqualTo)
858     return result;
859
860   return PASN_Sequence::Compare(other);
861 }
862
863
864 PINDEX X880_ReturnError::GetDataLength() const
865 {
866   PINDEX length = 0;
867   length += m_invokeId.GetObjectLength();
868   length += m_errorCode.GetObjectLength();
869   if (HasOptionalField(e_parameter))
870     length += m_parameter.GetObjectLength();
871   return length;
872 }
873
874
875 BOOL X880_ReturnError::Decode(PASN_Stream & strm)
876 {
877   if (!PreambleDecode(strm))
878     return FALSE;
879
880   if (!m_invokeId.Decode(strm))
881     return FALSE;
882   if (!m_errorCode.Decode(strm))
883     return FALSE;
884   if (HasOptionalField(e_parameter) && !m_parameter.Decode(strm))
885     return FALSE;
886
887   return UnknownExtensionsDecode(strm);
888 }
889
890
891 void X880_ReturnError::Encode(PASN_Stream & strm) const
892 {
893   PreambleEncode(strm);
894
895   m_invokeId.Encode(strm);
896   m_errorCode.Encode(strm);
897   if (HasOptionalField(e_parameter))
898     m_parameter.Encode(strm);
899
900   UnknownExtensionsEncode(strm);
901 }
902
903
904 PObject * X880_ReturnError::Clone() const
905 {
906 #ifndef PASN_LEANANDMEAN
907   PAssert(IsClass(X880_ReturnError::Class()), PInvalidCast);
908 #endif
909   return new X880_ReturnError(*this);
910 }
911
912
913 //
914 // Reject
915 //
916
917 X880_Reject::X880_Reject(unsigned tag, PASN_Object::TagClass tagClass)
918   : PASN_Sequence(tag, tagClass, 0, FALSE, 0)
919 {
920 }
921
922
923 #ifndef PASN_NOPRINTON
924 void X880_Reject::PrintOn(ostream & strm) const
925 {
926   int indent = strm.precision() + 2;
927   strm << "{\n";
928   strm << setw(indent+11) << "invokeId = " << setprecision(indent) << m_invokeId << '\n';
929   strm << setw(indent+10) << "problem = " << setprecision(indent) << m_problem << '\n';
930   strm << setw(indent-1) << setprecision(indent-2) << "}";
931 }
932 #endif
933
934
935 PObject::Comparison X880_Reject::Compare(const PObject & obj) const
936 {
937 #ifndef PASN_LEANANDMEAN
938   PAssert(PIsDescendant(&obj, X880_Reject), PInvalidCast);
939 #endif
940   const X880_Reject & other = (const X880_Reject &)obj;
941
942   Comparison result;
943
944   if ((result = m_invokeId.Compare(other.m_invokeId)) != EqualTo)
945     return result;
946   if ((result = m_problem.Compare(other.m_problem)) != EqualTo)
947     return result;
948
949   return PASN_Sequence::Compare(other);
950 }
951
952
953 PINDEX X880_Reject::GetDataLength() const
954 {
955   PINDEX length = 0;
956   length += m_invokeId.GetObjectLength();
957   length += m_problem.GetObjectLength();
958   return length;
959 }
960
961
962 BOOL X880_Reject::Decode(PASN_Stream & strm)
963 {
964   if (!PreambleDecode(strm))
965     return FALSE;
966
967   if (!m_invokeId.Decode(strm))
968     return FALSE;
969   if (!m_problem.Decode(strm))
970     return FALSE;
971
972   return UnknownExtensionsDecode(strm);
973 }
974
975
976 void X880_Reject::Encode(PASN_Stream & strm) const
977 {
978   PreambleEncode(strm);
979
980   m_invokeId.Encode(strm);
981   m_problem.Encode(strm);
982
983   UnknownExtensionsEncode(strm);
984 }
985
986
987 PObject * X880_Reject::Clone() const
988 {
989 #ifndef PASN_LEANANDMEAN
990   PAssert(IsClass(X880_Reject::Class()), PInvalidCast);
991 #endif
992   return new X880_Reject(*this);
993 }
994
995
996 #endif // if ! H323_DISABLE_X880
997
998
999 // End of x880.cxx