|
8 | 8 |
|
9 | 9 | #include <unordered_map> |
10 | 10 |
|
11 | | -constexpr auto DR_EVILS_DARK_ENERGY_ENERGY_SUPPLIER = "Dr Evil's Dark Energy"; |
12 | | -constexpr auto THE_GREEN_ECO_ENERGY_SUPPLIER = "The Green Eco"; |
13 | | -constexpr auto POWER_FOR_EVERYONE_ENERGY_SUPPLIER = "Power for Everyone"; |
| 11 | +inline constexpr auto DR_EVILS_DARK_ENERGY_ENERGY_SUPPLIER = "Dr Evil's Dark Energy"; |
| 12 | +inline constexpr auto THE_GREEN_ECO_ENERGY_SUPPLIER = "The Green Eco"; |
| 13 | +inline constexpr auto POWER_FOR_EVERYONE_ENERGY_SUPPLIER = "Power for Everyone"; |
14 | 14 |
|
15 | | -constexpr auto MOST_EVIL_PRICE_PLAN_ID = "price-plan-0"; |
16 | | -constexpr auto RENEWABLES_PRICE_PLAN_ID = "price-plan-1"; |
17 | | -constexpr auto STANDARD_PRICE_PLAN_ID = "price-plan-2"; |
| 15 | +inline constexpr auto MOST_EVIL_PRICE_PLAN_ID = "price-plan-0"; |
| 16 | +inline constexpr auto RENEWABLES_PRICE_PLAN_ID = "price-plan-1"; |
| 17 | +inline constexpr auto STANDARD_PRICE_PLAN_ID = "price-plan-2"; |
18 | 18 |
|
19 | | -constexpr auto SARAHS_SMART_METER_ID = "smart-meter-0"; |
20 | | -constexpr auto PETERS_SMART_METER_ID = "smart-meter-1"; |
21 | | -constexpr auto CHARLIES_SMART_METER_ID = "smart-meter-2"; |
22 | | -constexpr auto ANDREAS_SMART_METER_ID = "smart-meter-3"; |
23 | | -constexpr auto ALEXS_SMART_METER_ID = "smart-meter-4"; |
| 19 | +inline constexpr auto SARAHS_SMART_METER_ID = "smart-meter-0"; |
| 20 | +inline constexpr auto PETERS_SMART_METER_ID = "smart-meter-1"; |
| 21 | +inline constexpr auto CHARLIES_SMART_METER_ID = "smart-meter-2"; |
| 22 | +inline constexpr auto ANDREAS_SMART_METER_ID = "smart-meter-3"; |
| 23 | +inline constexpr auto ALEXS_SMART_METER_ID = "smart-meter-4"; |
24 | 24 |
|
25 | | -std::vector<PricePlan> pricePlans() { |
| 25 | +inline std::vector<PricePlan> pricePlans() { |
26 | 26 | std::vector<PricePlan> price_plans; |
27 | 27 | price_plans.push_back(PricePlan(MOST_EVIL_PRICE_PLAN_ID, DR_EVILS_DARK_ENERGY_ENERGY_SUPPLIER, 10, {})); |
28 | 28 | price_plans.push_back(PricePlan(RENEWABLES_PRICE_PLAN_ID, THE_GREEN_ECO_ENERGY_SUPPLIER, 2, {})); |
29 | 29 | price_plans.push_back(PricePlan(STANDARD_PRICE_PLAN_ID, POWER_FOR_EVERYONE_ENERGY_SUPPLIER, 1, {})); |
30 | 30 | return price_plans; |
31 | 31 | } |
32 | 32 |
|
33 | | -std::unordered_map<std::string, std::string> smart_meter_to_price_plan_accounts() { |
| 33 | +inline std::unordered_map<std::string, std::string> smart_meter_to_price_plan_accounts() { |
34 | 34 | return {{SARAHS_SMART_METER_ID, MOST_EVIL_PRICE_PLAN_ID}, |
35 | 35 | {PETERS_SMART_METER_ID, RENEWABLES_PRICE_PLAN_ID}, |
36 | 36 | {CHARLIES_SMART_METER_ID, MOST_EVIL_PRICE_PLAN_ID}, |
37 | 37 | {ANDREAS_SMART_METER_ID, STANDARD_PRICE_PLAN_ID}, |
38 | 38 | {ALEXS_SMART_METER_ID, RENEWABLES_PRICE_PLAN_ID}}; |
39 | 39 | }; |
40 | 40 |
|
41 | | -auto readings() { |
| 41 | +inline auto readings() { |
42 | 42 | std::unordered_map<std::string, std::vector<ElectricityReading>> result; |
43 | 43 | for (auto &[meter, plan] : smart_meter_to_price_plan_accounts()) { |
44 | 44 | result[meter] = generator{}.generate(21); |
|
0 commit comments