Commit | Line | Data |
---|---|---|
970ed795 | 1 | /////////////////////////////////////////////////////////////////////////////// |
3abe9331 | 2 | // Copyright (c) 2000-2015 Ericsson Telecom AB |
970ed795 EL |
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 | ||
21 | class EXTERNAL_identification; | |
22 | class EXTERNAL_identification_template; | |
23 | class EXTERNAL_identification_syntaxes; | |
24 | class EXTERNAL_identification_syntaxes_template; | |
25 | class EXTERNAL_identification_context__negotiation; | |
26 | class EXTERNAL_identification_context__negotiation_template; | |
27 | class EXTERNAL; | |
28 | class EXTERNAL_template; | |
29 | ||
30 | class Module_Param; | |
31 | ||
32 | class EXTERNAL_identification : public Base_Type { | |
33 | public: | |
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 }; | |
35 | private: | |
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 | ||
47 | public: | |
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 | |
3abe9331 | 81 | void set_param(Module_Param& param); |
82 | Module_Param* get_param(Module_Param_Name& param_name) const; | |
970ed795 EL |
83 | void encode_text(Text_Buf& text_buf) const; |
84 | void decode_text(Text_Buf& text_buf); | |
85 | }; | |
86 | ||
87 | class EXTERNAL_identification_template : public Base_Template { | |
88 | union { | |
89 | struct { | |
90 | EXTERNAL_identification::union_selection_type union_selection; | |
91 | union { | |
92 | EXTERNAL_identification_syntaxes_template *field_syntaxes; | |
93 | OBJID_template *field_syntax; | |
94 | INTEGER_template *field_presentation__context__id; | |
95 | EXTERNAL_identification_context__negotiation_template *field_context__negotiation; | |
96 | OBJID_template *field_transfer__syntax; | |
97 | ASN_NULL_template *field_fixed; | |
98 | }; | |
99 | } single_value; | |
100 | struct { | |
101 | unsigned int n_values; | |
102 | EXTERNAL_identification_template *list_value; | |
103 | } value_list; | |
104 | }; | |
105 | ||
106 | void copy_value(const EXTERNAL_identification& other_value); | |
107 | ||
108 | void copy_template(const EXTERNAL_identification_template& other_value); | |
109 | ||
110 | public: | |
111 | EXTERNAL_identification_template(); | |
112 | EXTERNAL_identification_template(template_sel other_value); | |
113 | EXTERNAL_identification_template(const EXTERNAL_identification& other_value); | |
114 | EXTERNAL_identification_template(const OPTIONAL<EXTERNAL_identification>& other_value); | |
115 | EXTERNAL_identification_template(const EXTERNAL_identification_template& other_value); | |
116 | ~EXTERNAL_identification_template(); | |
117 | void clean_up(); | |
118 | ||
119 | EXTERNAL_identification_template& operator=(template_sel other_value); | |
120 | EXTERNAL_identification_template& operator=(const EXTERNAL_identification& other_value); | |
121 | EXTERNAL_identification_template& operator=(const OPTIONAL<EXTERNAL_identification>& other_value); | |
122 | EXTERNAL_identification_template& operator=(const EXTERNAL_identification_template& other_value); | |
3abe9331 | 123 | boolean match(const EXTERNAL_identification& other_value, boolean legacy = FALSE) const; |
970ed795 EL |
124 | EXTERNAL_identification valueof() const; |
125 | EXTERNAL_identification_template& list_item(unsigned int list_index) const; | |
126 | void set_type(template_sel template_type, unsigned int list_length); | |
127 | EXTERNAL_identification_syntaxes_template& syntaxes(); | |
128 | const EXTERNAL_identification_syntaxes_template& syntaxes() const; | |
129 | OBJID_template& syntax(); | |
130 | const OBJID_template& syntax() const; | |
131 | INTEGER_template& presentation__context__id(); | |
132 | const INTEGER_template& presentation__context__id() const; | |
133 | EXTERNAL_identification_context__negotiation_template& context__negotiation(); | |
134 | const EXTERNAL_identification_context__negotiation_template& context__negotiation() const; | |
135 | OBJID_template& transfer__syntax(); | |
136 | const OBJID_template& transfer__syntax() const; | |
137 | ASN_NULL_template& fixed(); | |
138 | const ASN_NULL_template& fixed() const; | |
139 | boolean ischosen(EXTERNAL_identification::union_selection_type checked_selection) const; | |
140 | void log() const; | |
3abe9331 | 141 | void log_match(const EXTERNAL_identification& match_value, boolean legacy = FALSE) const; |
970ed795 EL |
142 | void encode_text(Text_Buf& text_buf) const; |
143 | void decode_text(Text_Buf& text_buf); | |
144 | ||
3abe9331 | 145 | boolean is_present(boolean legacy = FALSE) const; |
146 | boolean match_omit(boolean legacy = FALSE) const; | |
970ed795 | 147 | void set_param(Module_Param& param); |
3abe9331 | 148 | Module_Param* get_param(Module_Param_Name& param_name) const; |
970ed795 EL |
149 | #ifdef TITAN_RUNTIME_2 |
150 | void valueofv(Base_Type* value) const { *(static_cast<EXTERNAL_identification*>(value)) = valueof(); } | |
151 | void set_value(template_sel other_value) { *this = other_value; } | |
152 | void copy_value(const Base_Type* other_value) { *this = *(static_cast<const EXTERNAL_identification*>(other_value)); } | |
153 | Base_Template* clone() const { return new EXTERNAL_identification_template(*this); } | |
154 | const TTCN_Typedescriptor_t* get_descriptor() const { return &EXTERNAL_descr_; } | |
3abe9331 | 155 | boolean matchv(const Base_Type* other_value, boolean legacy) const { return match(*(static_cast<const EXTERNAL_identification*>(other_value)), legacy); } |
156 | void log_matchv(const Base_Type* match_value, boolean legacy) const { log_match(*(static_cast<const EXTERNAL_identification*>(match_value)), legacy); } | |
970ed795 | 157 | #else |
3abe9331 | 158 | void check_restriction(template_res t_res, const char* t_name=NULL, boolean legacy = FALSE) const; |
970ed795 EL |
159 | #endif |
160 | }; | |
161 | ||
162 | class EXTERNAL_identification_syntaxes : public Base_Type { | |
163 | OBJID field_abstract; | |
164 | OBJID field_transfer; | |
165 | public: | |
166 | EXTERNAL_identification_syntaxes(); | |
167 | EXTERNAL_identification_syntaxes(const OBJID& par_abstract, | |
168 | const OBJID& par_transfer); | |
169 | boolean operator==(const EXTERNAL_identification_syntaxes& other_value) const; | |
170 | inline boolean operator!=(const EXTERNAL_identification_syntaxes& other_value) const | |
171 | { return !(*this == other_value); } | |
172 | ||
173 | inline OBJID& abstract() | |
174 | {return field_abstract;} | |
175 | inline const OBJID& abstract() const | |
176 | {return field_abstract;} | |
177 | inline OBJID& transfer() | |
178 | {return field_transfer;} | |
179 | inline const OBJID& transfer() const | |
180 | {return field_transfer;} | |
181 | int size_of() const; | |
182 | void log() const; | |
183 | boolean is_bound() const; | |
184 | boolean is_value() const; | |
185 | void clean_up(); | |
186 | #ifdef TITAN_RUNTIME_2 | |
187 | boolean is_equal(const Base_Type* other_value) const { return *this == *(static_cast<const EXTERNAL_identification_syntaxes*>(other_value)); } | |
188 | void set_value(const Base_Type* other_value) { *this = *(static_cast<const EXTERNAL_identification_syntaxes*>(other_value)); } | |
189 | Base_Type* clone() const { return new EXTERNAL_identification_syntaxes(*this); } | |
190 | const TTCN_Typedescriptor_t* get_descriptor() const { return &EXTERNAL_descr_; } | |
191 | #else | |
192 | inline boolean is_present() const { return is_bound(); } | |
193 | #endif | |
194 | void set_param(Module_Param& param); | |
3abe9331 | 195 | Module_Param* get_param(Module_Param_Name& param_name) const; |
970ed795 EL |
196 | void encode_text(Text_Buf& text_buf) const; |
197 | void decode_text(Text_Buf& text_buf); | |
198 | }; | |
199 | ||
200 | class EXTERNAL_identification_syntaxes_template : public Base_Template { | |
201 | #ifdef __SUNPRO_CC | |
202 | public: | |
203 | #endif | |
204 | struct single_value_struct; | |
205 | #ifdef __SUNPRO_CC | |
206 | private: | |
207 | #endif | |
208 | union { | |
209 | single_value_struct *single_value; | |
210 | struct { | |
211 | unsigned int n_values; | |
212 | EXTERNAL_identification_syntaxes_template *list_value; | |
213 | } value_list; | |
214 | }; | |
215 | ||
216 | void set_specific(); | |
217 | void copy_value(const EXTERNAL_identification_syntaxes& other_value); | |
218 | void copy_template(const EXTERNAL_identification_syntaxes_template& other_value); | |
219 | ||
220 | public: | |
221 | EXTERNAL_identification_syntaxes_template(); | |
222 | EXTERNAL_identification_syntaxes_template(template_sel other_value); | |
223 | EXTERNAL_identification_syntaxes_template(const EXTERNAL_identification_syntaxes& other_value); | |
224 | EXTERNAL_identification_syntaxes_template(const OPTIONAL<EXTERNAL_identification_syntaxes>& other_value); | |
225 | EXTERNAL_identification_syntaxes_template(const EXTERNAL_identification_syntaxes_template& other_value); | |
226 | ~EXTERNAL_identification_syntaxes_template(); | |
227 | void clean_up(); | |
228 | EXTERNAL_identification_syntaxes_template& operator=(template_sel other_value); | |
229 | EXTERNAL_identification_syntaxes_template& operator=(const EXTERNAL_identification_syntaxes& other_value); | |
230 | EXTERNAL_identification_syntaxes_template& operator=(const OPTIONAL<EXTERNAL_identification_syntaxes>& other_value); | |
231 | EXTERNAL_identification_syntaxes_template& operator=(const EXTERNAL_identification_syntaxes_template& other_value); | |
3abe9331 | 232 | boolean match(const EXTERNAL_identification_syntaxes& other_value, boolean legacy = FALSE) const; |
970ed795 EL |
233 | EXTERNAL_identification_syntaxes valueof() const; |
234 | void set_type(template_sel template_type, unsigned int list_length); | |
235 | EXTERNAL_identification_syntaxes_template& list_item(unsigned int list_index) const; | |
236 | OBJID_template& abstract(); | |
237 | const OBJID_template& abstract() const; | |
238 | OBJID_template& transfer(); | |
239 | const OBJID_template& transfer() const; | |
240 | int size_of() const; | |
241 | void log() const; | |
3abe9331 | 242 | void log_match(const EXTERNAL_identification_syntaxes& match_value, boolean legacy = FALSE) const; |
970ed795 EL |
243 | void encode_text(Text_Buf& text_buf) const; |
244 | void decode_text(Text_Buf& text_buf); | |
245 | ||
3abe9331 | 246 | boolean is_present(boolean legacy = FALSE) const; |
247 | boolean match_omit(boolean legacy = FALSE) const; | |
970ed795 | 248 | void set_param(Module_Param& param); |
3abe9331 | 249 | Module_Param* get_param(Module_Param_Name& param_name) const; |
970ed795 EL |
250 | #ifdef TITAN_RUNTIME_2 |
251 | void valueofv(Base_Type* value) const { *(static_cast<EXTERNAL_identification_syntaxes*>(value)) = valueof(); } | |
252 | void set_value(template_sel other_value) { *this = other_value; } | |
253 | void copy_value(const Base_Type* other_value) { *this = *(static_cast<const EXTERNAL_identification_syntaxes*>(other_value)); } | |
254 | Base_Template* clone() const { return new EXTERNAL_identification_syntaxes_template(*this); } | |
255 | const TTCN_Typedescriptor_t* get_descriptor() const { return &EXTERNAL_descr_; } | |
3abe9331 | 256 | boolean matchv(const Base_Type* other_value, boolean legacy) const { return match(*(static_cast<const EXTERNAL_identification_syntaxes*>(other_value)), legacy); } |
257 | void log_matchv(const Base_Type* match_value, boolean legacy) const { log_match(*(static_cast<const EXTERNAL_identification_syntaxes*>(match_value)), legacy); } | |
970ed795 | 258 | #else |
3abe9331 | 259 | void check_restriction(template_res t_res, const char* t_name=NULL, boolean legacy = FALSE) const; |
970ed795 EL |
260 | #endif |
261 | }; | |
262 | ||
263 | class EXTERNAL_identification_context__negotiation : public Base_Type { | |
264 | INTEGER field_presentation__context__id; | |
265 | OBJID field_transfer__syntax; | |
266 | public: | |
267 | EXTERNAL_identification_context__negotiation(); | |
268 | EXTERNAL_identification_context__negotiation(const INTEGER& par_presentation__context__id, | |
269 | const OBJID& par_transfer__syntax); | |
270 | boolean operator==(const EXTERNAL_identification_context__negotiation& other_value) const; | |
271 | inline boolean operator!=(const EXTERNAL_identification_context__negotiation& other_value) const | |
272 | { return !(*this == other_value); } | |
273 | ||
274 | inline INTEGER& presentation__context__id() | |
275 | {return field_presentation__context__id;} | |
276 | inline const INTEGER& presentation__context__id() const | |
277 | {return field_presentation__context__id;} | |
278 | inline OBJID& transfer__syntax() | |
279 | {return field_transfer__syntax;} | |
280 | inline const OBJID& transfer__syntax() const | |
281 | {return field_transfer__syntax;} | |
282 | int size_of() const; | |
283 | void log() const; | |
284 | boolean is_bound() const; | |
285 | boolean is_value() const; | |
286 | void clean_up(); | |
287 | #ifdef TITAN_RUNTIME_2 | |
288 | boolean is_equal(const Base_Type* other_value) const { return *this == *(static_cast<const EXTERNAL_identification_context__negotiation*>(other_value)); } | |
289 | void set_value(const Base_Type* other_value) { *this = *(static_cast<const EXTERNAL_identification_context__negotiation*>(other_value)); } | |
290 | Base_Type* clone() const { return new EXTERNAL_identification_context__negotiation(*this); } | |
291 | const TTCN_Typedescriptor_t* get_descriptor() const { return &EXTERNAL_descr_; } | |
292 | #else | |
293 | inline boolean is_present() const { return is_bound(); } | |
294 | #endif | |
295 | void set_param(Module_Param& param); | |
3abe9331 | 296 | Module_Param* get_param(Module_Param_Name& param_name) const; |
970ed795 EL |
297 | void encode_text(Text_Buf& text_buf) const; |
298 | void decode_text(Text_Buf& text_buf); | |
299 | }; | |
300 | ||
301 | class EXTERNAL_identification_context__negotiation_template : public Base_Template { | |
302 | #ifdef __SUNPRO_CC | |
303 | public: | |
304 | #endif | |
305 | struct single_value_struct; | |
306 | #ifdef __SUNPRO_CC | |
307 | private: | |
308 | #endif | |
309 | union { | |
310 | single_value_struct *single_value; | |
311 | struct { | |
312 | unsigned int n_values; | |
313 | EXTERNAL_identification_context__negotiation_template *list_value; | |
314 | } value_list; | |
315 | }; | |
316 | ||
317 | void set_specific(); | |
318 | void copy_value(const EXTERNAL_identification_context__negotiation& other_value); | |
319 | void copy_template(const EXTERNAL_identification_context__negotiation_template& other_value); | |
320 | ||
321 | public: | |
322 | EXTERNAL_identification_context__negotiation_template(); | |
323 | EXTERNAL_identification_context__negotiation_template(template_sel other_value); | |
324 | EXTERNAL_identification_context__negotiation_template(const EXTERNAL_identification_context__negotiation& other_value); | |
325 | EXTERNAL_identification_context__negotiation_template(const OPTIONAL<EXTERNAL_identification_context__negotiation>& other_value); | |
326 | EXTERNAL_identification_context__negotiation_template(const EXTERNAL_identification_context__negotiation_template& other_value); | |
327 | ~EXTERNAL_identification_context__negotiation_template(); | |
328 | void clean_up(); | |
329 | EXTERNAL_identification_context__negotiation_template& operator=(template_sel other_value); | |
330 | EXTERNAL_identification_context__negotiation_template& operator=(const EXTERNAL_identification_context__negotiation& other_value); | |
331 | EXTERNAL_identification_context__negotiation_template& operator=(const OPTIONAL<EXTERNAL_identification_context__negotiation>& other_value); | |
332 | EXTERNAL_identification_context__negotiation_template& operator=(const EXTERNAL_identification_context__negotiation_template& other_value); | |
3abe9331 | 333 | boolean match(const EXTERNAL_identification_context__negotiation& other_value, boolean legacy = FALSE) const; |
970ed795 EL |
334 | EXTERNAL_identification_context__negotiation valueof() const; |
335 | void set_type(template_sel template_type, unsigned int list_length); | |
336 | EXTERNAL_identification_context__negotiation_template& list_item(unsigned int list_index) const; | |
337 | INTEGER_template& presentation__context__id(); | |
338 | const INTEGER_template& presentation__context__id() const; | |
339 | OBJID_template& transfer__syntax(); | |
340 | const OBJID_template& transfer__syntax() const; | |
341 | int size_of() const; | |
342 | void log() const; | |
3abe9331 | 343 | void log_match(const EXTERNAL_identification_context__negotiation& match_value, boolean legacy = FALSE) const; |
970ed795 EL |
344 | void encode_text(Text_Buf& text_buf) const; |
345 | void decode_text(Text_Buf& text_buf); | |
346 | ||
3abe9331 | 347 | boolean is_present(boolean legacy = FALSE) const; |
348 | boolean match_omit(boolean legacy = FALSE) const; | |
970ed795 | 349 | void set_param(Module_Param& param); |
3abe9331 | 350 | Module_Param* get_param(Module_Param_Name& param_name) const; |
970ed795 EL |
351 | #ifdef TITAN_RUNTIME_2 |
352 | void valueofv(Base_Type* value) const { *(static_cast<EXTERNAL_identification_context__negotiation*>(value)) = valueof(); } | |
353 | void set_value(template_sel other_value) { *this = other_value; } | |
354 | void copy_value(const Base_Type* other_value) { *this = *(static_cast<const EXTERNAL_identification_context__negotiation*>(other_value)); } | |
355 | Base_Template* clone() const { return new EXTERNAL_identification_context__negotiation_template(*this); } | |
356 | const TTCN_Typedescriptor_t* get_descriptor() const { return &EXTERNAL_descr_; } | |
3abe9331 | 357 | boolean matchv(const Base_Type* other_value, boolean legacy) const { return match(*(static_cast<const EXTERNAL_identification_context__negotiation*>(other_value)), legacy); } |
358 | void log_matchv(const Base_Type* match_value, boolean legacy) const { log_match(*(static_cast<const EXTERNAL_identification_context__negotiation*>(match_value)), legacy); } | |
970ed795 | 359 | #else |
3abe9331 | 360 | void check_restriction(template_res t_res, const char* t_name=NULL, boolean legacy = FALSE) const; |
970ed795 EL |
361 | #endif |
362 | }; | |
363 | ||
364 | class EXTERNAL : public Base_Type { | |
365 | EXTERNAL_identification field_identification; | |
366 | OPTIONAL<UNIVERSAL_CHARSTRING> field_data__value__descriptor; | |
367 | OCTETSTRING field_data__value; | |
368 | ||
369 | void transfer(void*); | |
370 | public: | |
371 | EXTERNAL(); | |
372 | EXTERNAL(const EXTERNAL_identification& par_identification, | |
373 | const OPTIONAL<UNIVERSAL_CHARSTRING>& par_data__value__descriptor, | |
374 | const OCTETSTRING& par_data__value); | |
375 | boolean operator==(const EXTERNAL& other_value) const; | |
376 | inline boolean operator!=(const EXTERNAL& other_value) const | |
377 | { return !(*this == other_value); } | |
378 | ||
379 | inline EXTERNAL_identification& identification() | |
380 | {return field_identification;} | |
381 | inline const EXTERNAL_identification& identification() const | |
382 | {return field_identification;} | |
383 | inline OPTIONAL<UNIVERSAL_CHARSTRING>& data__value__descriptor() | |
384 | {return field_data__value__descriptor;} | |
385 | inline const OPTIONAL<UNIVERSAL_CHARSTRING>& data__value__descriptor() const | |
386 | {return field_data__value__descriptor;} | |
387 | inline OCTETSTRING& data__value() | |
388 | {return field_data__value;} | |
389 | inline const OCTETSTRING& data__value() const | |
390 | {return field_data__value;} | |
391 | int size_of() const; | |
392 | boolean is_bound() const; | |
393 | boolean is_value() const; | |
394 | void clean_up(); | |
395 | void log() const; | |
396 | #ifdef TITAN_RUNTIME_2 | |
397 | boolean is_equal(const Base_Type* other_value) const { return *this == *(static_cast<const EXTERNAL*>(other_value)); } | |
398 | void set_value(const Base_Type* other_value) { *this = *(static_cast<const EXTERNAL*>(other_value)); } | |
399 | Base_Type* clone() const { return new EXTERNAL(*this); } | |
400 | const TTCN_Typedescriptor_t* get_descriptor() const { return &EXTERNAL_descr_; } | |
401 | #else | |
402 | inline boolean is_present() const { return is_bound(); } | |
403 | #endif | |
404 | void set_param(Module_Param& param); | |
3abe9331 | 405 | Module_Param* get_param(Module_Param_Name& param_name) const; |
970ed795 EL |
406 | void encode_text(Text_Buf& text_buf) const; |
407 | void decode_text(Text_Buf& text_buf); | |
408 | void encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, TTCN_EncDec::coding_t p_coding, ...) const; | |
409 | void decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, TTCN_EncDec::coding_t p_coding, ...); | |
410 | ASN_BER_TLV_t* BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const; | |
411 | boolean BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form); | |
412 | int XER_encode(const XERdescriptor_t& p_td, | |
af710487 | 413 | TTCN_Buffer& p_buf, unsigned int flavor, int indent, embed_values_enc_struct_t*) const; |
970ed795 | 414 | int XER_decode(const XERdescriptor_t& p_td, XmlReaderWrap& reader, |
af710487 | 415 | unsigned int flavor, embed_values_dec_struct_t*); |
970ed795 EL |
416 | }; |
417 | ||
418 | class EXTERNAL_template : public Base_Template { | |
419 | #ifdef __SUNPRO_CC | |
420 | public: | |
421 | #endif | |
422 | struct single_value_struct; | |
423 | #ifdef __SUNPRO_CC | |
424 | private: | |
425 | #endif | |
426 | union { | |
427 | single_value_struct *single_value; | |
428 | struct { | |
429 | unsigned int n_values; | |
430 | EXTERNAL_template *list_value; | |
431 | } value_list; | |
432 | }; | |
433 | ||
434 | void set_specific(); | |
435 | void copy_value(const EXTERNAL& other_value); | |
436 | void copy_template(const EXTERNAL_template& other_value); | |
437 | ||
438 | public: | |
439 | EXTERNAL_template(); | |
440 | EXTERNAL_template(template_sel other_value); | |
441 | EXTERNAL_template(const EXTERNAL& other_value); | |
442 | EXTERNAL_template(const OPTIONAL<EXTERNAL>& other_value); | |
443 | EXTERNAL_template(const EXTERNAL_template& other_value); | |
444 | ~EXTERNAL_template(); | |
445 | void clean_up(); | |
446 | EXTERNAL_template& operator=(template_sel other_value); | |
447 | EXTERNAL_template& operator=(const EXTERNAL& other_value); | |
448 | EXTERNAL_template& operator=(const OPTIONAL<EXTERNAL>& other_value); | |
449 | EXTERNAL_template& operator=(const EXTERNAL_template& other_value); | |
3abe9331 | 450 | boolean match(const EXTERNAL& other_value, boolean legacy = FALSE) const; |
970ed795 EL |
451 | EXTERNAL valueof() const; |
452 | void set_type(template_sel template_type, unsigned int list_length); | |
453 | EXTERNAL_template& list_item(unsigned int list_index) const; | |
454 | EXTERNAL_identification_template& identification(); | |
455 | const EXTERNAL_identification_template& identification() const; | |
456 | UNIVERSAL_CHARSTRING_template& data__value__descriptor(); | |
457 | const UNIVERSAL_CHARSTRING_template& data__value__descriptor() const; | |
458 | OCTETSTRING_template& data__value(); | |
459 | const OCTETSTRING_template& data__value() const; | |
460 | int size_of() const; | |
461 | void log() const; | |
3abe9331 | 462 | void log_match(const EXTERNAL& match_value, boolean legacy = FALSE) const; |
970ed795 EL |
463 | void encode_text(Text_Buf& text_buf) const; |
464 | void decode_text(Text_Buf& text_buf); | |
465 | ||
3abe9331 | 466 | boolean is_present(boolean legacy = FALSE) const; |
467 | boolean match_omit(boolean legacy = FALSE) const; | |
970ed795 | 468 | void set_param(Module_Param& param); |
3abe9331 | 469 | Module_Param* get_param(Module_Param_Name& param_name) const; |
970ed795 EL |
470 | #ifdef TITAN_RUNTIME_2 |
471 | void valueofv(Base_Type* value) const { *(static_cast<EXTERNAL*>(value)) = valueof(); } | |
472 | void set_value(template_sel other_value) { *this = other_value; } | |
473 | void copy_value(const Base_Type* other_value) { *this = *(static_cast<const EXTERNAL*>(other_value)); } | |
474 | Base_Template* clone() const { return new EXTERNAL_template(*this); } | |
475 | const TTCN_Typedescriptor_t* get_descriptor() const { return &EXTERNAL_descr_; } | |
3abe9331 | 476 | boolean matchv(const Base_Type* other_value, boolean legacy) const { return match(*(static_cast<const EXTERNAL*>(other_value)), legacy); } |
477 | void log_matchv(const Base_Type* match_value, boolean legacy) const { log_match(*(static_cast<const EXTERNAL*>(match_value)), legacy); } | |
970ed795 | 478 | #else |
3abe9331 | 479 | void check_restriction(template_res t_res, const char* t_name=NULL, boolean legacy = FALSE) const; |
970ed795 EL |
480 | #endif |
481 | }; | |
482 | ||
483 | #endif // ASN_External_HH |