Sync with 5.3.0
[deliverable/titan.core.git] / core / ASN_External.hh
CommitLineData
970ed795
EL
1///////////////////////////////////////////////////////////////////////////////
2// Copyright (c) 2000-2014 Ericsson Telecom AB
3// All rights reserved. This program and the accompanying materials
4// are made available under the terms of the Eclipse Public License v1.0
5// which accompanies this distribution, and is available at
6// http://www.eclipse.org/legal/epl-v10.html
7///////////////////////////////////////////////////////////////////////////////
8#ifndef ASN_External_HH
9#define ASN_External_HH
10
11#include "Types.h"
12#include "Basetype.hh"
13#include "Template.hh"
14
15#include "ASN_Null.hh"
16#include "Integer.hh"
17#include "Objid.hh"
18#include "Octetstring.hh"
19#include "Universal_charstring.hh"
20
21class EXTERNAL_identification;
22class EXTERNAL_identification_template;
23class EXTERNAL_identification_syntaxes;
24class EXTERNAL_identification_syntaxes_template;
25class EXTERNAL_identification_context__negotiation;
26class EXTERNAL_identification_context__negotiation_template;
27class EXTERNAL;
28class EXTERNAL_template;
29
30class Module_Param;
31
32class EXTERNAL_identification : public Base_Type {
33public:
34 enum union_selection_type { UNBOUND_VALUE = 0, ALT_syntaxes = 1, ALT_syntax = 2, ALT_presentation__context__id = 3, ALT_context__negotiation = 4, ALT_transfer__syntax = 5, ALT_fixed = 6 };
35private:
36 union_selection_type union_selection;
37 union {
38 EXTERNAL_identification_syntaxes *field_syntaxes;
39 OBJID *field_syntax;
40 INTEGER *field_presentation__context__id;
41 EXTERNAL_identification_context__negotiation *field_context__negotiation;
42 OBJID *field_transfer__syntax;
43 ASN_NULL *field_fixed;
44 };
45 void copy_value(const EXTERNAL_identification& other_value);
46
47public:
48 EXTERNAL_identification();
49 EXTERNAL_identification(const EXTERNAL_identification& other_value);
50 ~EXTERNAL_identification();
51 EXTERNAL_identification& operator=(const EXTERNAL_identification& other_value);
52 boolean operator==(const EXTERNAL_identification& other_value) const;
53 inline boolean operator!=(const EXTERNAL_identification& other_value) const { return !(*this == other_value); }
54 EXTERNAL_identification_syntaxes& syntaxes();
55 const EXTERNAL_identification_syntaxes& syntaxes() const;
56 OBJID& syntax();
57 const OBJID& syntax() const;
58 INTEGER& presentation__context__id();
59 const INTEGER& presentation__context__id() const;
60 EXTERNAL_identification_context__negotiation& context__negotiation();
61 const EXTERNAL_identification_context__negotiation& context__negotiation() const;
62 OBJID& transfer__syntax();
63 const OBJID& transfer__syntax() const;
64 ASN_NULL& fixed();
65 const ASN_NULL& fixed() const;
66 inline union_selection_type get_selection() const { return union_selection; }
67 boolean ischosen(union_selection_type checked_selection) const;
68 inline boolean is_bound() const
69 { return union_selection != UNBOUND_VALUE; }
70 boolean is_value() const;
71 void clean_up();
72 void log() const;
73#ifdef TITAN_RUNTIME_2
74 boolean is_equal(const Base_Type* other_value) const { return *this == *(static_cast<const EXTERNAL_identification*>(other_value)); }
75 void set_value(const Base_Type* other_value) { *this = *(static_cast<const EXTERNAL_identification*>(other_value)); }
76 Base_Type* clone() const { return new EXTERNAL_identification(*this); }
77 const TTCN_Typedescriptor_t* get_descriptor() const { return &EXTERNAL_descr_; }
78#else
79 inline boolean is_present() const { return is_bound(); }
80#endif
81 void set_param(Module_Param& param);
82 void encode_text(Text_Buf& text_buf) const;
83 void decode_text(Text_Buf& text_buf);
84};
85
86class EXTERNAL_identification_template : public Base_Template {
87 union {
88 struct {
89 EXTERNAL_identification::union_selection_type union_selection;
90 union {
91 EXTERNAL_identification_syntaxes_template *field_syntaxes;
92 OBJID_template *field_syntax;
93 INTEGER_template *field_presentation__context__id;
94 EXTERNAL_identification_context__negotiation_template *field_context__negotiation;
95 OBJID_template *field_transfer__syntax;
96 ASN_NULL_template *field_fixed;
97 };
98 } single_value;
99 struct {
100 unsigned int n_values;
101 EXTERNAL_identification_template *list_value;
102 } value_list;
103 };
104
105 void copy_value(const EXTERNAL_identification& other_value);
106
107 void copy_template(const EXTERNAL_identification_template& other_value);
108
109public:
110 EXTERNAL_identification_template();
111 EXTERNAL_identification_template(template_sel other_value);
112 EXTERNAL_identification_template(const EXTERNAL_identification& other_value);
113 EXTERNAL_identification_template(const OPTIONAL<EXTERNAL_identification>& other_value);
114 EXTERNAL_identification_template(const EXTERNAL_identification_template& other_value);
115 ~EXTERNAL_identification_template();
116 void clean_up();
117
118 EXTERNAL_identification_template& operator=(template_sel other_value);
119 EXTERNAL_identification_template& operator=(const EXTERNAL_identification& other_value);
120 EXTERNAL_identification_template& operator=(const OPTIONAL<EXTERNAL_identification>& other_value);
121 EXTERNAL_identification_template& operator=(const EXTERNAL_identification_template& other_value);
122 boolean match(const EXTERNAL_identification& other_value) const;
123 EXTERNAL_identification valueof() const;
124 EXTERNAL_identification_template& list_item(unsigned int list_index) const;
125 void set_type(template_sel template_type, unsigned int list_length);
126 EXTERNAL_identification_syntaxes_template& syntaxes();
127 const EXTERNAL_identification_syntaxes_template& syntaxes() const;
128 OBJID_template& syntax();
129 const OBJID_template& syntax() const;
130 INTEGER_template& presentation__context__id();
131 const INTEGER_template& presentation__context__id() const;
132 EXTERNAL_identification_context__negotiation_template& context__negotiation();
133 const EXTERNAL_identification_context__negotiation_template& context__negotiation() const;
134 OBJID_template& transfer__syntax();
135 const OBJID_template& transfer__syntax() const;
136 ASN_NULL_template& fixed();
137 const ASN_NULL_template& fixed() const;
138 boolean ischosen(EXTERNAL_identification::union_selection_type checked_selection) const;
139 void log() const;
140 void log_match(const EXTERNAL_identification& match_value) const;
141 void encode_text(Text_Buf& text_buf) const;
142 void decode_text(Text_Buf& text_buf);
143
144 boolean is_present() const;
145 boolean match_omit() const;
146 void set_param(Module_Param& param);
147#ifdef TITAN_RUNTIME_2
148 void valueofv(Base_Type* value) const { *(static_cast<EXTERNAL_identification*>(value)) = valueof(); }
149 void set_value(template_sel other_value) { *this = other_value; }
150 void copy_value(const Base_Type* other_value) { *this = *(static_cast<const EXTERNAL_identification*>(other_value)); }
151 Base_Template* clone() const { return new EXTERNAL_identification_template(*this); }
152 const TTCN_Typedescriptor_t* get_descriptor() const { return &EXTERNAL_descr_; }
153 boolean matchv(const Base_Type* other_value) const { return match(*(static_cast<const EXTERNAL_identification*>(other_value))); }
154 void log_matchv(const Base_Type* match_value) const { log_match(*(static_cast<const EXTERNAL_identification*>(match_value))); }
155#else
156 void check_restriction(template_res t_res, const char* t_name=NULL) const;
157#endif
158};
159
160class EXTERNAL_identification_syntaxes : public Base_Type {
161 OBJID field_abstract;
162 OBJID field_transfer;
163public:
164 EXTERNAL_identification_syntaxes();
165 EXTERNAL_identification_syntaxes(const OBJID& par_abstract,
166 const OBJID& par_transfer);
167 boolean operator==(const EXTERNAL_identification_syntaxes& other_value) const;
168 inline boolean operator!=(const EXTERNAL_identification_syntaxes& other_value) const
169 { return !(*this == other_value); }
170
171 inline OBJID& abstract()
172 {return field_abstract;}
173 inline const OBJID& abstract() const
174 {return field_abstract;}
175 inline OBJID& transfer()
176 {return field_transfer;}
177 inline const OBJID& transfer() const
178 {return field_transfer;}
179 int size_of() const;
180 void log() const;
181 boolean is_bound() const;
182 boolean is_value() const;
183 void clean_up();
184#ifdef TITAN_RUNTIME_2
185 boolean is_equal(const Base_Type* other_value) const { return *this == *(static_cast<const EXTERNAL_identification_syntaxes*>(other_value)); }
186 void set_value(const Base_Type* other_value) { *this = *(static_cast<const EXTERNAL_identification_syntaxes*>(other_value)); }
187 Base_Type* clone() const { return new EXTERNAL_identification_syntaxes(*this); }
188 const TTCN_Typedescriptor_t* get_descriptor() const { return &EXTERNAL_descr_; }
189#else
190 inline boolean is_present() const { return is_bound(); }
191#endif
192 void set_param(Module_Param& param);
193 void encode_text(Text_Buf& text_buf) const;
194 void decode_text(Text_Buf& text_buf);
195};
196
197class EXTERNAL_identification_syntaxes_template : public Base_Template {
198#ifdef __SUNPRO_CC
199 public:
200#endif
201 struct single_value_struct;
202#ifdef __SUNPRO_CC
203 private:
204#endif
205 union {
206 single_value_struct *single_value;
207 struct {
208 unsigned int n_values;
209 EXTERNAL_identification_syntaxes_template *list_value;
210 } value_list;
211 };
212
213 void set_specific();
214 void copy_value(const EXTERNAL_identification_syntaxes& other_value);
215 void copy_template(const EXTERNAL_identification_syntaxes_template& other_value);
216
217public:
218 EXTERNAL_identification_syntaxes_template();
219 EXTERNAL_identification_syntaxes_template(template_sel other_value);
220 EXTERNAL_identification_syntaxes_template(const EXTERNAL_identification_syntaxes& other_value);
221 EXTERNAL_identification_syntaxes_template(const OPTIONAL<EXTERNAL_identification_syntaxes>& other_value);
222 EXTERNAL_identification_syntaxes_template(const EXTERNAL_identification_syntaxes_template& other_value);
223 ~EXTERNAL_identification_syntaxes_template();
224 void clean_up();
225 EXTERNAL_identification_syntaxes_template& operator=(template_sel other_value);
226 EXTERNAL_identification_syntaxes_template& operator=(const EXTERNAL_identification_syntaxes& other_value);
227 EXTERNAL_identification_syntaxes_template& operator=(const OPTIONAL<EXTERNAL_identification_syntaxes>& other_value);
228 EXTERNAL_identification_syntaxes_template& operator=(const EXTERNAL_identification_syntaxes_template& other_value);
229 boolean match(const EXTERNAL_identification_syntaxes& other_value) const;
230 EXTERNAL_identification_syntaxes valueof() const;
231 void set_type(template_sel template_type, unsigned int list_length);
232 EXTERNAL_identification_syntaxes_template& list_item(unsigned int list_index) const;
233 OBJID_template& abstract();
234 const OBJID_template& abstract() const;
235 OBJID_template& transfer();
236 const OBJID_template& transfer() const;
237 int size_of() const;
238 void log() const;
239 void log_match(const EXTERNAL_identification_syntaxes& match_value) const;
240 void encode_text(Text_Buf& text_buf) const;
241 void decode_text(Text_Buf& text_buf);
242
243 boolean is_present() const;
244 boolean match_omit() const;
245 void set_param(Module_Param& param);
246#ifdef TITAN_RUNTIME_2
247 void valueofv(Base_Type* value) const { *(static_cast<EXTERNAL_identification_syntaxes*>(value)) = valueof(); }
248 void set_value(template_sel other_value) { *this = other_value; }
249 void copy_value(const Base_Type* other_value) { *this = *(static_cast<const EXTERNAL_identification_syntaxes*>(other_value)); }
250 Base_Template* clone() const { return new EXTERNAL_identification_syntaxes_template(*this); }
251 const TTCN_Typedescriptor_t* get_descriptor() const { return &EXTERNAL_descr_; }
252 boolean matchv(const Base_Type* other_value) const { return match(*(static_cast<const EXTERNAL_identification_syntaxes*>(other_value))); }
253 void log_matchv(const Base_Type* match_value) const { log_match(*(static_cast<const EXTERNAL_identification_syntaxes*>(match_value))); }
254#else
255 void check_restriction(template_res t_res, const char* t_name=NULL) const;
256#endif
257};
258
259class EXTERNAL_identification_context__negotiation : public Base_Type {
260 INTEGER field_presentation__context__id;
261 OBJID field_transfer__syntax;
262public:
263 EXTERNAL_identification_context__negotiation();
264 EXTERNAL_identification_context__negotiation(const INTEGER& par_presentation__context__id,
265 const OBJID& par_transfer__syntax);
266 boolean operator==(const EXTERNAL_identification_context__negotiation& other_value) const;
267 inline boolean operator!=(const EXTERNAL_identification_context__negotiation& other_value) const
268 { return !(*this == other_value); }
269
270 inline INTEGER& presentation__context__id()
271 {return field_presentation__context__id;}
272 inline const INTEGER& presentation__context__id() const
273 {return field_presentation__context__id;}
274 inline OBJID& transfer__syntax()
275 {return field_transfer__syntax;}
276 inline const OBJID& transfer__syntax() const
277 {return field_transfer__syntax;}
278 int size_of() const;
279 void log() const;
280 boolean is_bound() const;
281 boolean is_value() const;
282 void clean_up();
283#ifdef TITAN_RUNTIME_2
284 boolean is_equal(const Base_Type* other_value) const { return *this == *(static_cast<const EXTERNAL_identification_context__negotiation*>(other_value)); }
285 void set_value(const Base_Type* other_value) { *this = *(static_cast<const EXTERNAL_identification_context__negotiation*>(other_value)); }
286 Base_Type* clone() const { return new EXTERNAL_identification_context__negotiation(*this); }
287 const TTCN_Typedescriptor_t* get_descriptor() const { return &EXTERNAL_descr_; }
288#else
289 inline boolean is_present() const { return is_bound(); }
290#endif
291 void set_param(Module_Param& param);
292 void encode_text(Text_Buf& text_buf) const;
293 void decode_text(Text_Buf& text_buf);
294};
295
296class EXTERNAL_identification_context__negotiation_template : public Base_Template {
297#ifdef __SUNPRO_CC
298 public:
299#endif
300 struct single_value_struct;
301#ifdef __SUNPRO_CC
302 private:
303#endif
304 union {
305 single_value_struct *single_value;
306 struct {
307 unsigned int n_values;
308 EXTERNAL_identification_context__negotiation_template *list_value;
309 } value_list;
310 };
311
312 void set_specific();
313 void copy_value(const EXTERNAL_identification_context__negotiation& other_value);
314 void copy_template(const EXTERNAL_identification_context__negotiation_template& other_value);
315
316public:
317 EXTERNAL_identification_context__negotiation_template();
318 EXTERNAL_identification_context__negotiation_template(template_sel other_value);
319 EXTERNAL_identification_context__negotiation_template(const EXTERNAL_identification_context__negotiation& other_value);
320 EXTERNAL_identification_context__negotiation_template(const OPTIONAL<EXTERNAL_identification_context__negotiation>& other_value);
321 EXTERNAL_identification_context__negotiation_template(const EXTERNAL_identification_context__negotiation_template& other_value);
322 ~EXTERNAL_identification_context__negotiation_template();
323 void clean_up();
324 EXTERNAL_identification_context__negotiation_template& operator=(template_sel other_value);
325 EXTERNAL_identification_context__negotiation_template& operator=(const EXTERNAL_identification_context__negotiation& other_value);
326 EXTERNAL_identification_context__negotiation_template& operator=(const OPTIONAL<EXTERNAL_identification_context__negotiation>& other_value);
327 EXTERNAL_identification_context__negotiation_template& operator=(const EXTERNAL_identification_context__negotiation_template& other_value);
328 boolean match(const EXTERNAL_identification_context__negotiation& other_value) const;
329 EXTERNAL_identification_context__negotiation valueof() const;
330 void set_type(template_sel template_type, unsigned int list_length);
331 EXTERNAL_identification_context__negotiation_template& list_item(unsigned int list_index) const;
332 INTEGER_template& presentation__context__id();
333 const INTEGER_template& presentation__context__id() const;
334 OBJID_template& transfer__syntax();
335 const OBJID_template& transfer__syntax() const;
336 int size_of() const;
337 void log() const;
338 void log_match(const EXTERNAL_identification_context__negotiation& match_value) const;
339 void encode_text(Text_Buf& text_buf) const;
340 void decode_text(Text_Buf& text_buf);
341
342 boolean is_present() const;
343 boolean match_omit() const;
344 void set_param(Module_Param& param);
345#ifdef TITAN_RUNTIME_2
346 void valueofv(Base_Type* value) const { *(static_cast<EXTERNAL_identification_context__negotiation*>(value)) = valueof(); }
347 void set_value(template_sel other_value) { *this = other_value; }
348 void copy_value(const Base_Type* other_value) { *this = *(static_cast<const EXTERNAL_identification_context__negotiation*>(other_value)); }
349 Base_Template* clone() const { return new EXTERNAL_identification_context__negotiation_template(*this); }
350 const TTCN_Typedescriptor_t* get_descriptor() const { return &EXTERNAL_descr_; }
351 boolean matchv(const Base_Type* other_value) const { return match(*(static_cast<const EXTERNAL_identification_context__negotiation*>(other_value))); }
352 void log_matchv(const Base_Type* match_value) const { log_match(*(static_cast<const EXTERNAL_identification_context__negotiation*>(match_value))); }
353#else
354 void check_restriction(template_res t_res, const char* t_name=NULL) const;
355#endif
356};
357
358class EXTERNAL : public Base_Type {
359 EXTERNAL_identification field_identification;
360 OPTIONAL<UNIVERSAL_CHARSTRING> field_data__value__descriptor;
361 OCTETSTRING field_data__value;
362
363 void transfer(void*);
364public:
365 EXTERNAL();
366 EXTERNAL(const EXTERNAL_identification& par_identification,
367 const OPTIONAL<UNIVERSAL_CHARSTRING>& par_data__value__descriptor,
368 const OCTETSTRING& par_data__value);
369 boolean operator==(const EXTERNAL& other_value) const;
370 inline boolean operator!=(const EXTERNAL& other_value) const
371 { return !(*this == other_value); }
372
373 inline EXTERNAL_identification& identification()
374 {return field_identification;}
375 inline const EXTERNAL_identification& identification() const
376 {return field_identification;}
377 inline OPTIONAL<UNIVERSAL_CHARSTRING>& data__value__descriptor()
378 {return field_data__value__descriptor;}
379 inline const OPTIONAL<UNIVERSAL_CHARSTRING>& data__value__descriptor() const
380 {return field_data__value__descriptor;}
381 inline OCTETSTRING& data__value()
382 {return field_data__value;}
383 inline const OCTETSTRING& data__value() const
384 {return field_data__value;}
385 int size_of() const;
386 boolean is_bound() const;
387 boolean is_value() const;
388 void clean_up();
389 void log() const;
390#ifdef TITAN_RUNTIME_2
391 boolean is_equal(const Base_Type* other_value) const { return *this == *(static_cast<const EXTERNAL*>(other_value)); }
392 void set_value(const Base_Type* other_value) { *this = *(static_cast<const EXTERNAL*>(other_value)); }
393 Base_Type* clone() const { return new EXTERNAL(*this); }
394 const TTCN_Typedescriptor_t* get_descriptor() const { return &EXTERNAL_descr_; }
395#else
396 inline boolean is_present() const { return is_bound(); }
397#endif
398 void set_param(Module_Param& param);
399 void encode_text(Text_Buf& text_buf) const;
400 void decode_text(Text_Buf& text_buf);
401 void encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, TTCN_EncDec::coding_t p_coding, ...) const;
402 void decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, TTCN_EncDec::coding_t p_coding, ...);
403 ASN_BER_TLV_t* BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const;
404 boolean BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form);
405 int XER_encode(const XERdescriptor_t& p_td,
af710487 406 TTCN_Buffer& p_buf, unsigned int flavor, int indent, embed_values_enc_struct_t*) const;
970ed795 407 int XER_decode(const XERdescriptor_t& p_td, XmlReaderWrap& reader,
af710487 408 unsigned int flavor, embed_values_dec_struct_t*);
970ed795
EL
409};
410
411class EXTERNAL_template : public Base_Template {
412#ifdef __SUNPRO_CC
413 public:
414#endif
415 struct single_value_struct;
416#ifdef __SUNPRO_CC
417 private:
418#endif
419 union {
420 single_value_struct *single_value;
421 struct {
422 unsigned int n_values;
423 EXTERNAL_template *list_value;
424 } value_list;
425 };
426
427 void set_specific();
428 void copy_value(const EXTERNAL& other_value);
429 void copy_template(const EXTERNAL_template& other_value);
430
431public:
432 EXTERNAL_template();
433 EXTERNAL_template(template_sel other_value);
434 EXTERNAL_template(const EXTERNAL& other_value);
435 EXTERNAL_template(const OPTIONAL<EXTERNAL>& other_value);
436 EXTERNAL_template(const EXTERNAL_template& other_value);
437 ~EXTERNAL_template();
438 void clean_up();
439 EXTERNAL_template& operator=(template_sel other_value);
440 EXTERNAL_template& operator=(const EXTERNAL& other_value);
441 EXTERNAL_template& operator=(const OPTIONAL<EXTERNAL>& other_value);
442 EXTERNAL_template& operator=(const EXTERNAL_template& other_value);
443 boolean match(const EXTERNAL& other_value) const;
444 EXTERNAL valueof() const;
445 void set_type(template_sel template_type, unsigned int list_length);
446 EXTERNAL_template& list_item(unsigned int list_index) const;
447 EXTERNAL_identification_template& identification();
448 const EXTERNAL_identification_template& identification() const;
449 UNIVERSAL_CHARSTRING_template& data__value__descriptor();
450 const UNIVERSAL_CHARSTRING_template& data__value__descriptor() const;
451 OCTETSTRING_template& data__value();
452 const OCTETSTRING_template& data__value() const;
453 int size_of() const;
454 void log() const;
455 void log_match(const EXTERNAL& match_value) const;
456 void encode_text(Text_Buf& text_buf) const;
457 void decode_text(Text_Buf& text_buf);
458
459 boolean is_present() const;
460 boolean match_omit() const;
461 void set_param(Module_Param& param);
462#ifdef TITAN_RUNTIME_2
463 void valueofv(Base_Type* value) const { *(static_cast<EXTERNAL*>(value)) = valueof(); }
464 void set_value(template_sel other_value) { *this = other_value; }
465 void copy_value(const Base_Type* other_value) { *this = *(static_cast<const EXTERNAL*>(other_value)); }
466 Base_Template* clone() const { return new EXTERNAL_template(*this); }
467 const TTCN_Typedescriptor_t* get_descriptor() const { return &EXTERNAL_descr_; }
468 boolean matchv(const Base_Type* other_value) const { return match(*(static_cast<const EXTERNAL*>(other_value))); }
469 void log_matchv(const Base_Type* match_value) const { log_match(*(static_cast<const EXTERNAL*>(match_value))); }
470#else
471 void check_restriction(template_res t_res, const char* t_name=NULL) const;
472#endif
473};
474
475#endif // ASN_External_HH
This page took 0.043463 seconds and 5 git commands to generate.