|
25 | 25 |
|
26 | 26 | using namespace code::generation::test; |
27 | 27 |
|
28 | | -constexpr const char *SCHEMA_FILENAME = "code-generation-schema.sbeir"; |
29 | | - |
30 | | -constexpr std::uint8_t fieldIdSerialNumber = 1; |
31 | | -constexpr std::uint8_t fieldIdModelYear = 2; |
32 | | -constexpr std::uint8_t fieldIdAvailable = 3; |
33 | | -constexpr std::uint8_t fieldIdCode = 4; |
34 | | -constexpr std::uint8_t fieldIdSomeNumbers = 5; |
35 | | -constexpr std::uint8_t fieldIdVehicleCode = 6; |
36 | | -constexpr std::uint8_t fieldIdExtras = 7; |
37 | | -constexpr std::uint8_t fieldIdDiscountedModel = 8; |
38 | | -constexpr std::uint8_t fieldIdEngine = 9; |
39 | | -constexpr std::uint8_t fieldIdFuelFigures = 10; |
40 | | -constexpr std::uint8_t fieldIdFuelSpeed = 11; |
41 | | -constexpr std::uint8_t fieldIdFuelMpg = 12; |
42 | | -constexpr std::uint8_t fieldIdFuelUsageDescription = 200; |
43 | | -constexpr std::uint8_t fieldIdPerformanceFigures = 13; |
44 | | -constexpr std::uint8_t fieldIdPerfOctaneRating = 14; |
45 | | -constexpr std::uint8_t fieldIdPerfAcceleration = 15; |
46 | | -constexpr std::uint8_t fieldIdPerfAccMph = 16; |
47 | | -constexpr std::uint8_t fieldIdPerfAccSeconds = 17; |
48 | | -constexpr std::uint8_t fieldIdManufacturer = 18; |
49 | | -constexpr std::uint8_t fieldIdModel = 19; |
50 | | -constexpr std::uint8_t fieldIdActivationCode = 20; |
51 | | -constexpr std::uint8_t fieldIdColor = 21; |
52 | | - |
53 | | -constexpr std::uint32_t SERIAL_NUMBER = 1234; |
54 | | -constexpr std::uint16_t MODEL_YEAR = 2013; |
55 | | -constexpr BooleanType::Value AVAILABLE = BooleanType::T; |
56 | | -constexpr Model::Value CODE = Model::A; |
57 | | -constexpr bool CRUISE_CONTROL = true; |
58 | | -constexpr bool SPORTS_PACK = true; |
59 | | -constexpr bool SUNROOF = false; |
| 28 | +SBE_CONSTEXPR const char *SCHEMA_FILENAME = "code-generation-schema.sbeir"; |
| 29 | + |
| 30 | +SBE_CONSTEXPR std::uint8_t fieldIdSerialNumber = 1; |
| 31 | +SBE_CONSTEXPR std::uint8_t fieldIdModelYear = 2; |
| 32 | +SBE_CONSTEXPR std::uint8_t fieldIdAvailable = 3; |
| 33 | +SBE_CONSTEXPR std::uint8_t fieldIdCode = 4; |
| 34 | +SBE_CONSTEXPR std::uint8_t fieldIdSomeNumbers = 5; |
| 35 | +SBE_CONSTEXPR std::uint8_t fieldIdVehicleCode = 6; |
| 36 | +SBE_CONSTEXPR std::uint8_t fieldIdExtras = 7; |
| 37 | +SBE_CONSTEXPR std::uint8_t fieldIdDiscountedModel = 8; |
| 38 | +SBE_CONSTEXPR std::uint8_t fieldIdEngine = 9; |
| 39 | +SBE_CONSTEXPR std::uint8_t fieldIdFuelFigures = 10; |
| 40 | +SBE_CONSTEXPR std::uint8_t fieldIdFuelSpeed = 11; |
| 41 | +SBE_CONSTEXPR std::uint8_t fieldIdFuelMpg = 12; |
| 42 | +SBE_CONSTEXPR std::uint8_t fieldIdFuelUsageDescription = 200; |
| 43 | +SBE_CONSTEXPR std::uint8_t fieldIdPerformanceFigures = 13; |
| 44 | +SBE_CONSTEXPR std::uint8_t fieldIdPerfOctaneRating = 14; |
| 45 | +SBE_CONSTEXPR std::uint8_t fieldIdPerfAcceleration = 15; |
| 46 | +SBE_CONSTEXPR std::uint8_t fieldIdPerfAccMph = 16; |
| 47 | +SBE_CONSTEXPR std::uint8_t fieldIdPerfAccSeconds = 17; |
| 48 | +SBE_CONSTEXPR std::uint8_t fieldIdManufacturer = 18; |
| 49 | +SBE_CONSTEXPR std::uint8_t fieldIdModel = 19; |
| 50 | +SBE_CONSTEXPR std::uint8_t fieldIdActivationCode = 20; |
| 51 | +SBE_CONSTEXPR std::uint8_t fieldIdColor = 21; |
| 52 | + |
| 53 | +SBE_CONSTEXPR std::uint32_t SERIAL_NUMBER = 1234; |
| 54 | +SBE_CONSTEXPR std::uint16_t MODEL_YEAR = 2013; |
| 55 | +SBE_CONSTEXPR BooleanType::Value AVAILABLE = BooleanType::T; |
| 56 | +SBE_CONSTEXPR Model::Value CODE = Model::A; |
| 57 | +SBE_CONSTEXPR bool CRUISE_CONTROL = true; |
| 58 | +SBE_CONSTEXPR bool SPORTS_PACK = true; |
| 59 | +SBE_CONSTEXPR bool SUNROOF = false; |
60 | 60 |
|
61 | 61 | static char VEHICLE_CODE[] = { 'a', 'b', 'c', 'd', 'e', 'f' }; |
62 | 62 | static char MANUFACTURER_CODE[] = { '1', '2', '3' }; |
63 | | -constexpr const char *FUEL_FIGURES_1_USAGE_DESCRIPTION = "Urban Cycle"; |
64 | | -constexpr const char *FUEL_FIGURES_2_USAGE_DESCRIPTION = "Combined Cycle"; |
65 | | -constexpr const char *FUEL_FIGURES_3_USAGE_DESCRIPTION = "Highway Cycle"; |
66 | | -constexpr const char *MANUFACTURER = "Honda"; |
67 | | -constexpr const char *MODEL = "Civic VTi"; |
68 | | -constexpr const char *ACTIVATION_CODE = "deadbeef"; |
69 | | -constexpr const char *COLOR = "red"; |
| 63 | +SBE_CONSTEXPR const char *FUEL_FIGURES_1_USAGE_DESCRIPTION = "Urban Cycle"; |
| 64 | +SBE_CONSTEXPR const char *FUEL_FIGURES_2_USAGE_DESCRIPTION = "Combined Cycle"; |
| 65 | +SBE_CONSTEXPR const char *FUEL_FIGURES_3_USAGE_DESCRIPTION = "Highway Cycle"; |
| 66 | +SBE_CONSTEXPR const char *MANUFACTURER = "Honda"; |
| 67 | +SBE_CONSTEXPR const char *MODEL = "Civic VTi"; |
| 68 | +SBE_CONSTEXPR const char *ACTIVATION_CODE = "deadbeef"; |
| 69 | +SBE_CONSTEXPR const char *COLOR = "red"; |
70 | 70 |
|
71 | 71 | static const int VEHICLE_CODE_LENGTH = sizeof(VEHICLE_CODE); |
72 | 72 | static const int MANUFACTURER_CODE_LENGTH = sizeof(MANUFACTURER_CODE); |
73 | | -constexpr std::size_t MANUFACTURER_LENGTH = 5; |
74 | | -constexpr std::size_t MODEL_LENGTH = 9; |
75 | | -constexpr std::size_t ACTIVATION_CODE_LENGTH = 8; |
76 | | -constexpr std::size_t COLOR_LENGTH = 3; |
77 | | -constexpr std::size_t PERFORMANCE_FIGURES_COUNT = 2; |
78 | | -constexpr std::size_t FUEL_FIGURES_COUNT = 3; |
79 | | -constexpr std::size_t ACCELERATION_COUNT = 3; |
80 | | - |
81 | | -constexpr std::uint16_t fuel1Speed = 30; |
82 | | -constexpr float fuel1Mpg = 35.9f; |
83 | | -constexpr std::uint16_t fuel2Speed = 55; |
84 | | -constexpr float fuel2Mpg = 49.0f; |
85 | | -constexpr std::uint16_t fuel3Speed = 75; |
86 | | -constexpr float fuel3Mpg = 40.0f; |
87 | | - |
88 | | -constexpr std::uint8_t perf1Octane = 95; |
89 | | -constexpr std::uint16_t perf1aMph = 30; |
90 | | -constexpr float perf1aSeconds = 4.0f; |
91 | | -constexpr std::uint16_t perf1bMph = 60; |
92 | | -constexpr float perf1bSeconds = 7.5f; |
93 | | -constexpr std::uint16_t perf1cMph = 100; |
94 | | -constexpr float perf1cSeconds = 12.2f; |
95 | | - |
96 | | -constexpr std::uint8_t perf2Octane = 99; |
97 | | -constexpr std::uint16_t perf2aMph = 30; |
98 | | -constexpr float perf2aSeconds = 3.8f; |
99 | | -constexpr std::uint16_t perf2bMph = 60; |
100 | | -constexpr float perf2bSeconds = 7.1f; |
101 | | -constexpr std::uint16_t perf2cMph = 100; |
102 | | -constexpr float perf2cSeconds = 11.8f; |
103 | | - |
104 | | -constexpr std::uint16_t engineCapacity = 2000; |
105 | | -constexpr std::uint8_t engineNumCylinders = 4; |
106 | | - |
107 | | -constexpr std::uint64_t encodedCarAndHdrLength = 198 + 8; |
| 73 | +SBE_CONSTEXPR std::size_t MANUFACTURER_LENGTH = 5; |
| 74 | +SBE_CONSTEXPR std::size_t MODEL_LENGTH = 9; |
| 75 | +SBE_CONSTEXPR std::size_t ACTIVATION_CODE_LENGTH = 8; |
| 76 | +SBE_CONSTEXPR std::size_t COLOR_LENGTH = 3; |
| 77 | +SBE_CONSTEXPR std::uint16_t PERFORMANCE_FIGURES_COUNT = 2; |
| 78 | +SBE_CONSTEXPR std::uint16_t FUEL_FIGURES_COUNT = 3; |
| 79 | +SBE_CONSTEXPR std::uint16_t ACCELERATION_COUNT = 3; |
| 80 | + |
| 81 | +SBE_CONSTEXPR std::uint16_t fuel1Speed = 30; |
| 82 | +SBE_CONSTEXPR float fuel1Mpg = 35.9f; |
| 83 | +SBE_CONSTEXPR std::uint16_t fuel2Speed = 55; |
| 84 | +SBE_CONSTEXPR float fuel2Mpg = 49.0f; |
| 85 | +SBE_CONSTEXPR std::uint16_t fuel3Speed = 75; |
| 86 | +SBE_CONSTEXPR float fuel3Mpg = 40.0f; |
| 87 | + |
| 88 | +SBE_CONSTEXPR std::uint8_t perf1Octane = 95; |
| 89 | +SBE_CONSTEXPR std::uint16_t perf1aMph = 30; |
| 90 | +SBE_CONSTEXPR float perf1aSeconds = 4.0f; |
| 91 | +SBE_CONSTEXPR std::uint16_t perf1bMph = 60; |
| 92 | +SBE_CONSTEXPR float perf1bSeconds = 7.5f; |
| 93 | +SBE_CONSTEXPR std::uint16_t perf1cMph = 100; |
| 94 | +SBE_CONSTEXPR float perf1cSeconds = 12.2f; |
| 95 | + |
| 96 | +SBE_CONSTEXPR std::uint8_t perf2Octane = 99; |
| 97 | +SBE_CONSTEXPR std::uint16_t perf2aMph = 30; |
| 98 | +SBE_CONSTEXPR float perf2aSeconds = 3.8f; |
| 99 | +SBE_CONSTEXPR std::uint16_t perf2bMph = 60; |
| 100 | +SBE_CONSTEXPR float perf2bSeconds = 7.1f; |
| 101 | +SBE_CONSTEXPR std::uint16_t perf2cMph = 100; |
| 102 | +SBE_CONSTEXPR float perf2cSeconds = 11.8f; |
| 103 | + |
| 104 | +SBE_CONSTEXPR std::uint16_t engineCapacity = 2000; |
| 105 | +SBE_CONSTEXPR std::uint8_t engineNumCylinders = 4; |
| 106 | + |
| 107 | +SBE_CONSTEXPR std::uint64_t encodedCarAndHdrLength = 198 + 8; |
108 | 108 |
|
109 | 109 | // This enum represents the expected events that |
110 | 110 | // will be received during the decoding process. |
|
0 commit comments