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