ASN_CharacterString.hh 26.8 KB
Newer Older
Elemer Lelik's avatar
Elemer Lelik committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/******************************************************************************
 * Copyright (c) 2000-2016 Ericsson Telecom AB
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   Balasko, Jeno
 *   Baranyi, Botond
 *   Beres, Szabolcs
 *   Delic, Adam
 *   Forstner, Matyas
 *   Raduly, Csaba
 *   Szabados, Kristof
 *   Szabo, Bence Janos
 *   Szabo, Janos Zoltan – initial implementation
 *
 ******************************************************************************/
Elemer Lelik's avatar
Elemer Lelik committed
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#ifndef ASN_CharacterString_HH
#define ASN_CharacterString_HH

#include "Types.h"
#include "Basetype.hh"
#include "Template.hh"

#include "ASN_Null.hh"
#include "Integer.hh"
#include "Objid.hh"
#include "Charstring.hh"
#include "Universal_charstring.hh"
#include "Octetstring.hh"

class CHARACTER_STRING_identification;
class CHARACTER_STRING_identification_template;
class CHARACTER_STRING_identification_syntaxes;
class CHARACTER_STRING_identification_syntaxes_template;
class CHARACTER_STRING_identification_context__negotiation;
class CHARACTER_STRING_identification_context__negotiation_template;
class CHARACTER_STRING;
class CHARACTER_STRING_template;

class Module_Param;

class CHARACTER_STRING_identification : public Base_Type {
public:
  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 };
private:
  union_selection_type union_selection;
  union {
    CHARACTER_STRING_identification_syntaxes *field_syntaxes;
    OBJID *field_syntax;
    INTEGER *field_presentation__context__id;
    CHARACTER_STRING_identification_context__negotiation *field_context__negotiation;
    OBJID *field_transfer__syntax;
    ASN_NULL *field_fixed;
  };
  void copy_value(const CHARACTER_STRING_identification& other_value);

public:
  CHARACTER_STRING_identification();
  CHARACTER_STRING_identification(const CHARACTER_STRING_identification& other_value);
  ~CHARACTER_STRING_identification();
  CHARACTER_STRING_identification& operator=(const CHARACTER_STRING_identification& other_value);
  boolean operator==(const CHARACTER_STRING_identification& other_value) const;
  inline boolean operator!=(const CHARACTER_STRING_identification& other_value) const { return !(*this == other_value); }
  CHARACTER_STRING_identification_syntaxes& syntaxes();
  const CHARACTER_STRING_identification_syntaxes& syntaxes() const;
  OBJID& syntax();
  const OBJID& syntax() const;
  INTEGER& presentation__context__id();
  const INTEGER& presentation__context__id() const;
  CHARACTER_STRING_identification_context__negotiation& context__negotiation();
  const CHARACTER_STRING_identification_context__negotiation& context__negotiation() const;
  OBJID& transfer__syntax();
  const OBJID& transfer__syntax() const;
  ASN_NULL& fixed();
  const ASN_NULL& fixed() const;
  inline union_selection_type get_selection() const { return union_selection; }
  boolean ischosen(union_selection_type checked_selection) const;
  boolean is_bound() const;
  boolean is_value() const;
  void clean_up();
  void log() const;
#ifdef TITAN_RUNTIME_2
  boolean is_equal(const Base_Type* other_value) const { return *this == *(static_cast<const CHARACTER_STRING_identification*>(other_value)); }
  void set_value(const Base_Type* other_value) { *this = *(static_cast<const CHARACTER_STRING_identification*>(other_value)); }
  Base_Type* clone() const { return new CHARACTER_STRING_identification(*this); }
  const TTCN_Typedescriptor_t* get_descriptor() const { return &CHARACTER_STRING_descr_; }
90
  Module_Param* get_param(Module_Param_Name& param_name) const;
Elemer Lelik's avatar
Elemer Lelik committed
91
92
93
94
95
96
97
98
99
100
101
#else
  inline boolean is_present() const { return is_bound(); }
