MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / builtinTopicUpdate

Method builtinTopicUpdate

tools/monitor/MonitorTask.cpp:804–846  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

802
803template< class ReaderType, class DataType>
804void
805Monitor::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
848template< class ReaderType, class DataType, class DataTypeSeq>
849bool

Callers

nothing calls this directly

Calls 5

read_next_sampleMethod · 0.80
inMethod · 0.45
get_instance_handleMethod · 0.45
updateMethod · 0.45
verboseMethod · 0.45

Tested by

no test coverage detected