| 387 | } |
| 388 | |
| 389 | DDS::Float64 |
| 390 | ConfigStoreImpl::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 | |
| 429 | void |
| 430 | ConfigStoreImpl::set_string(const char* key, |
no test coverage detected