#endif
  void set_param(Module_Param& param);
  void encode_text(Text_Buf& text_buf) const;
  void decode_text(Text_Buf& text_buf);
  //void encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, TTCN_EncDec::coding_t p_coding, ...) const;
  //void decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, TTCN_EncDec::coding_t p_coding, ...);
  ASN_BER_TLV_t* BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const;
  boolean BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form);
  int XER_encode(const XERdescriptor_t& p_td,
Elemer Lelik's avatar
Elemer Lelik committed
102
                 TTCN_Buffer& p_buf, unsigned int flavor, int indent, embed_values_enc_struct_t*) const;
Elemer Lelik's avatar
Elemer Lelik committed
103
  int XER_decode(const XERdescriptor_t& p_td,
Elemer Lelik's avatar
Elemer Lelik committed
104
                 XmlReaderWrap& reader, unsigned int flavor, unsigned int flavor2, embed_values_dec_struct_t*);
Elemer Lelik's avatar
Elemer Lelik committed
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
private:
  boolean BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv);
public:
  boolean BER_decode_isMyMsg(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv);
};

class CHARACTER_STRING_identification_template : public Base_Template {
  union {
    struct {
      CHARACTER_STRING_identification::union_selection_type union_selection;
      union {
	CHARACTER_STRING_identification_syntaxes_template *field_syntaxes;
	OBJID_template *field_syntax;
	INTEGER_template *field_presentation__context__id;
	CHARACTER_STRING_identification_context__negotiation_template *field_context__negotiation;
	OBJID_template *field_transfer__syntax;
	ASN_NULL_template *field_fixed;
      };
    } single_value;
    struct {
      unsigned int n_values;
      CHARACTER_STRING_identification_template *list_value;
    } value_list;
  };

  void copy_value(const CHARACTER_STRING_identification& other_value);

  void copy_template(const CHARACTER_STRING_identification_template& other_value);

public:
  CHARACTER_STRING_identification_template();
  CHARACTER_STRING_identification_template(template_sel other_value);
  CHARACTER_STRING_identification_template(const CHARACTER_STRING_identification& other_value);
  CHARACTER_STRING_identification_template(const OPTIONAL<CHARACTER_STRING_identification>& other_value);
  CHARACTER_STRING_identification_template(const CHARACTER_STRING_identification_template& other_value);
  ~CHARACTER_STRING_identification_template();
  void clean_up();
  CHARACTER_STRING_identification_template& operator=(template_sel other_value);
  CHARACTER_STRING_identification_template& operator=(const CHARACTER_STRING_identification& other_value);
  CHARACTER_STRING_identification_template& operator=(const OPTIONAL<CHARACTER_STRING_identification>& other_value);
  CHARACTER_STRING_identification_template& operator=(const CHARACTER_STRING_identification_template& other_value);
Elemer Lelik's avatar
Elemer Lelik committed
146
  boolean match(const CHARACTER_STRING_identification& other_value, boolean legacy = FALSE) const;
Elemer Lelik's avatar
Elemer Lelik committed
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
  CHARACTER_STRING_identification valueof() const;
  CHARACTER_STRING_identification_template& list_item(unsigned int list_index) const;
  void set_type(template_sel template_type, unsigned int list_length);
  CHARACTER_STRING_identification_syntaxes_template& syntaxes();
  const CHARACTER_STRING_identification_syntaxes_template& syntaxes() const;
  OBJID_template& syntax();
  const OBJID_template& syntax() const;
  INTEGER_template& presentation__context__id();
  const INTEGER_template& presentation__context__id() const;
  CHARACTER_STRING_identification_context__negotiation_template& context__negotiation();
  const CHARACTER_STRING_identification_context__negotiation_template& context__negotiation() const;
  OBJID_template& transfer__syntax();
  const OBJID_template& transfer__syntax() const;
  ASN_NULL_template& fixed();
  const ASN_NULL_template& fixed() const;
  boolean ischosen(CHARACTER_STRING_identification::union_selection_type checked_selection) const;
  void log() const;
Elemer Lelik's avatar
Elemer Lelik committed
164
  void log_match(const CHARACTER_STRING_identification& match_value, boolean legacy = FALSE) const;
Elemer Lelik's avatar
Elemer Lelik committed
165
166
167
  void encode_text(Text_Buf& text_buf) const;
  void decode_text(Text_Buf& text_buf);

Elemer Lelik's avatar
Elemer Lelik committed
168
169
  boolean is_present(boolean legacy = FALSE) const;
  boolean match_omit(boolean legacy = FALSE) const;
Elemer Lelik's avatar
Elemer Lelik committed
170
171
  void set_param(Module_Param& param);
#ifdef TITAN_RUNTIME_2
172
  Module_Param* get_param(Module_Param_Name& param_name) const;
Elemer Lelik's avatar
Elemer Lelik committed
173
174
175
176
177
  void valueofv(Base_Type* value) const { *(static_cast<CHARACTER_STRING_identification*>(value)) = valueof(); }
  void set_value(template_sel other_value) { *this = other_value; }
  void copy_value(const Base_Type* other_value) { *this = *(static_cast<const CHARACTER_STRING_identification*>(other_value)); }
  Base_Template* clone() const { return new CHARACTER_STRING_identification_template(*this); }
  const TTCN_Typedescriptor_t* get_descriptor() const { return &CHARACTER_STRING_descr_; }
Elemer Lelik's avatar
Elemer Lelik committed
178
179
  boolean matchv(const Base_Type* other_value, boolean legacy) const { return match(*(static_cast<const CHARACTER_STRING_identification*>(other_value)), legacy); }
  void log_matchv(const Base_Type* match_value, boolean legacy) const  { log_match(*(static_cast<const CHARACTER_STRING_identification*>(match_value)), legacy); }
Elemer Lelik's avatar
Elemer Lelik committed
180
#else
Elemer Lelik's avatar
Elemer Lelik committed
181
  void check_restriction(template_res t_res, const char* t_name=NULL, boolean legacy = FALSE) const;
Elemer Lelik's avatar
Elemer Lelik committed
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
#endif
};

