source: trunk/ETSI-Testsuites/ETSI_auto_IOT/codec/c++/libcommon_codets.h

Last change on this file was 22, checked in by rings, 14 years ago
  • Property svn:executable set to *
File size: 12.9 KB
RevLine 
[22]1#ifndef LIBCOMMON_CODETS_H
2#define LIBCOMMON_CODETS_H
3
4#include <t3devlib/t3devlib.h>
5#include <t3devlib/generator.h>
6
7namespace t3devlib { namespace gen {
8
9//
10// Implementation of subtypes defined in the module LibCommon_DataStrings
11//
12
13// types to be coded as a fixed-lengh string
14T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit1, Bitstring, 1)
15T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit2, Bitstring, 2)
16T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit3, Bitstring, 3)
17T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit4, Bitstring, 4)
18T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit5, Bitstring, 5)
19T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit6, Bitstring, 6)
20T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit7, Bitstring, 7)
21T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit8, Bitstring, 8)
22T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit9, Bitstring, 9)
23T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit10, Bitstring, 10)
24T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit11, Bitstring, 11)
25T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit12, Bitstring, 12)
26T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit13, Bitstring, 13)
27T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit14, Bitstring, 14)
28T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit15, Bitstring, 15)
29T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit16, Bitstring, 16)
30T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit17, Bitstring, 17)
31T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit18, Bitstring, 18)
32T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit19, Bitstring, 19)
33T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit20, Bitstring, 20)
34T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit21, Bitstring, 21)
35T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit22, Bitstring, 22)
36T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit23, Bitstring, 23)
37T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit24, Bitstring, 24)
38T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit25, Bitstring, 25)
39T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit26, Bitstring, 26)
40T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit27, Bitstring, 27)
41T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit28, Bitstring, 28)
42T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit29, Bitstring, 29)
43T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit30, Bitstring, 30)
44T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit31, Bitstring, 31)
45T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit32, Bitstring, 32)
46T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit48, Bitstring, 48)
47T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit64, Bitstring, 64)
48T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Bit128, Bitstring, 128)
49
50T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Oct1, Octetstring, 8)
51T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Oct2, Octetstring, 16)
52T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Oct3, Octetstring, 24)
53T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Oct4, Octetstring, 32)
54T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Oct5, Octetstring, 40)
55T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Oct6, Octetstring, 48)
56T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Oct7, Octetstring, 56)
57T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Oct8, Octetstring, 64)
58T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Oct9, Octetstring, 72)
59T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Oct10, Octetstring, 80)
60T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Oct11, Octetstring, 88)
61T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Oct12, Octetstring, 96)
62T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Oct13, Octetstring, 104)
63T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Oct14, Octetstring, 112)
64T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Oct15, Octetstring, 120)
65T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Oct16, Octetstring, 128)
66T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Oct80, Octetstring, 640)
67T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Oct128, Octetstring, 1024)
68T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Oct160, Octetstring, 1280)
69T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Oct320, Octetstring, 2560)
70T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Oct640, Octetstring, 5120)
71T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Oct1280, Octetstring, 10240)
72T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_DataStrings, Oct1380, Octetstring, 11040)
73
74T3DEVLIB_VARIABLE_SIZE_STRING_DEFINITION (LibCommon_DataStrings, Oct1to15, Octetstring, (1*8), (15*8));
75T3DEVLIB_VARIABLE_SIZE_STRING_DEFINITION (LibCommon_DataStrings, Oct6to15, Octetstring, (6*8), (15*8));
76T3DEVLIB_VARIABLE_SIZE_STRING_DEFINITION (LibCommon_DataStrings, Oct1to128, Octetstring, (1*8), (128*8));
77T3DEVLIB_VARIABLE_SIZE_STRING_DEFINITION (LibCommon_DataStrings, Oct1to254, Octetstring, (1*8), (254*8));
78T3DEVLIB_VARIABLE_SIZE_STRING_DEFINITION (LibCommon_DataStrings, Oct1to255, Octetstring, (1*8), (255*8));
79
80
81//
82// Implementation of subtypes defined in the module LibCommon_TextStrings
83//
84
85// types to be coded as a fixed-lengh string
86T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_TextStrings, String1, Charstring, 8)
87T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_TextStrings, String2, Charstring, 16)
88T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_TextStrings, String3, Charstring, 24)
89T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_TextStrings, String4, Charstring, 32)
90T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_TextStrings, String5, Charstring, 40)
91T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_TextStrings, String6, Charstring, 48)
92T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_TextStrings, String7, Charstring, 56)
93T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_TextStrings, String8, Charstring, 64)
94T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_TextStrings, String9, Charstring, 72)
95T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_TextStrings, String10, Charstring, 80)
96T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_TextStrings, String11, Charstring, 88)
97T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_TextStrings, String12, Charstring, 96)
98T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_TextStrings, String13, Charstring, 104)
99T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_TextStrings, String14, Charstring, 112)
100T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_TextStrings, String15, Charstring, 120)
101T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_TextStrings, String16, Charstring, 128)
102
103// types to be coded as variable-length string withing a range
104T3DEVLIB_VARIABLE_SIZE_STRING_DEFINITION (LibCommon_TextStrings, String1To63, Charstring, (1*8), (63*8));
105T3DEVLIB_VARIABLE_SIZE_STRING_DEFINITION (LibCommon_TextStrings, String1To64, Charstring, (1*8), (64*8));
106T3DEVLIB_VARIABLE_SIZE_STRING_DEFINITION (LibCommon_TextStrings, String1To127, Charstring, (1*8), (127*8));
107T3DEVLIB_VARIABLE_SIZE_STRING_DEFINITION (LibCommon_TextStrings, String1To128, Charstring, (1*8), (128*8));
108T3DEVLIB_VARIABLE_SIZE_STRING_DEFINITION (LibCommon_TextStrings, String1To255, Charstring, (1*8), (255*8));
109
110// TODO: content restrictions
111typedef t3devlib::Charstring AlphaNum;
112T3DEVLIB_FIXED_STRING_DEFINITION(LibCommon_TextStrings, AlphaNum2, Charstring, 16)
113T3DEVLIB_VARIABLE_SIZE_STRING_DEFINITION (LibCommon_TextStrings, AlphaNum1To32, Charstring, (1*8), (32*8));
114
115
116//
117// Implementation of subtypes defined in the module LibCommon_BasicTypesAndValues
118//
119
120// types to be coded as fixed-width integer in the big-endian format
121T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt, Unsigned, 64) // limit
122T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt1, Unsigned, 1)
123T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt2, Unsigned, 2)
124T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt3, Unsigned, 3)
125T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt4, Unsigned, 4)
126T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt5, Unsigned, 5)
127T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt6, Unsigned, 6)
128T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt7, Unsigned, 7)
129T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt8, Unsigned, 8)
130T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt9, Unsigned, 9)
131T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt10, Unsigned, 10)
132T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt11, Unsigned, 11)
133T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt12, Unsigned, 12)
134T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt13, Unsigned, 13)
135T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt14, Unsigned, 14)
136T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt15, Unsigned, 15)
137T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt16, Unsigned, 16)
138T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt17, Unsigned, 17)
139T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt18, Unsigned, 18)
140T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt19, Unsigned, 19)
141T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt20, Unsigned, 20)
142T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt21, Unsigned, 21)
143T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt22, Unsigned, 22)
144T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt23, Unsigned, 23)
145T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt24, Unsigned, 24)
146T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt25, Unsigned, 25)
147T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt26, Unsigned, 26)
148T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt27, Unsigned, 27)
149T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt28, Unsigned, 28)
150T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt29, Unsigned, 29)
151T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt30, Unsigned, 30)
152T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt31, Unsigned, 31)
153T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt32, Unsigned, 32)
154T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, UInt48, Unsigned, 48)
155
156T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int, Signed, 64) // limit
157T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int1, Signed, 1)
158T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int2, Signed, 2)
159T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int3, Signed, 3)
160T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int4, Signed, 4)
161T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int5, Signed, 5)
162T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int6, Signed, 6)
163T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int7, Signed, 7)
164T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int8, Signed, 8)
165T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int9, Signed, 9)
166T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int10, Signed, 10)
167T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int11, Signed, 11)
168T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int12, Signed, 12)
169T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int13, Signed, 13)
170T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int14, Signed, 14)
171T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int15, Signed, 15)
172T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int16, Signed, 16)
173T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int17, Signed, 17)
174T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int18, Signed, 18)
175T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int19, Signed, 19)
176T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int20, Signed, 20)
177T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int21, Signed, 21)
178T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int22, Signed, 22)
179T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int23, Signed, 23)
180T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int24, Signed, 24)
181T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int25, Signed, 25)
182T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int26, Signed, 26)
183T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int27, Signed, 27)
184T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int28, Signed, 28)
185T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int29, Signed, 29)
186T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int30, Signed, 30)
187T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int31, Signed, 31)
188T3DEVLIB_INTEGER_DEFINITION(LibCommon_BasicTypesAndValues, Int32, Signed, 32)
189
190
191}} // namespaces
192
193#endif
194
Note: See TracBrowser for help on using the repository browser.