blob: e5f6a61562e9f94cca22d98bbf39480174e4247d [file] [log] [blame]
// This C++ source file was generated by the TTCN-3 compiler
// of the TTCN-3 Test Executor version CRL 113 200/6 R6A
// for Lénárd Nagy (elnrnag@elx78355y6x) on Thu Oct 24 10:29:40 2019
// Copyright (c) 2000-2019 Ericsson Telecom AB
// Do not edit this file unless you know what you are doing.
/* Including header files */
#include "Can.hh"
namespace Can {
/* Prototypes of static functions */
static void pre_init_module();
static void post_init_module();
/* Literal string constants */
static const unsigned char os_3_octets[] = { 0, 0, 7, 255 },
os_4_octets[] = { 31, 255, 255, 255 },
os_2_octets[] = { 32, 0, 0, 0 },
os_1_octets[] = { 64, 0, 0, 0 },
os_0_octets[] = { 128, 0, 0, 0 };
static const OCTETSTRING os_3(4, os_3_octets),
os_4(4, os_4_octets),
os_2(4, os_2_octets),
os_1(4, os_1_octets),
os_0(4, os_0_octets);
static const unsigned short op_128_elements[] = { 0, 256, 256, 256 },
op_129_elements[] = { 1, 256, 256, 256 },
op_130_elements[] = { 2, 256, 256, 256 },
op_131_elements[] = { 3, 256, 256, 256 },
op_132_elements[] = { 4, 256, 256, 256 },
op_133_elements[] = { 5, 256, 256, 256 },
op_134_elements[] = { 6, 256, 256, 256 },
op_135_elements[] = { 7, 256, 256, 256 },
op_136_elements[] = { 8, 256, 256, 256 },
op_137_elements[] = { 9, 256, 256, 256 },
op_138_elements[] = { 10, 256, 256, 256 },
op_139_elements[] = { 11, 256, 256, 256 },
op_140_elements[] = { 12, 256, 256, 256 },
op_141_elements[] = { 13, 256, 256, 256 },
op_142_elements[] = { 14, 256, 256, 256 },
op_143_elements[] = { 15, 256, 256, 256 },
op_144_elements[] = { 16, 256, 256, 256 },
op_145_elements[] = { 17, 256, 256, 256 },
op_146_elements[] = { 18, 256, 256, 256 },
op_147_elements[] = { 19, 256, 256, 256 },
op_148_elements[] = { 20, 256, 256, 256 },
op_149_elements[] = { 21, 256, 256, 256 },
op_150_elements[] = { 22, 256, 256, 256 },
op_151_elements[] = { 23, 256, 256, 256 },
op_152_elements[] = { 24, 256, 256, 256 },
op_153_elements[] = { 25, 256, 256, 256 },
op_154_elements[] = { 26, 256, 256, 256 },
op_155_elements[] = { 27, 256, 256, 256 },
op_156_elements[] = { 28, 256, 256, 256 },
op_157_elements[] = { 29, 256, 256, 256 },
op_158_elements[] = { 30, 256, 256, 256 },
op_159_elements[] = { 31, 256, 256, 256 },
op_160_elements[] = { 32, 256, 256, 256 },
op_161_elements[] = { 33, 256, 256, 256 },
op_162_elements[] = { 34, 256, 256, 256 },
op_163_elements[] = { 35, 256, 256, 256 },
op_164_elements[] = { 36, 256, 256, 256 },
op_165_elements[] = { 37, 256, 256, 256 },
op_166_elements[] = { 38, 256, 256, 256 },
op_167_elements[] = { 39, 256, 256, 256 },
op_168_elements[] = { 40, 256, 256, 256 },
op_169_elements[] = { 41, 256, 256, 256 },
op_170_elements[] = { 42, 256, 256, 256 },
op_171_elements[] = { 43, 256, 256, 256 },
op_172_elements[] = { 44, 256, 256, 256 },
op_173_elements[] = { 45, 256, 256, 256 },
op_174_elements[] = { 46, 256, 256, 256 },
op_175_elements[] = { 47, 256, 256, 256 },
op_176_elements[] = { 48, 256, 256, 256 },
op_177_elements[] = { 49, 256, 256, 256 },
op_178_elements[] = { 50, 256, 256, 256 },
op_179_elements[] = { 51, 256, 256, 256 },
op_180_elements[] = { 52, 256, 256, 256 },
op_181_elements[] = { 53, 256, 256, 256 },
op_182_elements[] = { 54, 256, 256, 256 },
op_183_elements[] = { 55, 256, 256, 256 },
op_184_elements[] = { 56, 256, 256, 256 },
op_185_elements[] = { 57, 256, 256, 256 },
op_186_elements[] = { 58, 256, 256, 256 },
op_187_elements[] = { 59, 256, 256, 256 },
op_188_elements[] = { 60, 256, 256, 256 },
op_189_elements[] = { 61, 256, 256, 256 },
op_190_elements[] = { 62, 256, 256, 256 },
op_191_elements[] = { 63, 256, 256, 256 },
op_192_elements[] = { 64, 256, 256, 256 },
op_193_elements[] = { 65, 256, 256, 256 },
op_194_elements[] = { 66, 256, 256, 256 },
op_195_elements[] = { 67, 256, 256, 256 },
op_196_elements[] = { 68, 256, 256, 256 },
op_197_elements[] = { 69, 256, 256, 256 },
op_198_elements[] = { 70, 256, 256, 256 },
op_199_elements[] = { 71, 256, 256, 256 },
op_200_elements[] = { 72, 256, 256, 256 },
op_201_elements[] = { 73, 256, 256, 256 },
op_202_elements[] = { 74, 256, 256, 256 },
op_203_elements[] = { 75, 256, 256, 256 },
op_204_elements[] = { 76, 256, 256, 256 },
op_205_elements[] = { 77, 256, 256, 256 },
op_206_elements[] = { 78, 256, 256, 256 },
op_207_elements[] = { 79, 256, 256, 256 },
op_208_elements[] = { 80, 256, 256, 256 },
op_209_elements[] = { 81, 256, 256, 256 },
op_210_elements[] = { 82, 256, 256, 256 },
op_211_elements[] = { 83, 256, 256, 256 },
op_212_elements[] = { 84, 256, 256, 256 },
op_213_elements[] = { 85, 256, 256, 256 },
op_214_elements[] = { 86, 256, 256, 256 },
op_215_elements[] = { 87, 256, 256, 256 },
op_216_elements[] = { 88, 256, 256, 256 },
op_217_elements[] = { 89, 256, 256, 256 },
op_218_elements[] = { 90, 256, 256, 256 },
op_219_elements[] = { 91, 256, 256, 256 },
op_220_elements[] = { 92, 256, 256, 256 },
op_221_elements[] = { 93, 256, 256, 256 },
op_222_elements[] = { 94, 256, 256, 256 },
op_223_elements[] = { 95, 256, 256, 256 },
op_224_elements[] = { 96, 256, 256, 256 },
op_225_elements[] = { 97, 256, 256, 256 },
op_226_elements[] = { 98, 256, 256, 256 },
op_227_elements[] = { 99, 256, 256, 256 },
op_228_elements[] = { 100, 256, 256, 256 },
op_229_elements[] = { 101, 256, 256, 256 },
op_230_elements[] = { 102, 256, 256, 256 },
op_231_elements[] = { 103, 256, 256, 256 },
op_232_elements[] = { 104, 256, 256, 256 },
op_233_elements[] = { 105, 256, 256, 256 },
op_234_elements[] = { 106, 256, 256, 256 },
op_235_elements[] = { 107, 256, 256, 256 },
op_236_elements[] = { 108, 256, 256, 256 },
op_237_elements[] = { 109, 256, 256, 256 },
op_238_elements[] = { 110, 256, 256, 256 },
op_239_elements[] = { 111, 256, 256, 256 },
op_240_elements[] = { 112, 256, 256, 256 },
op_241_elements[] = { 113, 256, 256, 256 },
op_242_elements[] = { 114, 256, 256, 256 },
op_243_elements[] = { 115, 256, 256, 256 },
op_244_elements[] = { 116, 256, 256, 256 },
op_245_elements[] = { 117, 256, 256, 256 },
op_246_elements[] = { 118, 256, 256, 256 },
op_247_elements[] = { 119, 256, 256, 256 },
op_248_elements[] = { 120, 256, 256, 256 },
op_249_elements[] = { 121, 256, 256, 256 },
op_250_elements[] = { 122, 256, 256, 256 },
op_251_elements[] = { 123, 256, 256, 256 },
op_252_elements[] = { 124, 256, 256, 256 },
op_253_elements[] = { 125, 256, 256, 256 },
op_254_elements[] = { 126, 256, 256, 256 },
op_255_elements[] = { 127, 256, 256, 256 },
op_0_elements[] = { 128, 256, 256, 256 },
op_1_elements[] = { 129, 256, 256, 256 },
op_2_elements[] = { 130, 256, 256, 256 },
op_3_elements[] = { 131, 256, 256, 256 },
op_4_elements[] = { 132, 256, 256, 256 },
op_5_elements[] = { 133, 256, 256, 256 },
op_6_elements[] = { 134, 256, 256, 256 },
op_7_elements[] = { 135, 256, 256, 256 },
op_8_elements[] = { 136, 256, 256, 256 },
op_9_elements[] = { 137, 256, 256, 256 },
op_10_elements[] = { 138, 256, 256, 256 },
op_11_elements[] = { 139, 256, 256, 256 },
op_12_elements[] = { 140, 256, 256, 256 },
op_13_elements[] = { 141, 256, 256, 256 },
op_14_elements[] = { 142, 256, 256, 256 },
op_15_elements[] = { 143, 256, 256, 256 },
op_16_elements[] = { 144, 256, 256, 256 },
op_17_elements[] = { 145, 256, 256, 256 },
op_18_elements[] = { 146, 256, 256, 256 },
op_19_elements[] = { 147, 256, 256, 256 },
op_20_elements[] = { 148, 256, 256, 256 },
op_21_elements[] = { 149, 256, 256, 256 },
op_22_elements[] = { 150, 256, 256, 256 },
op_23_elements[] = { 151, 256, 256, 256 },
op_24_elements[] = { 152, 256, 256, 256 },
op_25_elements[] = { 153, 256, 256, 256 },
op_26_elements[] = { 154, 256, 256, 256 },
op_27_elements[] = { 155, 256, 256, 256 },
op_28_elements[] = { 156, 256, 256, 256 },
op_29_elements[] = { 157, 256, 256, 256 },
op_30_elements[] = { 158, 256, 256, 256 },
op_31_elements[] = { 159, 256, 256, 256 },
op_32_elements[] = { 160, 256, 256, 256 },
op_33_elements[] = { 161, 256, 256, 256 },
op_34_elements[] = { 162, 256, 256, 256 },
op_35_elements[] = { 163, 256, 256, 256 },
op_36_elements[] = { 164, 256, 256, 256 },
op_37_elements[] = { 165, 256, 256, 256 },
op_38_elements[] = { 166, 256, 256, 256 },
op_39_elements[] = { 167, 256, 256, 256 },
op_40_elements[] = { 168, 256, 256, 256 },
op_41_elements[] = { 169, 256, 256, 256 },
op_42_elements[] = { 170, 256, 256, 256 },
op_43_elements[] = { 171, 256, 256, 256 },
op_44_elements[] = { 172, 256, 256, 256 },
op_45_elements[] = { 173, 256, 256, 256 },
op_46_elements[] = { 174, 256, 256, 256 },
op_47_elements[] = { 175, 256, 256, 256 },
op_48_elements[] = { 176, 256, 256, 256 },
op_49_elements[] = { 177, 256, 256, 256 },
op_50_elements[] = { 178, 256, 256, 256 },
op_51_elements[] = { 179, 256, 256, 256 },
op_52_elements[] = { 180, 256, 256, 256 },
op_53_elements[] = { 181, 256, 256, 256 },
op_54_elements[] = { 182, 256, 256, 256 },
op_55_elements[] = { 183, 256, 256, 256 },
op_56_elements[] = { 184, 256, 256, 256 },
op_57_elements[] = { 185, 256, 256, 256 },
op_58_elements[] = { 186, 256, 256, 256 },
op_59_elements[] = { 187, 256, 256, 256 },
op_60_elements[] = { 188, 256, 256, 256 },
op_61_elements[] = { 189, 256, 256, 256 },
op_62_elements[] = { 190, 256, 256, 256 },
op_63_elements[] = { 191, 256, 256, 256 },
op_64_elements[] = { 192, 256, 256, 256 },
op_65_elements[] = { 193, 256, 256, 256 },
op_66_elements[] = { 194, 256, 256, 256 },
op_67_elements[] = { 195, 256, 256, 256 },
op_68_elements[] = { 196, 256, 256, 256 },
op_69_elements[] = { 197, 256, 256, 256 },
op_70_elements[] = { 198, 256, 256, 256 },
op_71_elements[] = { 199, 256, 256, 256 },
op_72_elements[] = { 200, 256, 256, 256 },
op_73_elements[] = { 201, 256, 256, 256 },
op_74_elements[] = { 202, 256, 256, 256 },
op_75_elements[] = { 203, 256, 256, 256 },
op_76_elements[] = { 204, 256, 256, 256 },
op_77_elements[] = { 205, 256, 256, 256 },
op_78_elements[] = { 206, 256, 256, 256 },
op_79_elements[] = { 207, 256, 256, 256 },
op_80_elements[] = { 208, 256, 256, 256 },
op_81_elements[] = { 209, 256, 256, 256 },
op_82_elements[] = { 210, 256, 256, 256 },
op_83_elements[] = { 211, 256, 256, 256 },
op_84_elements[] = { 212, 256, 256, 256 },
op_85_elements[] = { 213, 256, 256, 256 },
op_86_elements[] = { 214, 256, 256, 256 },
op_87_elements[] = { 215, 256, 256, 256 },
op_88_elements[] = { 216, 256, 256, 256 },
op_89_elements[] = { 217, 256, 256, 256 },
op_90_elements[] = { 218, 256, 256, 256 },
op_91_elements[] = { 219, 256, 256, 256 },
op_92_elements[] = { 220, 256, 256, 256 },
op_93_elements[] = { 221, 256, 256, 256 },
op_94_elements[] = { 222, 256, 256, 256 },
op_95_elements[] = { 223, 256, 256, 256 },
op_96_elements[] = { 224, 256, 256, 256 },
op_97_elements[] = { 225, 256, 256, 256 },
op_98_elements[] = { 226, 256, 256, 256 },
op_99_elements[] = { 227, 256, 256, 256 },
op_100_elements[] = { 228, 256, 256, 256 },
op_101_elements[] = { 229, 256, 256, 256 },
op_102_elements[] = { 230, 256, 256, 256 },
op_103_elements[] = { 231, 256, 256, 256 },
op_104_elements[] = { 232, 256, 256, 256 },
op_105_elements[] = { 233, 256, 256, 256 },
op_106_elements[] = { 234, 256, 256, 256 },
op_107_elements[] = { 235, 256, 256, 256 },
op_108_elements[] = { 236, 256, 256, 256 },
op_109_elements[] = { 237, 256, 256, 256 },
op_110_elements[] = { 238, 256, 256, 256 },
op_111_elements[] = { 239, 256, 256, 256 },
op_112_elements[] = { 240, 256, 256, 256 },
op_113_elements[] = { 241, 256, 256, 256 },
op_114_elements[] = { 242, 256, 256, 256 },
op_115_elements[] = { 243, 256, 256, 256 },
op_116_elements[] = { 244, 256, 256, 256 },
op_117_elements[] = { 245, 256, 256, 256 },
op_118_elements[] = { 246, 256, 256, 256 },
op_119_elements[] = { 247, 256, 256, 256 },
op_120_elements[] = { 248, 256, 256, 256 },
op_121_elements[] = { 249, 256, 256, 256 },
op_122_elements[] = { 250, 256, 256, 256 },
op_123_elements[] = { 251, 256, 256, 256 },
op_124_elements[] = { 252, 256, 256, 256 },
op_125_elements[] = { 253, 256, 256, 256 },
op_126_elements[] = { 254, 256, 256, 256 },
op_127_elements[] = { 255, 256, 256, 256 };
static const OCTETSTRING_template op_128(4, op_128_elements),
op_129(4, op_129_elements),
op_130(4, op_130_elements),
op_131(4, op_131_elements),
op_132(4, op_132_elements),
op_133(4, op_133_elements),
op_134(4, op_134_elements),
op_135(4, op_135_elements),
op_136(4, op_136_elements),
op_137(4, op_137_elements),
op_138(4, op_138_elements),
op_139(4, op_139_elements),
op_140(4, op_140_elements),
op_141(4, op_141_elements),
op_142(4, op_142_elements),
op_143(4, op_143_elements),
op_144(4, op_144_elements),
op_145(4, op_145_elements),
op_146(4, op_146_elements),
op_147(4, op_147_elements),
op_148(4, op_148_elements),
op_149(4, op_149_elements),
op_150(4, op_150_elements),
op_151(4, op_151_elements),
op_152(4, op_152_elements),
op_153(4, op_153_elements),
op_154(4, op_154_elements),
op_155(4, op_155_elements),
op_156(4, op_156_elements),
op_157(4, op_157_elements),
op_158(4, op_158_elements),
op_159(4, op_159_elements),
op_160(4, op_160_elements),
op_161(4, op_161_elements),
op_162(4, op_162_elements),
op_163(4, op_163_elements),
op_164(4, op_164_elements),
op_165(4, op_165_elements),
op_166(4, op_166_elements),
op_167(4, op_167_elements),
op_168(4, op_168_elements),
op_169(4, op_169_elements),
op_170(4, op_170_elements),
op_171(4, op_171_elements),
op_172(4, op_172_elements),
op_173(4, op_173_elements),
op_174(4, op_174_elements),
op_175(4, op_175_elements),
op_176(4, op_176_elements),
op_177(4, op_177_elements),
op_178(4, op_178_elements),
op_179(4, op_179_elements),
op_180(4, op_180_elements),
op_181(4, op_181_elements),
op_182(4, op_182_elements),
op_183(4, op_183_elements),
op_184(4, op_184_elements),
op_185(4, op_185_elements),
op_186(4, op_186_elements),
op_187(4, op_187_elements),
op_188(4, op_188_elements),
op_189(4, op_189_elements),
op_190(4, op_190_elements),
op_191(4, op_191_elements),
op_192(4, op_192_elements),
op_193(4, op_193_elements),
op_194(4, op_194_elements),
op_195(4, op_195_elements),
op_196(4, op_196_elements),
op_197(4, op_197_elements),
op_198(4, op_198_elements),
op_199(4, op_199_elements),
op_200(4, op_200_elements),
op_201(4, op_201_elements),
op_202(4, op_202_elements),
op_203(4, op_203_elements),
op_204(4, op_204_elements),
op_205(4, op_205_elements),
op_206(4, op_206_elements),
op_207(4, op_207_elements),
op_208(4, op_208_elements),
op_209(4, op_209_elements),
op_210(4, op_210_elements),
op_211(4, op_211_elements),
op_212(4, op_212_elements),
op_213(4, op_213_elements),
op_214(4, op_214_elements),
op_215(4, op_215_elements),
op_216(4, op_216_elements),
op_217(4, op_217_elements),
op_218(4, op_218_elements),
op_219(4, op_219_elements),
op_220(4, op_220_elements),
op_221(4, op_221_elements),
op_222(4, op_222_elements),
op_223(4, op_223_elements),
op_224(4, op_224_elements),
op_225(4, op_225_elements),
op_226(4, op_226_elements),
op_227(4, op_227_elements),
op_228(4, op_228_elements),
op_229(4, op_229_elements),
op_230(4, op_230_elements),
op_231(4, op_231_elements),
op_232(4, op_232_elements),
op_233(4, op_233_elements),
op_234(4, op_234_elements),
op_235(4, op_235_elements),
op_236(4, op_236_elements),
op_237(4, op_237_elements),
op_238(4, op_238_elements),
op_239(4, op_239_elements),
op_240(4, op_240_elements),
op_241(4, op_241_elements),
op_242(4, op_242_elements),
op_243(4, op_243_elements),
op_244(4, op_244_elements),
op_245(4, op_245_elements),
op_246(4, op_246_elements),
op_247(4, op_247_elements),
op_248(4, op_248_elements),
op_249(4, op_249_elements),
op_250(4, op_250_elements),
op_251(4, op_251_elements),
op_252(4, op_252_elements),
op_253(4, op_253_elements),
op_254(4, op_254_elements),
op_255(4, op_255_elements),
op_0(4, op_0_elements),
op_1(4, op_1_elements),
op_2(4, op_2_elements),
op_3(4, op_3_elements),
op_4(4, op_4_elements),
op_5(4, op_5_elements),
op_6(4, op_6_elements),
op_7(4, op_7_elements),
op_8(4, op_8_elements),
op_9(4, op_9_elements),
op_10(4, op_10_elements),
op_11(4, op_11_elements),
op_12(4, op_12_elements),
op_13(4, op_13_elements),
op_14(4, op_14_elements),
op_15(4, op_15_elements),
op_16(4, op_16_elements),
op_17(4, op_17_elements),
op_18(4, op_18_elements),
op_19(4, op_19_elements),
op_20(4, op_20_elements),
op_21(4, op_21_elements),
op_22(4, op_22_elements),
op_23(4, op_23_elements),
op_24(4, op_24_elements),
op_25(4, op_25_elements),
op_26(4, op_26_elements),
op_27(4, op_27_elements),
op_28(4, op_28_elements),
op_29(4, op_29_elements),
op_30(4, op_30_elements),
op_31(4, op_31_elements),
op_32(4, op_32_elements),
op_33(4, op_33_elements),
op_34(4, op_34_elements),
op_35(4, op_35_elements),
op_36(4, op_36_elements),
op_37(4, op_37_elements),
op_38(4, op_38_elements),
op_39(4, op_39_elements),
op_40(4, op_40_elements),
op_41(4, op_41_elements),
op_42(4, op_42_elements),
op_43(4, op_43_elements),
op_44(4, op_44_elements),
op_45(4, op_45_elements),
op_46(4, op_46_elements),
op_47(4, op_47_elements),
op_48(4, op_48_elements),
op_49(4, op_49_elements),
op_50(4, op_50_elements),
op_51(4, op_51_elements),
op_52(4, op_52_elements),
op_53(4, op_53_elements),
op_54(4, op_54_elements),
op_55(4, op_55_elements),
op_56(4, op_56_elements),
op_57(4, op_57_elements),
op_58(4, op_58_elements),
op_59(4, op_59_elements),
op_60(4, op_60_elements),
op_61(4, op_61_elements),
op_62(4, op_62_elements),
op_63(4, op_63_elements),
op_64(4, op_64_elements),
op_65(4, op_65_elements),
op_66(4, op_66_elements),
op_67(4, op_67_elements),
op_68(4, op_68_elements),
op_69(4, op_69_elements),
op_70(4, op_70_elements),
op_71(4, op_71_elements),
op_72(4, op_72_elements),
op_73(4, op_73_elements),
op_74(4, op_74_elements),
op_75(4, op_75_elements),
op_76(4, op_76_elements),
op_77(4, op_77_elements),
op_78(4, op_78_elements),
op_79(4, op_79_elements),
op_80(4, op_80_elements),
op_81(4, op_81_elements),
op_82(4, op_82_elements),
op_83(4, op_83_elements),
op_84(4, op_84_elements),
op_85(4, op_85_elements),
op_86(4, op_86_elements),
op_87(4, op_87_elements),
op_88(4, op_88_elements),
op_89(4, op_89_elements),
op_90(4, op_90_elements),
op_91(4, op_91_elements),
op_92(4, op_92_elements),
op_93(4, op_93_elements),
op_94(4, op_94_elements),
op_95(4, op_95_elements),
op_96(4, op_96_elements),
op_97(4, op_97_elements),
op_98(4, op_98_elements),
op_99(4, op_99_elements),
op_100(4, op_100_elements),
op_101(4, op_101_elements),
op_102(4, op_102_elements),
op_103(4, op_103_elements),
op_104(4, op_104_elements),
op_105(4, op_105_elements),
op_106(4, op_106_elements),
op_107(4, op_107_elements),
op_108(4, op_108_elements),
op_109(4, op_109_elements),
op_110(4, op_110_elements),
op_111(4, op_111_elements),
op_112(4, op_112_elements),
op_113(4, op_113_elements),
op_114(4, op_114_elements),
op_115(4, op_115_elements),
op_116(4, op_116_elements),
op_117(4, op_117_elements),
op_118(4, op_118_elements),
op_119(4, op_119_elements),
op_120(4, op_120_elements),
op_121(4, op_121_elements),
op_122(4, op_122_elements),
op_123(4, op_123_elements),
op_124(4, op_124_elements),
op_125(4, op_125_elements),
op_126(4, op_126_elements),
op_127(4, op_127_elements);
static const unsigned char module_checksum[] = { 0x53, 0x65, 0xa1, 0xba, 0x1c, 0x6d, 0x2a, 0xa6, 0xcc, 0xb6, 0x37, 0x4b, 0xb9, 0x1b, 0xae, 0xe1 };
/* Global variable definitions */
static OCTETSTRING const_CAN__EFF__FLAG;
const OCTETSTRING& CAN__EFF__FLAG = const_CAN__EFF__FLAG;
static OCTETSTRING const_CAN__RTR__FLAG;
const OCTETSTRING& CAN__RTR__FLAG = const_CAN__RTR__FLAG;
static OCTETSTRING const_CAN__ERR__FLAG;
const OCTETSTRING& CAN__ERR__FLAG = const_CAN__ERR__FLAG;
static OCTETSTRING const_CAN__SFF__MASK;
const OCTETSTRING& CAN__SFF__MASK = const_CAN__SFF__MASK;
static OCTETSTRING const_CAN__EFF__MASK;
const OCTETSTRING& CAN__EFF__MASK = const_CAN__EFF__MASK;
static OCTETSTRING const_CAN__ERR__MASK;
const OCTETSTRING& CAN__ERR__MASK = const_CAN__ERR__MASK;
static OCTETSTRING_template template_t__CAN__EFF__FLAG;
const OCTETSTRING_template& t__CAN__EFF__FLAG = template_t__CAN__EFF__FLAG;
static OCTETSTRING_template template_t__CAN__SFF__FLAG;
const OCTETSTRING_template& t__CAN__SFF__FLAG = template_t__CAN__SFF__FLAG;
static OCTETSTRING_template template_t__CAN__RTR__FLAG;
const OCTETSTRING_template& t__CAN__RTR__FLAG = template_t__CAN__RTR__FLAG;
static OCTETSTRING_template template_t__CAN__ERR__FLAG;
const OCTETSTRING_template& t__CAN__ERR__FLAG = template_t__CAN__ERR__FLAG;
// No XER for AdresseFamily__enum
const TTCN_Typedescriptor_t AdresseFamily__enum_descr_ = { "@Can.AdresseFamily_enum", NULL, NULL, NULL, NULL, &ENUMERATED_json_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
static INTEGER const_AF__CAN;
const INTEGER& AF__CAN = const_AF__CAN;
// No XER for ProtocolFamily__enum
const TTCN_Typedescriptor_t ProtocolFamily__enum_descr_ = { "@Can.ProtocolFamily_enum", NULL, NULL, NULL, NULL, &ENUMERATED_json_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for PF__CAN__protocols__enum
const TTCN_Typedescriptor_t PF__CAN__protocols__enum_descr_ = { "@Can.PF_CAN_protocols_enum", NULL, NULL, NULL, NULL, &ENUMERATED_json_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
static INTEGER const_CAN__MAX__DLEN;
const INTEGER& CAN__MAX__DLEN = const_CAN__MAX__DLEN;
static INTEGER const_CANFD__MAX__DLEN;
const INTEGER& CANFD__MAX__DLEN = const_CANFD__MAX__DLEN;
const TTCN_RAWdescriptor_t CAN__id_raw_ = {32,SG_NO,ORDER_LSB,ORDER_MSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
const XERdescriptor_t CAN__id_xer_ = { {"CAN_id>\n", "CAN_id>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int CAN__id_oer_ext_arr_[0] = {};
const int CAN__id_oer_p_[0] = {};
const TTCN_OERdescriptor_t CAN__id_oer_ = { -1, TRUE, 4, FALSE, 0, 0, CAN__id_oer_ext_arr_, 0, CAN__id_oer_p_};
const TTCN_Typedescriptor_t CAN__id_descr_ = { "@Can.CAN_id", &OCTETSTRING_ber_, &CAN__id_raw_, &OCTETSTRING_text_, &CAN__id_xer_, &OCTETSTRING_json_, &CAN__id_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const TTCN_RAWdescriptor_t CAN__flags_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN,NULL,false};
const XERdescriptor_t CAN__flags_xer_ = { {"CAN_flags>\n", "CAN_flags>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CAN__flags_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CAN__flags_descr_ = { "@Can.CAN_flags", &BITSTRING_ber_, &CAN__flags_raw_, NULL, &CAN__flags_xer_, &BITSTRING_json_, &CAN__flags_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t CAN__PDU_xer_ = { {"CAN_PDU>\n", "CAN_PDU>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int CAN__PDU_oer_ext_arr_[0] = {};
const int CAN__PDU_oer_p_[0] = {};
const TTCN_OERdescriptor_t CAN__PDU_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CAN__PDU_oer_ext_arr_, 0, CAN__PDU_oer_p_};
const TTCN_Typedescriptor_t CAN__PDU_descr_ = { "@Can.CAN_PDU", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &CAN__PDU_xer_, &OCTETSTRING_json_, &CAN__PDU_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t CAN__frame_can__id_xer_ = { {"can_id>\n", "can_id>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int CAN__frame_can__id_oer_ext_arr_[0] = {};
const int CAN__frame_can__id_oer_p_[0] = {};
const TTCN_OERdescriptor_t CAN__frame_can__id_oer_ = { -1, TRUE, 4, FALSE, 0, 0, CAN__frame_can__id_oer_ext_arr_, 0, CAN__frame_can__id_oer_p_};
const TTCN_Typedescriptor_t CAN__frame_can__id_descr_ = { "@Can.CAN_frame.can_id", &OCTETSTRING_ber_, &CAN__id_raw_, &OCTETSTRING_text_, &CAN__frame_can__id_xer_, &OCTETSTRING_json_, &CAN__frame_can__id_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t CAN__frame_can__pdu_xer_ = { {"can_pdu>\n", "can_pdu>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int CAN__frame_can__pdu_oer_ext_arr_[0] = {};
const int CAN__frame_can__pdu_oer_p_[0] = {};
const TTCN_OERdescriptor_t CAN__frame_can__pdu_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CAN__frame_can__pdu_oer_ext_arr_, 0, CAN__frame_can__pdu_oer_p_};
const TTCN_Typedescriptor_t CAN__frame_can__pdu_descr_ = { "@Can.CAN_frame.can_pdu", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &CAN__frame_can__pdu_xer_, &OCTETSTRING_json_, &CAN__frame_can__pdu_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for CAN__frame
const TTCN_Typedescriptor_t CAN__frame_descr_ = { "@Can.CAN_frame", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t CANFD__frame_can__id_xer_ = { {"can_id>\n", "can_id>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int CANFD__frame_can__id_oer_ext_arr_[0] = {};
const int CANFD__frame_can__id_oer_p_[0] = {};
const TTCN_OERdescriptor_t CANFD__frame_can__id_oer_ = { -1, TRUE, 4, FALSE, 0, 0, CANFD__frame_can__id_oer_ext_arr_, 0, CANFD__frame_can__id_oer_p_};
const TTCN_Typedescriptor_t CANFD__frame_can__id_descr_ = { "@Can.CANFD_frame.can_id", &OCTETSTRING_ber_, &CAN__id_raw_, &OCTETSTRING_text_, &CANFD__frame_can__id_xer_, &OCTETSTRING_json_, &CANFD__frame_can__id_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t CANFD__frame_can__flags_xer_ = { {"can_flags>\n", "can_flags>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CANFD__frame_can__flags_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CANFD__frame_can__flags_descr_ = { "@Can.CANFD_frame.can_flags", &BITSTRING_ber_, &CAN__flags_raw_, NULL, &CANFD__frame_can__flags_xer_, &BITSTRING_json_, &CANFD__frame_can__flags_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t CANFD__frame_can__pdu_xer_ = { {"can_pdu>\n", "can_pdu>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE, NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int CANFD__frame_can__pdu_oer_ext_arr_[0] = {};
const int CANFD__frame_can__pdu_oer_p_[0] = {};
const TTCN_OERdescriptor_t CANFD__frame_can__pdu_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CANFD__frame_can__pdu_oer_ext_arr_, 0, CANFD__frame_can__pdu_oer_p_};
const TTCN_Typedescriptor_t CANFD__frame_can__pdu_descr_ = { "@Can.CANFD_frame.can_pdu", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &CANFD__frame_can__pdu_xer_, &OCTETSTRING_json_, &CANFD__frame_can__pdu_oer_, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for CANFD__frame
const TTCN_Typedescriptor_t CANFD__frame_descr_ = { "@Can.CANFD_frame", NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
TTCN_Module module_object("Can", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
static const RuntimeVersionChecker ver_checker( current_runtime_version.requires_major_version_6,
current_runtime_version.requires_minor_version_6,
current_runtime_version.requires_patch_level_0, current_runtime_version.requires_runtime_1);
/* Member functions of C++ classes */
AdresseFamily__enum::AdresseFamily__enum()
{
enum_value = UNBOUND_VALUE;
}
AdresseFamily__enum::AdresseFamily__enum(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @Can.AdresseFamily_enum with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}
AdresseFamily__enum::AdresseFamily__enum(enum_type other_value)
{
enum_value = other_value;
}
AdresseFamily__enum::AdresseFamily__enum(const AdresseFamily__enum& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @Can.AdresseFamily_enum.");
enum_value = other_value.enum_value;
}
AdresseFamily__enum& AdresseFamily__enum::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @Can.AdresseFamily_enum.", other_value);
enum_value = (enum_type)other_value;
return *this;
}
AdresseFamily__enum& AdresseFamily__enum::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}
AdresseFamily__enum& AdresseFamily__enum::operator=(const AdresseFamily__enum& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Can.AdresseFamily_enum.");
enum_value = other_value.enum_value;
return *this;
}
boolean AdresseFamily__enum::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Can.AdresseFamily_enum.");
return enum_value == other_value;
}
boolean AdresseFamily__enum::operator==(const AdresseFamily__enum& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Can.AdresseFamily_enum.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Can.AdresseFamily_enum.");
return enum_value == other_value.enum_value;
}
boolean AdresseFamily__enum::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Can.AdresseFamily_enum.");
return enum_value < other_value;
}
boolean AdresseFamily__enum::operator<(const AdresseFamily__enum& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Can.AdresseFamily_enum.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Can.AdresseFamily_enum.");
return enum_value < other_value.enum_value;
}
boolean AdresseFamily__enum::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Can.AdresseFamily_enum.");
return enum_value > other_value;
}
boolean AdresseFamily__enum::operator>(const AdresseFamily__enum& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Can.AdresseFamily_enum.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Can.AdresseFamily_enum.");
return enum_value > other_value.enum_value;
}
const char *AdresseFamily__enum::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case PF__CAN: return "PF_CAN";
default: return "<unknown>";
}
}
AdresseFamily__enum::enum_type AdresseFamily__enum::str_to_enum(const char *str_par)
{
if (!strcmp(str_par, "PF_CAN")) return PF__CAN;
else return UNKNOWN_VALUE;
}
boolean AdresseFamily__enum::is_valid_enum(int int_par)
{
switch (int_par) {
case 29:
return TRUE;
default:
return FALSE;
}
}
int AdresseFamily__enum::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @Can.AdresseFamily_enum.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}
int AdresseFamily__enum::enum2int(const AdresseFamily__enum& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @Can.AdresseFamily_enum.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}
void AdresseFamily__enum::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @Can.AdresseFamily_enum.", int_val);
enum_value = (enum_type)int_val;
}
AdresseFamily__enum::operator AdresseFamily__enum::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @Can.AdresseFamily_enum.");
return enum_value;
}
void AdresseFamily__enum::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}
void AdresseFamily__enum::set_param(Module_Param& param)
{
param.basic_check(Module_Param::BC_VALUE, "enumerated value");
if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@Can.AdresseFamily_enum");
enum_value = str_to_enum(param.get_enumerated());
if (!is_valid_enum(enum_value)) {
param.error("Invalid enumerated value for type @Can.AdresseFamily_enum.");
}
}
void AdresseFamily__enum::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @Can.AdresseFamily_enum.");
text_buf.push_int(enum_value);
}
void AdresseFamily__enum::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @Can.AdresseFamily_enum.", enum_value);
}
void AdresseFamily__enum_template::copy_template(const AdresseFamily__enum_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new AdresseFamily__enum_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @Can.AdresseFamily_enum.");
}
}
AdresseFamily__enum_template::AdresseFamily__enum_template()
{
}
AdresseFamily__enum_template::AdresseFamily__enum_template(template_sel other_value)
: Base_Template(other_value)
{
check_single_selection(other_value);
}
AdresseFamily__enum_template::AdresseFamily__enum_template(int other_value)
: Base_Template(SPECIFIC_VALUE)
{
if (!AdresseFamily__enum::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @Can.AdresseFamily_enum with unknown numeric value %d.", other_value);
single_value = (AdresseFamily__enum::enum_type)other_value;
}
AdresseFamily__enum_template::AdresseFamily__enum_template(AdresseFamily__enum::enum_type other_value)
: Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}
AdresseFamily__enum_template::AdresseFamily__enum_template(const AdresseFamily__enum& other_value)
: Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == AdresseFamily__enum::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @Can.AdresseFamily_enum.");
single_value = other_value.enum_value;
}
AdresseFamily__enum_template::AdresseFamily__enum_template(const OPTIONAL<AdresseFamily__enum>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AdresseFamily__enum::enum_type)(const AdresseFamily__enum&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @Can.AdresseFamily_enum from an unbound optional field.");
}
}
AdresseFamily__enum_template::AdresseFamily__enum_template(const AdresseFamily__enum_template& other_value)
: Base_Template()
{
copy_template(other_value);
}
AdresseFamily__enum_template::~AdresseFamily__enum_template()
{
clean_up();
}
boolean AdresseFamily__enum_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}
boolean AdresseFamily__enum_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != AdresseFamily__enum::UNBOUND_VALUE;
}
void AdresseFamily__enum_template::clean_up()
{
if (template_selection == VALUE_LIST || template_selection == COMPLEMENTED_LIST) delete [] value_list.list_value;
template_selection = UNINITIALIZED_TEMPLATE;
}
AdresseFamily__enum_template& AdresseFamily__enum_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}
AdresseFamily__enum_template& AdresseFamily__enum_template::operator=(int other_value)
{
if (!AdresseFamily__enum::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @Can.AdresseFamily_enum.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (AdresseFamily__enum::enum_type)other_value;
return *this;
}
AdresseFamily__enum_template& AdresseFamily__enum_template::operator=(AdresseFamily__enum::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}
AdresseFamily__enum_template& AdresseFamily__enum_template::operator=(const AdresseFamily__enum& other_value)
{
if (other_value.enum_value == AdresseFamily__enum::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Can.AdresseFamily_enum to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}
AdresseFamily__enum_template& AdresseFamily__enum_template::operator=(const OPTIONAL<AdresseFamily__enum>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (AdresseFamily__enum::enum_type)(const AdresseFamily__enum&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @Can.AdresseFamily_enum.");
}
return *this;
}
AdresseFamily__enum_template& AdresseFamily__enum_template::operator=(const AdresseFamily__enum_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}
boolean AdresseFamily__enum_template::match(AdresseFamily__enum::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @Can.AdresseFamily_enum.");
}
return FALSE;
}
boolean AdresseFamily__enum_template::match(const AdresseFamily__enum& other_value, boolean) const
{
if (other_value.enum_value == AdresseFamily__enum::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @Can.AdresseFamily_enum with an unbound value.");
return match(other_value.enum_value);
}
AdresseFamily__enum::enum_type AdresseFamily__enum_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @Can.AdresseFamily_enum.");
return single_value;
}
void AdresseFamily__enum_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST) TTCN_error("Setting an invalid list type for a template of enumerated type @Can.AdresseFamily_enum.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new AdresseFamily__enum_template[list_length];
}
AdresseFamily__enum_template& AdresseFamily__enum_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST) TTCN_error("Accessing a list element in a non-list template of enumerated type @Can.AdresseFamily_enum.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @Can.AdresseFamily_enum.");
return value_list.list_value[list_index];
}
void AdresseFamily__enum_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(AdresseFamily__enum::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
default:
log_generic();
}
log_ifpresent();
}
void AdresseFamily__enum_template::log_match(const AdresseFamily__enum& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
void AdresseFamily__enum_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @Can.AdresseFamily_enum.");
}
}
void AdresseFamily__enum_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (AdresseFamily__enum::enum_type)text_buf.pull_int().get_val();
if (!AdresseFamily__enum::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @Can.AdresseFamily_enum.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new AdresseFamily__enum_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @Can.AdresseFamily_enum.");
}
}
boolean AdresseFamily__enum_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}
boolean AdresseFamily__enum_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}
void AdresseFamily__enum_template::set_param(Module_Param& param)
{
param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
Module_Param_Ptr m_p = &param;
switch (m_p->get_type()) {
case Module_Param::MP_Omit:
*this = OMIT_VALUE;
break;
case Module_Param::MP_Any:
*this = ANY_VALUE;
break;
case Module_Param::MP_AnyOrNone:
*this = ANY_OR_OMIT;
break;
case Module_Param::MP_List_Template:
case Module_Param::MP_ComplementList_Template: {
AdresseFamily__enum_template new_temp;
new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : COMPLEMENTED_LIST, m_p->get_size());
for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
}
*this = new_temp;
break; }
case Module_Param::MP_Enumerated: {
AdresseFamily__enum::enum_type enum_val = AdresseFamily__enum::str_to_enum(m_p->get_enumerated());
if (!AdresseFamily__enum::is_valid_enum(enum_val)) {
param.error("Invalid enumerated value for type @Can.AdresseFamily_enum.");
}
*this = enum_val;
} break;
default:
param.type_error("enumerated template", "@Can.AdresseFamily_enum");
}
is_ifpresent = param.get_ifpresent();
}
void AdresseFamily__enum_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@Can.AdresseFamily_enum");
}
ProtocolFamily__enum::ProtocolFamily__enum()
{
enum_value = UNBOUND_VALUE;
}
ProtocolFamily__enum::ProtocolFamily__enum(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @Can.ProtocolFamily_enum with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}
ProtocolFamily__enum::ProtocolFamily__enum(enum_type other_value)
{
enum_value = other_value;
}
ProtocolFamily__enum::ProtocolFamily__enum(const ProtocolFamily__enum& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @Can.ProtocolFamily_enum.");
enum_value = other_value.enum_value;
}
ProtocolFamily__enum& ProtocolFamily__enum::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @Can.ProtocolFamily_enum.", other_value);
enum_value = (enum_type)other_value;
return *this;
}
ProtocolFamily__enum& ProtocolFamily__enum::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}
ProtocolFamily__enum& ProtocolFamily__enum::operator=(const ProtocolFamily__enum& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Can.ProtocolFamily_enum.");
enum_value = other_value.enum_value;
return *this;
}
boolean ProtocolFamily__enum::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Can.ProtocolFamily_enum.");
return enum_value == other_value;
}
boolean ProtocolFamily__enum::operator==(const ProtocolFamily__enum& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Can.ProtocolFamily_enum.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Can.ProtocolFamily_enum.");
return enum_value == other_value.enum_value;
}
boolean ProtocolFamily__enum::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Can.ProtocolFamily_enum.");
return enum_value < other_value;
}
boolean ProtocolFamily__enum::operator<(const ProtocolFamily__enum& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Can.ProtocolFamily_enum.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Can.ProtocolFamily_enum.");
return enum_value < other_value.enum_value;
}
boolean ProtocolFamily__enum::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Can.ProtocolFamily_enum.");
return enum_value > other_value;
}
boolean ProtocolFamily__enum::operator>(const ProtocolFamily__enum& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Can.ProtocolFamily_enum.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Can.ProtocolFamily_enum.");
return enum_value > other_value.enum_value;
}
const char *ProtocolFamily__enum::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case SOCK__DGRAM: return "SOCK_DGRAM";
case SOCK__RAW: return "SOCK_RAW";
default: return "<unknown>";
}
}
ProtocolFamily__enum::enum_type ProtocolFamily__enum::str_to_enum(const char *str_par)
{
if (!strcmp(str_par, "SOCK_DGRAM")) return SOCK__DGRAM;
else if (!strcmp(str_par, "SOCK_RAW")) return SOCK__RAW;
else return UNKNOWN_VALUE;
}
boolean ProtocolFamily__enum::is_valid_enum(int int_par)
{
switch (int_par) {
case 2:
case 3:
return TRUE;
default:
return FALSE;
}
}
int ProtocolFamily__enum::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @Can.ProtocolFamily_enum.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}
int ProtocolFamily__enum::enum2int(const ProtocolFamily__enum& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @Can.ProtocolFamily_enum.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}
void ProtocolFamily__enum::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @Can.ProtocolFamily_enum.", int_val);
enum_value = (enum_type)int_val;
}
ProtocolFamily__enum::operator ProtocolFamily__enum::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @Can.ProtocolFamily_enum.");
return enum_value;
}
void ProtocolFamily__enum::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}
void ProtocolFamily__enum::set_param(Module_Param& param)
{
param.basic_check(Module_Param::BC_VALUE, "enumerated value");
if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@Can.ProtocolFamily_enum");
enum_value = str_to_enum(param.get_enumerated());
if (!is_valid_enum(enum_value)) {
param.error("Invalid enumerated value for type @Can.ProtocolFamily_enum.");
}
}
void ProtocolFamily__enum::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @Can.ProtocolFamily_enum.");
text_buf.push_int(enum_value);
}
void ProtocolFamily__enum::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @Can.ProtocolFamily_enum.", enum_value);
}
void ProtocolFamily__enum_template::copy_template(const ProtocolFamily__enum_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new ProtocolFamily__enum_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @Can.ProtocolFamily_enum.");
}
}
ProtocolFamily__enum_template::ProtocolFamily__enum_template()
{
}
ProtocolFamily__enum_template::ProtocolFamily__enum_template(template_sel other_value)
: Base_Template(other_value)
{
check_single_selection(other_value);
}
ProtocolFamily__enum_template::ProtocolFamily__enum_template(int other_value)
: Base_Template(SPECIFIC_VALUE)
{
if (!ProtocolFamily__enum::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @Can.ProtocolFamily_enum with unknown numeric value %d.", other_value);
single_value = (ProtocolFamily__enum::enum_type)other_value;
}
ProtocolFamily__enum_template::ProtocolFamily__enum_template(ProtocolFamily__enum::enum_type other_value)
: Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}
ProtocolFamily__enum_template::ProtocolFamily__enum_template(const ProtocolFamily__enum& other_value)
: Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == ProtocolFamily__enum::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @Can.ProtocolFamily_enum.");
single_value = other_value.enum_value;
}
ProtocolFamily__enum_template::ProtocolFamily__enum_template(const OPTIONAL<ProtocolFamily__enum>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (ProtocolFamily__enum::enum_type)(const ProtocolFamily__enum&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @Can.ProtocolFamily_enum from an unbound optional field.");
}
}
ProtocolFamily__enum_template::ProtocolFamily__enum_template(const ProtocolFamily__enum_template& other_value)
: Base_Template()
{
copy_template(other_value);
}
ProtocolFamily__enum_template::~ProtocolFamily__enum_template()
{
clean_up();
}
boolean ProtocolFamily__enum_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}
boolean ProtocolFamily__enum_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != ProtocolFamily__enum::UNBOUND_VALUE;
}
void ProtocolFamily__enum_template::clean_up()
{
if (template_selection == VALUE_LIST || template_selection == COMPLEMENTED_LIST) delete [] value_list.list_value;
template_selection = UNINITIALIZED_TEMPLATE;
}
ProtocolFamily__enum_template& ProtocolFamily__enum_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}
ProtocolFamily__enum_template& ProtocolFamily__enum_template::operator=(int other_value)
{
if (!ProtocolFamily__enum::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @Can.ProtocolFamily_enum.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (ProtocolFamily__enum::enum_type)other_value;
return *this;
}
ProtocolFamily__enum_template& ProtocolFamily__enum_template::operator=(ProtocolFamily__enum::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}
ProtocolFamily__enum_template& ProtocolFamily__enum_template::operator=(const ProtocolFamily__enum& other_value)
{
if (other_value.enum_value == ProtocolFamily__enum::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Can.ProtocolFamily_enum to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}
ProtocolFamily__enum_template& ProtocolFamily__enum_template::operator=(const OPTIONAL<ProtocolFamily__enum>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (ProtocolFamily__enum::enum_type)(const ProtocolFamily__enum&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @Can.ProtocolFamily_enum.");
}
return *this;
}
ProtocolFamily__enum_template& ProtocolFamily__enum_template::operator=(const ProtocolFamily__enum_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}
boolean ProtocolFamily__enum_template::match(ProtocolFamily__enum::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @Can.ProtocolFamily_enum.");
}
return FALSE;
}
boolean ProtocolFamily__enum_template::match(const ProtocolFamily__enum& other_value, boolean) const
{
if (other_value.enum_value == ProtocolFamily__enum::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @Can.ProtocolFamily_enum with an unbound value.");
return match(other_value.enum_value);
}
ProtocolFamily__enum::enum_type ProtocolFamily__enum_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @Can.ProtocolFamily_enum.");
return single_value;
}
void ProtocolFamily__enum_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST) TTCN_error("Setting an invalid list type for a template of enumerated type @Can.ProtocolFamily_enum.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ProtocolFamily__enum_template[list_length];
}
ProtocolFamily__enum_template& ProtocolFamily__enum_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST) TTCN_error("Accessing a list element in a non-list template of enumerated type @Can.ProtocolFamily_enum.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @Can.ProtocolFamily_enum.");
return value_list.list_value[list_index];
}
void ProtocolFamily__enum_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(ProtocolFamily__enum::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
default:
log_generic();
}
log_ifpresent();
}
void ProtocolFamily__enum_template::log_match(const ProtocolFamily__enum& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
void ProtocolFamily__enum_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @Can.ProtocolFamily_enum.");
}
}
void ProtocolFamily__enum_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (ProtocolFamily__enum::enum_type)text_buf.pull_int().get_val();
if (!ProtocolFamily__enum::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @Can.ProtocolFamily_enum.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new ProtocolFamily__enum_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @Can.ProtocolFamily_enum.");
}
}
boolean ProtocolFamily__enum_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}
boolean ProtocolFamily__enum_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}
void ProtocolFamily__enum_template::set_param(Module_Param& param)
{
param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
Module_Param_Ptr m_p = &param;
switch (m_p->get_type()) {
case Module_Param::MP_Omit:
*this = OMIT_VALUE;
break;
case Module_Param::MP_Any:
*this = ANY_VALUE;
break;
case Module_Param::MP_AnyOrNone:
*this = ANY_OR_OMIT;
break;
case Module_Param::MP_List_Template:
case Module_Param::MP_ComplementList_Template: {
ProtocolFamily__enum_template new_temp;
new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : COMPLEMENTED_LIST, m_p->get_size());
for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
}
*this = new_temp;
break; }
case Module_Param::MP_Enumerated: {
ProtocolFamily__enum::enum_type enum_val = ProtocolFamily__enum::str_to_enum(m_p->get_enumerated());
if (!ProtocolFamily__enum::is_valid_enum(enum_val)) {
param.error("Invalid enumerated value for type @Can.ProtocolFamily_enum.");
}
*this = enum_val;
} break;
default:
param.type_error("enumerated template", "@Can.ProtocolFamily_enum");
}
is_ifpresent = param.get_ifpresent();
}
void ProtocolFamily__enum_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@Can.ProtocolFamily_enum");
}
PF__CAN__protocols__enum::PF__CAN__protocols__enum()
{
enum_value = UNBOUND_VALUE;
}
PF__CAN__protocols__enum::PF__CAN__protocols__enum(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @Can.PF_CAN_protocols_enum with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}
PF__CAN__protocols__enum::PF__CAN__protocols__enum(enum_type other_value)
{
enum_value = other_value;
}
PF__CAN__protocols__enum::PF__CAN__protocols__enum(const PF__CAN__protocols__enum& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @Can.PF_CAN_protocols_enum.");
enum_value = other_value.enum_value;
}
PF__CAN__protocols__enum& PF__CAN__protocols__enum::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @Can.PF_CAN_protocols_enum.", other_value);
enum_value = (enum_type)other_value;
return *this;
}
PF__CAN__protocols__enum& PF__CAN__protocols__enum::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}
PF__CAN__protocols__enum& PF__CAN__protocols__enum::operator=(const PF__CAN__protocols__enum& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Can.PF_CAN_protocols_enum.");
enum_value = other_value.enum_value;
return *this;
}
boolean PF__CAN__protocols__enum::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Can.PF_CAN_protocols_enum.");
return enum_value == other_value;
}
boolean PF__CAN__protocols__enum::operator==(const PF__CAN__protocols__enum& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Can.PF_CAN_protocols_enum.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Can.PF_CAN_protocols_enum.");
return enum_value == other_value.enum_value;
}
boolean PF__CAN__protocols__enum::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Can.PF_CAN_protocols_enum.");
return enum_value < other_value;
}
boolean PF__CAN__protocols__enum::operator<(const PF__CAN__protocols__enum& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Can.PF_CAN_protocols_enum.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Can.PF_CAN_protocols_enum.");
return enum_value < other_value.enum_value;
}
boolean PF__CAN__protocols__enum::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Can.PF_CAN_protocols_enum.");
return enum_value > other_value;
}
boolean PF__CAN__protocols__enum::operator>(const PF__CAN__protocols__enum& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Can.PF_CAN_protocols_enum.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Can.PF_CAN_protocols_enum.");
return enum_value > other_value.enum_value;
}
const char *PF__CAN__protocols__enum::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case CAN__RAW: return "CAN_RAW";
case CAN__BCM: return "CAN_BCM";
case CAN__TP16: return "CAN_TP16";
case CAN__TP20: return "CAN_TP20";
case CAN__MCNET: return "CAN_MCNET";
case CAN__ISOTP: return "CAN_ISOTP";
case CAN__NPROTO: return "CAN_NPROTO";
default: return "<unknown>";
}
}
PF__CAN__protocols__enum::enum_type PF__CAN__protocols__enum::str_to_enum(const char *str_par)
{
if (!strcmp(str_par, "CAN_RAW")) return CAN__RAW;
else if (!strcmp(str_par, "CAN_BCM")) return CAN__BCM;
else if (!strcmp(str_par, "CAN_TP16")) return CAN__TP16;
else if (!strcmp(str_par, "CAN_TP20")) return CAN__TP20;
else if (!strcmp(str_par, "CAN_MCNET")) return CAN__MCNET;
else if (!strcmp(str_par, "CAN_ISOTP")) return CAN__ISOTP;
else if (!strcmp(str_par, "CAN_NPROTO")) return CAN__NPROTO;
else return UNKNOWN_VALUE;
}
boolean PF__CAN__protocols__enum::is_valid_enum(int int_par)
{
switch (int_par) {
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
return TRUE;
default:
return FALSE;
}
}
int PF__CAN__protocols__enum::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @Can.PF_CAN_protocols_enum.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}
int PF__CAN__protocols__enum::enum2int(const PF__CAN__protocols__enum& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @Can.PF_CAN_protocols_enum.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}
void PF__CAN__protocols__enum::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @Can.PF_CAN_protocols_enum.", int_val);
enum_value = (enum_type)int_val;
}
PF__CAN__protocols__enum::operator PF__CAN__protocols__enum::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @Can.PF_CAN_protocols_enum.");
return enum_value;
}
void PF__CAN__protocols__enum::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}
void PF__CAN__protocols__enum::set_param(Module_Param& param)
{
param.basic_check(Module_Param::BC_VALUE, "enumerated value");
if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@Can.PF_CAN_protocols_enum");
enum_value = str_to_enum(param.get_enumerated());
if (!is_valid_enum(enum_value)) {
param.error("Invalid enumerated value for type @Can.PF_CAN_protocols_enum.");
}
}
void PF__CAN__protocols__enum::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @Can.PF_CAN_protocols_enum.");
text_buf.push_int(enum_value);
}
void PF__CAN__protocols__enum::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @Can.PF_CAN_protocols_enum.", enum_value);
}
void PF__CAN__protocols__enum_template::copy_template(const PF__CAN__protocols__enum_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PF__CAN__protocols__enum_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @Can.PF_CAN_protocols_enum.");
}
}
PF__CAN__protocols__enum_template::PF__CAN__protocols__enum_template()
{
}
PF__CAN__protocols__enum_template::PF__CAN__protocols__enum_template(template_sel other_value)
: Base_Template(other_value)
{
check_single_selection(other_value);
}
PF__CAN__protocols__enum_template::PF__CAN__protocols__enum_template(int other_value)
: Base_Template(SPECIFIC_VALUE)
{
if (!PF__CAN__protocols__enum::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @Can.PF_CAN_protocols_enum with unknown numeric value %d.", other_value);
single_value = (PF__CAN__protocols__enum::enum_type)other_value;
}
PF__CAN__protocols__enum_template::PF__CAN__protocols__enum_template(PF__CAN__protocols__enum::enum_type other_value)
: Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}
PF__CAN__protocols__enum_template::PF__CAN__protocols__enum_template(const PF__CAN__protocols__enum& other_value)
: Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == PF__CAN__protocols__enum::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @Can.PF_CAN_protocols_enum.");
single_value = other_value.enum_value;
}
PF__CAN__protocols__enum_template::PF__CAN__protocols__enum_template(const OPTIONAL<PF__CAN__protocols__enum>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PF__CAN__protocols__enum::enum_type)(const PF__CAN__protocols__enum&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @Can.PF_CAN_protocols_enum from an unbound optional field.");
}
}
PF__CAN__protocols__enum_template::PF__CAN__protocols__enum_template(const PF__CAN__protocols__enum_template& other_value)
: Base_Template()
{
copy_template(other_value);
}
PF__CAN__protocols__enum_template::~PF__CAN__protocols__enum_template()
{
clean_up();
}
boolean PF__CAN__protocols__enum_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}
boolean PF__CAN__protocols__enum_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != PF__CAN__protocols__enum::UNBOUND_VALUE;
}
void PF__CAN__protocols__enum_template::clean_up()
{
if (template_selection == VALUE_LIST || template_selection == COMPLEMENTED_LIST) delete [] value_list.list_value;
template_selection = UNINITIALIZED_TEMPLATE;
}
PF__CAN__protocols__enum_template& PF__CAN__protocols__enum_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}
PF__CAN__protocols__enum_template& PF__CAN__protocols__enum_template::operator=(int other_value)
{
if (!PF__CAN__protocols__enum::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @Can.PF_CAN_protocols_enum.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (PF__CAN__protocols__enum::enum_type)other_value;
return *this;
}
PF__CAN__protocols__enum_template& PF__CAN__protocols__enum_template::operator=(PF__CAN__protocols__enum::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}
PF__CAN__protocols__enum_template& PF__CAN__protocols__enum_template::operator=(const PF__CAN__protocols__enum& other_value)
{
if (other_value.enum_value == PF__CAN__protocols__enum::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Can.PF_CAN_protocols_enum to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}
PF__CAN__protocols__enum_template& PF__CAN__protocols__enum_template::operator=(const OPTIONAL<PF__CAN__protocols__enum>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (PF__CAN__protocols__enum::enum_type)(const PF__CAN__protocols__enum&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @Can.PF_CAN_protocols_enum.");
}
return *this;
}
PF__CAN__protocols__enum_template& PF__CAN__protocols__enum_template::operator=(const PF__CAN__protocols__enum_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}
boolean PF__CAN__protocols__enum_template::match(PF__CAN__protocols__enum::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @Can.PF_CAN_protocols_enum.");
}
return FALSE;
}
boolean PF__CAN__protocols__enum_template::match(const PF__CAN__protocols__enum& other_value, boolean) const
{
if (other_value.enum_value == PF__CAN__protocols__enum::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @Can.PF_CAN_protocols_enum with an unbound value.");
return match(other_value.enum_value);
}
PF__CAN__protocols__enum::enum_type PF__CAN__protocols__enum_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @Can.PF_CAN_protocols_enum.");
return single_value;
}
void PF__CAN__protocols__enum_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST) TTCN_error("Setting an invalid list type for a template of enumerated type @Can.PF_CAN_protocols_enum.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PF__CAN__protocols__enum_template[list_length];
}
PF__CAN__protocols__enum_template& PF__CAN__protocols__enum_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST) TTCN_error("Accessing a list element in a non-list template of enumerated type @Can.PF_CAN_protocols_enum.");
if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @Can.PF_CAN_protocols_enum.");
return value_list.list_value[list_index];
}
void PF__CAN__protocols__enum_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_enum(PF__CAN__protocols__enum::enum_to_str(single_value), single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[elem_count].log();
}
TTCN_Logger::log_char(')');
break;
default:
log_generic();
}
log_ifpresent();
}
void PF__CAN__protocols__enum_template::log_match(const PF__CAN__protocols__enum& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
void PF__CAN__protocols__enum_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @Can.PF_CAN_protocols_enum.");
}
}
void PF__CAN__protocols__enum_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (PF__CAN__protocols__enum::enum_type)text_buf.pull_int().get_val();
if (!PF__CAN__protocols__enum::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @Can.PF_CAN_protocols_enum.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PF__CAN__protocols__enum_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @Can.PF_CAN_protocols_enum.");
}
}
boolean PF__CAN__protocols__enum_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}
boolean PF__CAN__protocols__enum_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}
void PF__CAN__protocols__enum_template::set_param(Module_Param& param)
{
param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
Module_Param_Ptr m_p = &param;
switch (m_p->get_type()) {
case Module_Param::MP_Omit:
*this = OMIT_VALUE;
break;
case Module_Param::MP_Any:
*this = ANY_VALUE;
break;
case Module_Param::MP_AnyOrNone:
*this = ANY_OR_OMIT;
break;
case Module_Param::MP_List_Template:
case Module_Param::MP_ComplementList_Template: {
PF__CAN__protocols__enum_template new_temp;
new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : COMPLEMENTED_LIST, m_p->get_size());
for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
}
*this = new_temp;
break; }
case Module_Param::MP_Enumerated: {
PF__CAN__protocols__enum::enum_type enum_val = PF__CAN__protocols__enum::str_to_enum(m_p->get_enumerated());
if (!PF__CAN__protocols__enum::is_valid_enum(enum_val)) {
param.error("Invalid enumerated value for type @Can.PF_CAN_protocols_enum.");
}
*this = enum_val;
} break;
default:
param.type_error("enumerated template", "@Can.PF_CAN_protocols_enum");
}
is_ifpresent = param.get_ifpresent();
}
void PF__CAN__protocols__enum_template::check_restriction(template_res t_res, const char* t_name,
boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@Can.PF_CAN_protocols_enum");
}
CAN__frame::CAN__frame()
{
}
CAN__frame::CAN__frame(const OCTETSTRING& par_can__id,
const OCTETSTRING& par_can__pdu)
: field_can__id(par_can__id),
field_can__pdu(par_can__pdu)
{
}
CAN__frame::CAN__frame(const CAN__frame& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @Can.CAN_frame.");
if (other_value.can__id().is_bound()) field_can__id = other_value.can__id();
else field_can__id.clean_up();
if (other_value.can__pdu().is_bound()) field_can__pdu = other_value.can__pdu();
else field_can__pdu.clean_up();
}
void CAN__frame::clean_up()
{
field_can__id.clean_up();
field_can__pdu.clean_up();
}
const TTCN_Typedescriptor_t* CAN__frame::get_descriptor() const { return &CAN__frame_descr_; }
CAN__frame& CAN__frame::operator=(const CAN__frame& other_value)
{
if (this != &other_value) {
if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @Can.CAN_frame.");
if (other_value.can__id().is_bound()) field_can__id = other_value.can__id();
else field_can__id.clean_up();
if (other_value.can__pdu().is_bound()) field_can__pdu = other_value.can__pdu();
else field_can__pdu.clean_up();
}
return *this;
}
boolean CAN__frame::operator==(const CAN__frame& other_value) const
{
return field_can__id==other_value.field_can__id
&& field_can__pdu==other_value.field_can__pdu;
}
boolean CAN__frame::is_bound() const
{
return (field_can__id.is_bound())
|| (field_can__pdu.is_bound());
}
boolean CAN__frame::is_value() const
{
return field_can__id.is_value()
&& field_can__pdu.is_value();
}
void CAN__frame::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ can_id := ");
field_can__id.log();
TTCN_Logger::log_event_str(", can_pdu := ");
field_can__pdu.log();
TTCN_Logger::log_event_str(" }");
}
void CAN__frame::set_param(Module_Param& param)
{
param.basic_check(Module_Param::BC_VALUE, "record value");
switch (param.get_type()) {
case Module_Param::MP_Value_List:
if (2<param.get_size()) {
param.error("record value of type @Can.CAN_frame has 2 fields but list value has %d fields", (int)param.get_size());
}
if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) can__id().set_param(*param.get_elem(0));
if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) can__pdu().set_param(*param.get_elem(1));
break;
case Module_Param::MP_Assignment_List: {
Vector<bool> value_used(param.get_size());
value_used.resize(param.get_size(), FALSE);
for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
Module_Param* const curr_param = param.get_elem(val_idx);
if (!strcmp(curr_param->get_id()->get_name(), "can_id")) {
if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
can__id().set_param(*curr_param);
}
value_used[val_idx]=TRUE;
}
}
for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
Module_Param* const curr_param = param.get_elem(val_idx);
if (!strcmp(curr_param->get_id()->get_name(), "can_pdu")) {
if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
can__pdu().set_param(*curr_param);
}
value_used[val_idx]=TRUE;
}
}
for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
Module_Param* const curr_param = param.get_elem(val_idx);
curr_param->error("Non existent field name in type @Can.CAN_frame: %s", curr_param->get_id()->get_name());
break;
}
} break;
default:
param.type_error("record value", "@Can.CAN_frame");
}
}
void CAN__frame::set_implicit_omit()
{
if (can__id().is_bound()) can__id().set_implicit_omit();
if (can__pdu().is_bound()) can__pdu().set_implicit_omit();
}
void CAN__frame::encode_text(Text_Buf& text_buf