class CHARACTER_STRING_identification_syntaxes : public Base_Type {
  OBJID field_abstract;
  OBJID field_transfer;
public:
  CHARACTER_STRING_identification_syntaxes();
  CHARACTER_STRING_identification_syntaxes(const OBJID& par_abstract,
					   const OBJID& par_transfer);
  boolean operator==(const CHARACTER_STRING_identification_syntaxes& other_value) const;
  inline boolean operator!=(const CHARACTER_STRING_identification_syntaxes& other_value) const
  { return !(*this == other_value); }

  inline OBJID& abstract()
  {return field_abstract;}
  inline const OBJID& abstract() const
  {return field_abstract;}
  inline OBJID& transfer()
  {return field_transfer;}
  inline const OBJID& transfer() const
  {return field_transfer;}
  int size_of() const;
  void log() const;
#ifdef TITAN_RUNTIME_2
  boolean is_equal(const Base_Type* other_value) const { return *this == *(static_cast<const CHARACTER_STRING_identification_syntaxes*>(other_value)); }
  void set_value(const Base_Type* other_value) { *this = *(static_cast<const CHARACTER_STRING_identification_syntaxes*>(other_value)); }
  Base_Type* clone() const { return new CHARACTER_STRING_identification_syntaxes(*this); }
  const TTCN_Typedescriptor_t* get_descriptor() const { return &CHARACTER_STRING_descr_; }
211
  Module_Param* get_param(Module_Param_Name& param_name) const;
Elemer Lelik's avatar
Elemer Lelik committed
212
213
214
215
216
217
218
219
220
221
222
223
224
225
#else
  inline boolean is_present() const { return is_bound(); }
#endif
  boolean is_bound() const;
  boolean is_value() const;
  void clean_up();
  void set_param(Module_Param& param);
  void encode_text(Text_Buf& text_buf) const;
  void decode_text(Text_Buf& text_buf);
  //void encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, TTCN_EncDec::coding_t p_coding, ...) const;
  //void decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, TTCN_EncDec::coding_t p_coding, ...);
  ASN_BER_TLV_t* BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const;
  boolean BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form);
  int XER_encode(const XERdescriptor_t& p_td,
Elemer Lelik's avatar
Elemer Lelik committed
226
                 TTCN_Buffer& p_buf, unsigned int flavor, int indent, embed_values_enc_struct_t*) const;
