@@ -13,8 +13,8 @@ class impl {
1313 explicit impl (int concurrency) : ioc_(concurrency) {
1414 using reading = MeterReadingController;
1515 using price_plan = PricePlanComparatorController;
16- router_.to <reading, &reading::Read>(R"( /readings/read/([a-zA-Z0-9_-]+))" , electricityReadingService_, meterReadingService );
17- router_.to <reading, &reading::Store>(R"( /readings/store)" , electricityReadingService_, meterReadingService );
16+ router_.to <reading, &reading::Read>(R"( /readings/read/([a-zA-Z0-9_-]+))" , electricityReadingService_, meterReadingService_ );
17+ router_.to <reading, &reading::Store>(R"( /readings/store)" , electricityReadingService_, meterReadingService_ );
1818 router_.to <price_plan, &price_plan::Compare>(R"( /price-plans/compare-all/([a-zA-Z0-9_-]+))" , pricePlanService_);
1919 router_.to <price_plan, &price_plan::Recommend>(R"( /price-plans/recommend/([a-zA-Z0-9_-]+)\?(limit)=([0-9]+))" ,
2020 pricePlanService_);
@@ -23,7 +23,7 @@ class impl {
2323 void launch (const char *address, unsigned short port) {
2424 using tcp = boost::asio::ip::tcp;
2525 auto endpoint = tcp::endpoint{boost::asio::ip::make_address (address), port};
26- std::make_shared<listener>(ioc_, endpoint, handler )->run ();
26+ std::make_shared<listener>(ioc_, endpoint, handler_ )->run ();
2727 }
2828
2929 void run () { ioc_.run (); }
@@ -34,11 +34,11 @@ class impl {
3434 boost::asio::io_context ioc_;
3535 std::unordered_map<std::string, std::vector<ElectricityReading>> meterAssociatedReadings_{readings ()};
3636 ElectricityReadingService electricityReadingService_{meterAssociatedReadings_};
37- MeterReadingService meterReadingService {meterAssociatedReadings_};
37+ MeterReadingService meterReadingService_ {meterAssociatedReadings_};
3838 std::vector<PricePlan> price_plans_{pricePlans ()};
39- PricePlanService pricePlanService_{price_plans_, meterReadingService };
39+ PricePlanService pricePlanService_{price_plans_, meterReadingService_ };
4040 router router_;
41- std::function<http::response<http::string_body>(const http::request<http::string_body> &)> handler = router_.handler();
41+ std::function<http::response<http::string_body>(const http::request<http::string_body> &)> handler_ = router_.handler();
4242};
4343} // namespace server_detail
4444
0 commit comments