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

Method on_data_available

tools/rtpsrelay/RelayThreadMonitor.cpp:117–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117void RelayThreadMonitor::on_data_available(DDS::DataReader_ptr /*reader*/)
118{
119 ACE_GUARD(ACE_Thread_Mutex, g, mutex_);
120
121 OpenDDS::DCPS::InternalThreadBuiltinTopicDataSeq datas;
122 DDS::SampleInfoSeq infos;
123 const DDS::ReturnCode_t ret = thread_status_reader_->read(datas,
124 infos,
125 DDS::LENGTH_UNLIMITED,
126 DDS::NOT_READ_SAMPLE_STATE,
127 DDS::ANY_VIEW_STATE,
128 DDS::ANY_INSTANCE_STATE);
129
130 if (ret == DDS::RETCODE_NO_DATA) {
131 return;
132 }
133
134 if (ret != DDS::RETCODE_OK) {
135 ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: RelayThreadMonitor::on_data_available failed to read %C\n", OpenDDS::DCPS::retcode_to_string(ret)));
136 return;
137 }
138
139 for (CORBA::ULong idx = 0; idx != infos.length(); ++idx) {
140 if (infos[idx].valid_data) {
141 utilization_[datas[idx].thread_id.in()] = datas[idx].utilization;
142 } else if (infos[idx].instance_state != DDS::ALIVE_INSTANCE_STATE) {
143 utilization_.erase(datas[idx].thread_id.in());
144 }
145 }
146}
147
148std::string RelayThreadMonitor::decompose_thread_detail1(int detail) const
149{

Callers

nothing calls this directly

Calls 5

retcode_to_stringFunction · 0.85
readMethod · 0.45
lengthMethod · 0.45
inMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected