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

Method get_float64

dds/DCPS/ConfigStoreImpl.cpp:389–427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

387}
388
389DDS::Float64
390ConfigStoreImpl::get_float64(const char* key,
391 DDS::Float64 value)
392{
393 const ConfigPair cp(key, "");
394 DDS::Float64 retval = value;
395 DCPS::InternalDataReader<ConfigPair>::SampleSequence samples;
396 DCPS::InternalSampleInfoSequence infos;
397 config_reader_->read_instance(samples, infos, DDS::LENGTH_UNLIMITED, cp,
398 DDS::ANY_SAMPLE_STATE, DDS::ANY_VIEW_STATE, DDS::ALIVE_INSTANCE_STATE);
399 for (size_t idx = 0; idx != samples.size(); ++idx) {
400 const ConfigPair& sample = samples[idx];
401 const DDS::SampleInfo& info = infos[idx];
402 if (info.valid_data) {
403 DDS::Float64 x = 0;
404 if (DCPS::convertToFloating(sample.value(), x)) {
405 retval = x;
406 } else {
407 retval = value;
408 if (log_level >= LogLevel::Warning) {
409 ACE_ERROR((LM_WARNING,
410 ACE_TEXT("(%P|%t) WARNING: ConfigStoreImpl::get_float64: ")
411 ACE_TEXT("failed to parse float64 for %C=%C\n"),
412 sample.key().c_str(), sample.value().c_str()));
413 }
414 }
415 }
416 }
417
418 if (debug_logging) {
419 ACE_DEBUG((LM_DEBUG, "(%P|%t) %C: ConfigStoreImpl::get_float64: %C=%g\n",
420 CONFIG_DEBUG_LOGGING,
421 cp.key().c_str(),
422 retval));
423
424 }
425
426 return retval;
427}
428
429void
430ConfigStoreImpl::set_string(const char* key,

Callers 7

reloadMethod · 0.80
drop_messages_mMethod · 0.80
drop_messages_bMethod · 0.80
syn_backoffMethod · 0.80
quick_resend_ratioMethod · 0.80
TESTFunction · 0.80

Calls 5

convertToFloatingFunction · 0.85
read_instanceMethod · 0.45
sizeMethod · 0.45
valueMethod · 0.45
keyMethod · 0.45

Tested by

no test coverage detected