Elemer Lelik's avatar
Elemer Lelik committed
227
  int XER_decode(const XERdescriptor_t& p_td,
Elemer Lelik's avatar
Elemer Lelik committed
228
                 XmlReaderWrap& reader, unsigned int flavor, unsigned int flavor2, embed_values_dec_struct_t*);
Elemer Lelik's avatar
Elemer Lelik committed
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
};

class CHARACTER_STRING_identification_syntaxes_template : public Base_Template {
#ifdef __SUNPRO_CC
 public:
#endif
  struct single_value_struct;
#ifdef __SUNPRO_CC
 private:
#endif
  union {
    single_value_struct *single_value;
    struct {
      unsigned int n_values;
      CHARACTER_STRING_identification_syntaxes_template *list_value;
    } value_list;
  };

  void set_specific();
  void copy_value(const CHARACTER_STRING_identification_syntaxes& other_value);
  void copy_template(const CHARACTER_STRING_identification_syntaxes_template& other_value);

public:
  CHARACTER_STRING_identification_syntaxes_template();
  CHARACTER_STRING_identification_syntaxes_template(template_sel other_value);
  CHARACTER_STRING_identification_syntaxes_template(const CHARACTER_STRING_identification_syntaxes& other_value);
  CHARACTER_STRING_identification_syntaxes_template(const OPTIONAL<CHARACTER_STRING_identification_syntaxes>& other_value);
  CHARACTER_STRING_identification_syntaxes_template(const CHARACTER_STRING_identification_syntaxes_template& other_value);
  ~CHARACTER_STRING_identification_syntaxes_template();
  void clean_up();
  CHARACTER_STRING_identification_syntaxes_template& operator=(template_sel other_value);
  CHARACTER_STRING_identification_syntaxes_template& operator=(const CHARACTER_STRING_identification_syntaxes& other_value);
  CHARACTER_STRING_identification_syntaxes_template& operator=(const OPTIONAL<CHARACTER_STRING_identification_syntaxes>& other_value);
  CHARACTER_STRING_identification_syntaxes_template& operator=(const CHARACTER_STRING_identification_syntaxes_template& other_value);
Elemer Lelik's avatar
Elemer Lelik committed
263
  boolean match(const CHARACTER_STRING_identification_syntaxes& other_value, boolean legacy = FALSE) const;
Elemer Lelik's avatar
Elemer Lelik committed
264
265
266
267
268
269
270
271
272
  CHARACTER_STRING_identification_syntaxes valueof() const;
  void set_type(template_sel template_type, unsigned int list_length);
  CHARACTER_STRING_identification_syntaxes_template& list_item(unsigned int list_index) const;
  OBJID_template& abstract();
  const OBJID_template& abstract() const;
  OBJID_template& transfer();
  const OBJID_template& transfer() const;
  int size_of() const;
  void log() const;
Elemer Lelik's avatar
Elemer Lelik committed
273
  void log_match(const CHARACTER_STRING_identification_syntaxes& match_value, boolean legacy = FALSE) const;
Elemer Lelik's avatar
Elemer Lelik committed
274
275
276
  void encode_text(Text_Buf& text_buf) const;
  void decode_text(Text_Buf& text_buf);

Elemer Lelik's avatar
Elemer Lelik committed
277
278
  boolean is_present(boolean legacy = FALSE) const;
  boolean match_omit(boolean legacy = FALSE) const;
Elemer Lelik's avatar
Elemer Lelik committed
279
280
  void set_param(Module_Param& param);
#ifdef TITAN_RUNTIME_2
281
  Module_Param* get_param(Module_Param_Name& param_name) const;
Elemer Lelik's avatar
Elemer Lelik committed
282
283
284
285
286
  void valueofv(Base_Type* value) const { *(static_cast<CHARACTER_STRING_identification_syntaxes*>(value)) = valueof(); }
  void set_value(template_sel other_value) { *this = other_value; }
  void copy_value(const Base_Type* other_value) { *this = *(static_cast<const CHARACTER_STRING_identification_syntaxes*>(other_value)); }
  Base_Template* clone() const { return new CHARACTER_STRING_identification_syntaxes_template(*this); }
  const TTCN_Typedescriptor_t* get_descriptor() const { return &CHARACTER_STRING_descr_; }
Elemer Lelik's avatar
Elemer Lelik committed
287
288
  boolean matchv(const Base_Type* other_value, boolean legacy) const { return match(*(static_cast<const CHARACTER_STRING_identification_syntaxes*>(other_value)), legacy); }
  void log_matchv(const Base_Type* match_value, boolean legacy) const  { log_match(*(static_cast<const CHARACTER_STRING_identification_syntaxes*>(match_value)), legacy); }
Elemer Lelik's avatar
Elemer Lelik committed
289
#else
Elemer Lelik's avatar
Elemer Lelik committed
290
  void check_restriction(template_res t_res, const char* t_name=NULL, boolean legacy = FALSE) const;
Elemer Lelik's avatar
Elemer Lelik committed
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
#endif
};

