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