| 757 | |
| 758 | template< class ReaderType, class DataType> |
| 759 | void |
| 760 | Monitor::MonitorTask::dataUpdate( |
| 761 | DDS::DataReader_ptr reader |
| 762 | ) |
| 763 | { |
| 764 | // Extract the specific reader for this data. |
| 765 | typename ReaderType::_var_type typedReader |
| 766 | = ReaderType::_narrow( reader); |
| 767 | if( CORBA::is_nil( typedReader.in())) { |
| 768 | ACE_ERROR((LM_ERROR, |
| 769 | ACE_TEXT("(%P|%t) ERROR: MonitorTask::dataUpdate() - ") |
| 770 | ACE_TEXT("failed to narrow the reader for instance %d.\n"), |
| 771 | reader->get_instance_handle() |
| 772 | )); |
| 773 | return; |
| 774 | } |
| 775 | |
| 776 | // Diagnostic information only. |
| 777 | int valid = 0; |
| 778 | int invalid = 0; |
| 779 | |
| 780 | // Read and forward all available data. |
| 781 | DataType data; |
| 782 | DDS::SampleInfo info; |
| 783 | while( DDS::RETCODE_OK == typedReader->take_next_sample( data, info)) { |
| 784 | if( info.valid_data) { |
| 785 | this->data_->update(data, this->participant_); |
| 786 | ++valid; |
| 787 | |
| 788 | } else if( info.instance_state & DDS::NOT_ALIVE_INSTANCE_STATE) { |
| 789 | this->data_->update(data, this->participant_, true); |
| 790 | ++invalid; |
| 791 | } |
| 792 | } |
| 793 | |
| 794 | if( this->options_.verbose()) { |
| 795 | ACE_DEBUG((LM_DEBUG, |
| 796 | ACE_TEXT("(%P|%t) MonitorTask::dataUpdate() - ") |
| 797 | ACE_TEXT("forwarded %d/%d (valid/invalid) samples from instance %d.\n"), |
| 798 | valid, invalid, reader->get_instance_handle() |
| 799 | )); |
| 800 | } |
| 801 | } |
| 802 | |
| 803 | template< class ReaderType, class DataType> |
| 804 | void |
nothing calls this directly
no test coverage detected