class CHARACTER_STRING_identification_context__negotiation : public Base_Type {
  INTEGER field_presentation__context__id;
  OBJID field_transfer__syntax;
public:
  CHARACTER_STRING_identification_context__negotiation();
  CHARACTER_STRING_identification_context__negotiation(const INTEGER& par_presentation__context__id,
						       const OBJID& par_transfer__syntax);
  boolean operator==(const CHARACTER_STRING_identification_context__negotiation& other_value) const;
  inline boolean operator!=(const CHARACTER_STRING_identification_context__negotiation& other_value) const
  { return !(*this == other_value); }

  inline INTEGER& presentation__context__id()
  {return field_presentation__context__id;}
  inline const INTEGER& presentation__context__id() const
  {return field_presentation__context__id;}
  inline OBJID& transfer__syntax()
  {return field_transfer__syntax;}
  inline const OBJID& transfer__syntax() const
  {return field_transfer__syntax;}
  int size_of() const;
  void log() const;
  boolean is_bound() const;
  boolean is_value() const;
  void clean_up();
#ifdef TITAN_RUNTIME_2
  boolean is_equal(const Base_Type* other_value) const { return *this == *(static_cast<const CHARACTER_STRING_identification_context__negotiation*>(other_value)); }
  void set_value(const Base_Type* other_value) { *this = *(static_cast<const CHARACTER_STRING_identification_context__negotiation*>(other_value)); }
  Base_Type* clone() const { return new CHARACTER_STRING_identification_context__negotiation(*this); }
  const TTCN_Typedescriptor_t* get_descriptor() const { return &CHARACTER_STRING_descr_; }
323
  Module_Param* get_param(Module_Param_Name& param_name) const;
Elemer Lelik's avatar
Elemer Lelik committed
324
325
326
327
328
329
330
331
332
333
334
#else
  inline boolean is_present() const { return is_bound(); }
#endif
  void set_param(Module_Param& param);
  void encode_text(Text_Buf& text_buf) const;
  void decode_text(Text_Buf& text_buf);
  //void encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, TTCN_EncDec::coding_t p_coding, ...) const;
  //void decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, TTCN_EncDec::coding_t p_coding, ...);
  ASN_BER_TLV_t* BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const;
  boolean BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form);
  int XER_encode(const XERdescriptor_t& p_td,
Elemer Lelik's avatar
Elemer Lelik committed
335
                 TTCN_Buffer& p_buf, unsigned int flavor, int indent, embed_values_enc_struct_t*) const;
Elemer Lelik's avatar
Elemer Lelik committed
336
  int XER_decode(const XERdescriptor_t& p_td,
Elemer Lelik's avatar
Elemer Lelik committed
337
                 XmlReaderWrap& reader, unsigned int flavor, unsigned int flavor2, embed_values_dec_struct_t*);
