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

Method dataUpdate

tools/monitor/MonitorTask.cpp:759–801  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

757
758template< class ReaderType, class DataType>
759void
760Monitor::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
803template< class ReaderType, class DataType>
804void

Callers

nothing calls this directly

Calls 5

inMethod · 0.45
get_instance_handleMethod · 0.45
take_next_sampleMethod · 0.45
updateMethod · 0.45
verboseMethod · 0.45

Tested by

no test coverage detected