| 209 | |
| 210 | |
| 211 | bool wait_for_data(::DDS::Subscriber_ptr sub, int timeout_sec) |
| 212 | { |
| 213 | const int factor = 10; |
| 214 | ACE_Time_Value small_time(0,1000000/factor); |
| 215 | int timeout_loops = timeout_sec * factor; |
| 216 | |
| 217 | ::DDS::DataReaderSeq_var discard = new ::DDS::DataReaderSeq(10); |
| 218 | while (timeout_loops-- > 0) |
| 219 | { |
| 220 | sub->get_datareaders ( |
| 221 | discard.inout (), |
| 222 | ::DDS::NOT_READ_SAMPLE_STATE, |
| 223 | ::DDS::ANY_VIEW_STATE, |
| 224 | ::DDS::ANY_INSTANCE_STATE ); |
| 225 | if (discard->length () > 0) |
| 226 | return true; |
| 227 | |
| 228 | ACE_OS::sleep (small_time); |
| 229 | } |
| 230 | return false; |
| 231 | } |
| 232 | |
| 233 | /// parse the command line arguments |
| 234 | int parse_args (int argc, ACE_TCHAR *argv[]) |
no test coverage detected