| 28 | blocked_(false), running_(true), offer_thread_(std::bind(&service_sample::run, this)) { } |
| 29 | |
| 30 | bool init() { |
| 31 | std::scoped_lock its_lock(mutex_); |
| 32 | |
| 33 | if (!app_->init()) { |
| 34 | std::cerr << "Couldn't initialize application" << std::endl; |
| 35 | return false; |
| 36 | } |
| 37 | app_->register_state_handler(std::bind(&service_sample::on_state, this, std::placeholders::_1)); |
| 38 | app_->register_message_handler(SAMPLE_SERVICE_ID, SAMPLE_INSTANCE_ID, SAMPLE_METHOD_ID, |
| 39 | std::bind(&service_sample::on_message, this, std::placeholders::_1)); |
| 40 | |
| 41 | std::cout << "Static routing " << (use_static_routing_ ? "ON" : "OFF") << std::endl; |
| 42 | return true; |
| 43 | } |
| 44 | |
| 45 | void start() { app_->start(); } |
| 46 |
no test coverage detected