| 226 | } |
| 227 | |
| 228 | std::unique_ptr<base_vsip_app> base_vsip_app_builder::build() { |
| 229 | auto app = std::make_unique<base_vsip_app>(app_name.c_str()); |
| 230 | |
| 231 | if (!requests.empty()) { |
| 232 | app->set_request(requests); |
| 233 | } |
| 234 | if (!offers.empty()) { |
| 235 | app->set_offer(offers); |
| 236 | } |
| 237 | if (state_callback) { |
| 238 | app->set_state_callback(*state_callback); |
| 239 | } |
| 240 | if (availability_callback) { |
| 241 | app->set_availability_callback(*availability_callback); |
| 242 | } |
| 243 | |
| 244 | if (auto_start_) { |
| 245 | app->greenlight(); |
| 246 | } |
| 247 | |
| 248 | return app; |
| 249 | } |
| 250 | } // namespace common |