Elemer Lelik's avatar
Elemer Lelik committed
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
};

class CHARACTER_STRING_identification_context__negotiation_template : public Base_Template {
#ifdef __SUNPRO_CC
 public:
#endif
  struct single_value_struct;
#ifdef __SUNPRO_CC
 private:
#endif
  union {
    single_value_struct *single_value;
    struct {
      unsigned int n_values;
      CHARACTER_STRING_identification_context__negotiation_template *list_value;
    } value_list;
  };

  void set_specific();
  void copy_value(const CHARACTER_STRING_identification_context__negotiation& other_value);
  void copy_template(const CHARACTER_STRING_identification_context__negotiation_template& other_value);

public:
  CHARACTER_STRING_identification_context__negotiation_template();
  CHARACTER_STRING_identification_context__negotiation_template(template_sel other_value);
  CHARACTER_STRING_identification_context__negotiation_template(const CHARACTER_STRING_identification_context__negotiation& other_value);
  CHARACTER_STRING_identification_context__negotiation_template(const OPTIONAL<CHARACTER_STRING_identification_context__negotiation>& other_value);
  CHARACTER_STRING_identification_context__negotiation_template(const CHARACTER_STRING_identification_context__negotiation_template& other_value);
  ~CHARACTER_STRING_identification_context__negotiation_template();
  void clean_up();
  CHARACTER_STRING_identification_context__negotiation_template& operator=(template_sel other_value);
  CHARACTER_STRING_identification_context__negotiation_template& operator=(const CHARACTER_STRING_identification_context__negotiation& other_value);
  CHARACTER_STRING_identification_context__negotiation_template& operator=(const OPTIONAL<CHARACTER_STRING_identification_context__negotiation>& other_value);
  CHARACTER_STRING_identification_context__negotiation_template& operator=(const CHARACTER_STRING_identification_context__negotiation_template& other_value);
Elemer Lelik's avatar
Elemer Lelik committed
372
  boolean match(const CHARACTER_STRING_identification_context__negotiation& other_value, boolean legacy = FALSE) const;
Elemer Lelik's avatar
Elemer Lelik committed
373
374
375
376
377
378
379
380
381
  CHARACTER_STRING_identification_context__negotiation valueof() const;
  void set_type(template_sel template_type, unsigned int list_length);
  CHARACTER_STRING_identification_context__negotiation_template& list_item(unsigned int list_index) const;
  INTEGER_template& presentation__context__id();
  const INTEGER_template& presentation__context__id() const;
  OBJID_template& transfer__syntax();
  const OBJID_template& transfer__syntax() const;
  int size_of() const;
  void log() const;
Elemer Lelik's avatar
Elemer Lelik committed
382
  void log_match(const CHARACTER_STRING_identification_context__negotiation& match_value, boolean legacy = FALSE) const;
Elemer Lelik's avatar
Elemer Lelik committed
383
384
385
  void encode_text(Text_Buf& text_buf) const;
  void decode_text(Text_Buf& text_buf);

Elemer Lelik's avatar
Elemer Lelik committed
386
387
  boolean is_present(boolean legacy = FALSE) const;
  boolean match_omit(boolean legacy = FALSE) const;
Elemer Lelik's avatar
Elemer Lelik committed
388
389
  void set_param(Module_Param& param);
#ifdef TITAN_RUNTIME_2
390
  Module_Param* get_param(Module_Param_Name& param_name) const;
Elemer Lelik's avatar
Elemer Lelik committed
391
392
393
394
395
  void valueofv(Base_Type* value) const { *(static_cast<CHARACTER_STRING_identification_context__negotiation*>(value)) = valueof(); }
  void set_value(template_sel other_value) { *this = other_value; }
  void copy_value(const Base_Type* other_value) { *this = *(static_cast<const CHARACTER_STRING_identification_context__negotiation*>(other_value)); }
  Base_Template* clone() const { return new CHARACTER_STRING_identification_context__negotiation_template(*this); }
  const TTCN_Typedescriptor_t* get_descriptor() const { return &CHARACTER_STRING_descr_; }
Elemer Lelik's avatar
Elemer Lelik committed
396
397
  boolean matchv(const Base_Type* other_value, boolean legacy) const { return match(*(static_cast<const CHARACTER_STRING_identification_context__negotiation*>(other_value)), legacy); }
  void log_matchv(const Base_Type* match_value, boolean legacy) const { log_match(*(static_cast<const CHARACTER_STRING_identification_context__negotiation*>(match_value)), legacy); }
Elemer Lelik's avatar
Elemer Lelik committed
398
#else
Elemer Lelik's avatar
Elemer Lelik committed
399
  void check_restriction(template_res t_res, const char* t_name=NULL, boolean legacy = FALSE) const;
Elemer Lelik's avatar
Elemer Lelik committed
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
#endif
};

