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