Merge "implemented decmatch (artf724241)"
[deliverable/titan.core.git] / core / String_struct.hh
1 /******************************************************************************
2 * Copyright (c) 2000-2016 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 * Contributors:
9 * Balasko, Jeno
10 * Raduly, Csaba
11 * Szabados, Kristof
12 * Szabo, Janos Zoltan – initial implementation
13 *
14 ******************************************************************************/
15 #ifndef STRING_STRUCT_HH
16 #define STRING_STRUCT_HH
17
18 #include "Types.h"
19 #include "Bitstring.hh"
20 #include "Hexstring.hh"
21 #include "Octetstring.hh"
22 #include "Charstring.hh"
23 #include "Universal_charstring.hh"
24 #include "Encdec.hh"
25 #include "CharCoding.hh"
26
27 /** Type of the reference counters in all structures. */
28 typedef unsigned int ref_count_t;
29
30 /** Packed storage of bits, filled from LSB. */
31 struct BITSTRING::bitstring_struct {
32 ref_count_t ref_count;
33 int n_bits;
34 unsigned char bits_ptr[sizeof(int)];
35 };
36
37 /** Each element occupies one byte. Meaning of values:
38 * 0 -> 0, 1 -> 1, 2 -> ?, 3 -> * */
39 struct BITSTRING_template::bitstring_pattern_struct {
40 ref_count_t ref_count;
41 unsigned int n_elements;
42 unsigned char elements_ptr[1];
43 };
44
45 /** Packed storage of hex digits, filled from LSB. */
46 struct HEXSTRING::hexstring_struct {
47 ref_count_t ref_count;
48 int n_nibbles;
49 unsigned char nibbles_ptr[sizeof(int)];
50 };
51
52 /** Each element occupies one byte. Meaning of values:
53 * 0 .. 15 -> 0 .. F, 16 -> ?, 17 -> * */
54 struct HEXSTRING_template::hexstring_pattern_struct {
55 ref_count_t ref_count;
56 unsigned int n_elements;
57 unsigned char elements_ptr[1];
58 };
59
60 struct OCTETSTRING::octetstring_struct {
61 ref_count_t ref_count;
62 int n_octets;
63 unsigned char octets_ptr[sizeof(int)];
64 };
65
66 /** Each element is represented as an unsigned short. Meaning of values:
67 * 0 .. 255 -> 00 .. FF, 256 -> ?, 257 -> * */
68 struct OCTETSTRING_template::octetstring_pattern_struct {
69 ref_count_t ref_count;
70 unsigned int n_elements;
71 unsigned short elements_ptr[1];
72 };
73
74 struct CHARSTRING::charstring_struct {
75 ref_count_t ref_count;
76 int n_chars;
77 char chars_ptr[sizeof(int)];
78 };
79
80 struct UNIVERSAL_CHARSTRING::universal_charstring_struct {
81 ref_count_t ref_count;
82 int n_uchars;
83 universal_char uchars_ptr[1];
84 };
85
86 /* The layout of this structure must match that of charstring_struct */
87 struct TTCN_Buffer::buffer_struct {
88 ref_count_t ref_count;
89 int unused_length_field; /**< placeholder only */
90 unsigned char data_ptr[sizeof(int)];
91 };
92
93 /** Structure for storing a decoded content matching mechanism
94 * (for bitstrings, hexstrings, octetstrings and charstrings) */
95 struct decmatch_struct {
96 ref_count_t ref_count;
97 Dec_Match_Interface* instance;
98 };
99
100 /** Structure for storing a decoded content matching mechanism for universal
101 * charstrings (also contains the character coding method) */
102 struct unichar_decmatch_struct {
103 ref_count_t ref_count;
104 Dec_Match_Interface* instance;
105 CharCoding::CharCodingType coding;
106 };
107
108 #endif
This page took 0.044198 seconds and 5 git commands to generate.