/** Runtime class for ASN.1 unrestricted <tt>CHARACTER STRING</tt> type
 *
 */
class CHARACTER_STRING : public Base_Type {
  CHARACTER_STRING_identification field_identification;
  OPTIONAL<UNIVERSAL_CHARSTRING> field_data__value__descriptor;
  OCTETSTRING field_string__value;
public:
  CHARACTER_STRING();
  CHARACTER_STRING(const CHARACTER_STRING_identification& par_identification,
		   const OPTIONAL<UNIVERSAL_CHARSTRING>& par_data__value__descriptor,
		   const OCTETSTRING& par_string__value);
  boolean operator==(const CHARACTER_STRING& other_value) const;
  inline boolean operator!=(const CHARACTER_STRING& other_value) const
  { return !(*this == other_value); }

  inline CHARACTER_STRING_identification& identification()
  {return field_identification;}
  inline const CHARACTER_STRING_identification& identification() const
  {return field_identification;}
  inline OPTIONAL<UNIVERSAL_CHARSTRING>& data__value__descriptor()
  {return field_data__value__descriptor;}
  inline const OPTIONAL<UNIVERSAL_CHARSTRING>& data__value__descriptor() const
  {return field_data__value__descriptor;}
  inline OCTETSTRING& string__value()
  {return field_string__value;}
  inline const OCTETSTRING& string__value() const
  {return field_string__value;}
  boolean is_bound() const;
  boolean is_value() const;
  void clean_up();
  int size_of() const;
  void log() const;
#ifdef TITAN_RUNTIME_2
  boolean is_equal(const Base_Type* other_value) const { return *this == *(static_cast<const CHARACTER_STRING*>(other_value)); }
  void set_value(const Base_Type* other_value) { *this = *(static_cast<const CHARACTER_STRING*>(other_value)); }
  Base_Type* clone() const { return new CHARACTER_STRING(*this); }
  const TTCN_Typedescriptor_t* get_descriptor() const { return &CHARACTER_STRING_descr_; }
441
  Module_Param* get_param(Module_Param_Name& param_name) const;
Elemer Lelik's avatar
Elemer Lelik committed
442
443
444
445
446
447
448
449
450
451
#else
  inline boolean is_present() const { return is_bound(); }
#endif
  void set_param(Module_Param& param);
  void encode_text(Text_Buf& text_buf) const;
  void decode_text(Text_Buf& text_buf);
  void encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, TTCN_EncDec::coding_t p_coding, ...) const;
  void decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, TTCN_EncDec::coding_t p_coding, ...);
  ASN_BER_TLV_t* BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const;
  boolean BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form);
Elemer Lelik's avatar
Elemer Lelik committed
452
  int XER_encode(const XERdescriptor_t&, TTCN_Buffer&, unsigned int, int, embed_values_enc_struct_t*) const;
Elemer Lelik's avatar
Elemer Lelik committed
453
  int XER_decode(const XERdescriptor_t&, XmlReaderWrap& reader, unsigned int, unsigned int, embed_values_dec_struct_t*);
Elemer Lelik's avatar
Elemer Lelik committed
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
};

class CHARACTER_STRING_template : public Base_Template {
#ifdef __SUNPRO_CC
 public:
#endif
  struct single_value_struct;
#ifdef __SUNPRO_CC
 private:
#endif
  union {
    single_value_struct *single_value;
    struct {
      unsigned int n_values;
      CHARACTER_STRING_template *list_value;
    } value_list;
  };

