| 12 | command_gate::command_gate(hidden) { } |
| 13 | |
| 14 | std::shared_ptr<command_gate> command_gate::create() { |
| 15 | auto ptr = std::make_shared<command_gate>(hidden{}); |
| 16 | ptr->pipe_ = std::make_shared<data_pipe>( |
| 17 | static_cast<data_pipe::local_message_checker_t>([weak_self = std::weak_ptr<command_gate>(ptr)](auto const& _cmd) { |
| 18 | if (auto self = weak_self.lock(); self) { |
| 19 | return (*self)(_cmd); |
| 20 | } |
| 21 | return data_pipe_state::OPEN; |
| 22 | })); |
| 23 | return ptr; |
| 24 | } |
| 25 | |
| 26 | std::shared_ptr<data_pipe> command_gate::get_data_pipe() const { |
| 27 | return pipe_; |