| 802 | |
| 803 | template< class ReaderType, class DataType> |
| 804 | void |
| 805 | Monitor::MonitorTask::builtinTopicUpdate( |
| 806 | DDS::DataReader_ptr reader |
| 807 | ) |
| 808 | { |
| 809 | // Get the specific reader we need. |
| 810 | typename ReaderType::_var_type typedReader |
| 811 | = ReaderType::_narrow(reader); |
| 812 | if( CORBA::is_nil( typedReader.in())) { |
| 813 | ACE_ERROR((LM_ERROR, |
| 814 | ACE_TEXT("(%P|%t) ERROR: MonitorTask::builtinTopicUpdate() - ") |
| 815 | ACE_TEXT("failed to narrow the reader for instance %d.\n"), |
| 816 | reader->get_instance_handle() |
| 817 | )); |
| 818 | return; |
| 819 | } |
| 820 | |
| 821 | // Diagnostic information only. |
| 822 | int valid = 0; |
| 823 | int invalid = 0; |
| 824 | |
| 825 | // Read and forward all available new data. |
| 826 | DataType data; |
| 827 | DDS::SampleInfo info; |
| 828 | while( DDS::RETCODE_OK == typedReader->read_next_sample( data, info)) { |
| 829 | if( info.valid_data) { |
| 830 | this->data_->update(data, this->participant_); |
| 831 | ++valid; |
| 832 | |
| 833 | } else if( info.instance_state & DDS::NOT_ALIVE_INSTANCE_STATE) { |
| 834 | this->data_->update(data, this->participant_, true); |
| 835 | ++invalid; |
| 836 | } |
| 837 | } |
| 838 | |
| 839 | if( this->options_.verbose()) { |
| 840 | ACE_DEBUG((LM_DEBUG, |
| 841 | ACE_TEXT("(%P|%t) MonitorTask::builtinTopicUpdate() - ") |
| 842 | ACE_TEXT("forwarded %d/%d (valid/invalid) samples from instance %d.\n"), |
| 843 | valid, invalid, reader->get_instance_handle() |
| 844 | )); |
| 845 | } |
| 846 | } |
| 847 | |
| 848 | template< class ReaderType, class DataType, class DataTypeSeq> |
| 849 | bool |
nothing calls this directly
no test coverage detected