  void set_specific();
  void copy_value(const CHARACTER_STRING& other_value);
  void copy_template(const CHARACTER_STRING_template& other_value);

public:
  CHARACTER_STRING_template();
  CHARACTER_STRING_template(template_sel other_value);
  CHARACTER_STRING_template(const CHARACTER_STRING& other_value);
  CHARACTER_STRING_template(const OPTIONAL<CHARACTER_STRING>& other_value);
  CHARACTER_STRING_template(const CHARACTER_STRING_template& other_value);
  ~CHARACTER_STRING_template();
  void clean_up();
  CHARACTER_STRING_template& operator=(template_sel other_value);
  CHARACTER_STRING_template& operator=(const CHARACTER_STRING& other_value);
  CHARACTER_STRING_template& operator=(const OPTIONAL<CHARACTER_STRING>& other_value);
  CHARACTER_STRING_template& operator=(const CHARACTER_STRING_template& other_value);
Elemer Lelik's avatar
Elemer Lelik committed
488
  boolean match(const CHARACTER_STRING& other_value, boolean legacy = FALSE) const;
Elemer Lelik's avatar
Elemer Lelik committed
489
490
491
492
493
494
495
496
497
498
499
  CHARACTER_STRING valueof() const;
  void set_type(template_sel template_type, unsigned int list_length);
  CHARACTER_STRING_template& list_item(unsigned int list_index) const;
  CHARACTER_STRING_identification_template& identification();
  const CHARACTER_STRING_identification_template& identification() const;
  UNIVERSAL_CHARSTRING_template& data__value__descriptor();
  const UNIVERSAL_CHARSTRING_template& data__value__descriptor() const;
  OCTETSTRING_template& string__value();
  const OCTETSTRING_template& string__value() const;
  int size_of() const;
  void log() const;
Elemer Lelik's avatar
Elemer Lelik committed
500
  void log_match(const CHARACTER_STRING& match_value, boolean legacy = FALSE) const;
Elemer Lelik's avatar
Elemer Lelik committed
501
502
503
  void encode_text(Text_Buf& text_buf) const;
  void decode_text(Text_Buf& text_buf);

Elemer Lelik's avatar
Elemer Lelik committed
504
505
  boolean is_present(boolean legacy = FALSE) const;
  boolean match_omit(boolean legacy = FALSE) const;
Elemer Lelik's avatar
Elemer Lelik committed
506
507
  void set_param(Module_Param& param);
#ifdef TITAN_RUNTIME_2
508
  Module_Param* get_param(Module_Param_Name& param_name) const;
Elemer Lelik's avatar
Elemer Lelik committed
509
510
511
512
513
  void valueofv(Base_Type* value) const { *(static_cast<CHARACTER_STRING*>(value)) = valueof(); }
  void set_value(template_sel other_value) { *this = other_value; }
  void copy_value(const Base_Type* other_value) { *this = *(static_cast<const CHARACTER_STRING*>(other_value)); }
  Base_Template* clone() const { return new CHARACTER_STRING_template(*this); }
  const TTCN_Typedescriptor_t* get_descriptor() const { return &CHARACTER_STRING_descr_; }
Elemer Lelik's avatar
Elemer Lelik committed
514
515
  boolean matchv(const Base_Type* other_value, boolean legacy) const { return match(*(static_cast<const CHARACTER_STRING*>(other_value)), legacy); }
  void log_matchv(const Base_Type* match_value, boolean legacy) const  { log_match(*(static_cast<const CHARACTER_STRING*>(match_value)), legacy); }
Elemer Lelik's avatar
Elemer Lelik committed
516
#else
Elemer Lelik's avatar
Elemer Lelik committed
517
  void check_restriction(template_res t_res, const char* t_name=NULL, boolean legacy = FALSE) const;
Elemer Lelik's avatar
Elemer Lelik committed
518
519
520
521
#endif
};

#endif // ASN_CharacterString_HH