| 812 | } |
| 813 | |
| 814 | bool wait_for_scenario_data(AllocatedScenarioDataReader& allocated_scenario_reader_impl) |
| 815 | { |
| 816 | |
| 817 | DDS::ReadCondition_var read_condition = allocated_scenario_reader_impl.create_readcondition( |
| 818 | DDS::ANY_SAMPLE_STATE, DDS::ANY_VIEW_STATE, DDS::ALIVE_INSTANCE_STATE); |
| 819 | DDS::WaitSet_var ws(new DDS::WaitSet()); |
| 820 | ws->attach_condition(read_condition); |
| 821 | |
| 822 | while (!read_condition->get_trigger_value()) { |
| 823 | DDS::ConditionSeq active; |
| 824 | const DDS::Duration_t wake_interval = { 0, 500000000 }; |
| 825 | const DDS::ReturnCode_t rc = ws->wait(active, wake_interval); |
| 826 | if (rc != DDS::RETCODE_OK && rc != DDS::RETCODE_TIMEOUT) { |
| 827 | std::cerr << "Wait for node config failed" << std::endl; |
| 828 | return false; |
| 829 | } |
| 830 | } |
| 831 | |
| 832 | ws->detach_condition(read_condition); |
| 833 | allocated_scenario_reader_impl.delete_readcondition(read_condition); |
| 834 | |
| 835 | return true; |
| 836 | } |
| 837 | |
| 838 | void wait_for_full_scenario( |
| 839 | const std::string& name, |
no test coverage detected