| 482 | } |
| 483 | |
| 484 | DDS::Duration_t |
| 485 | ConfigStoreImpl::get_duration(const char* key, |
| 486 | const DDS::Duration_t& value) |
| 487 | { |
| 488 | const ConfigPair cp(key, ""); |
| 489 | DDS::Duration_t retval = value; |
| 490 | |
| 491 | DCPS::InternalDataReader<ConfigPair>::SampleSequence samples; |
| 492 | DCPS::InternalSampleInfoSequence infos; |
| 493 | config_reader_->read_instance(samples, infos, DDS::LENGTH_UNLIMITED, cp, |
| 494 | DDS::ANY_SAMPLE_STATE, DDS::ANY_VIEW_STATE, DDS::ALIVE_INSTANCE_STATE); |
| 495 | for (size_t idx = 0; idx != samples.size(); ++idx) { |
| 496 | const ConfigPair& sample = samples[idx]; |
| 497 | const DDS::SampleInfo& info = infos[idx]; |
| 498 | if (info.valid_data) { |
| 499 | if (from_dds_string(sample.value(), retval)) { |
| 500 | // Okay. |
| 501 | } else { |
| 502 | retval = value; |
| 503 | if (log_level >= LogLevel::Warning) { |
| 504 | ACE_ERROR((LM_WARNING, |
| 505 | ACE_TEXT("(%P|%t) WARNING: ConfigStoreImpl::get_duration: ") |
| 506 | ACE_TEXT("failed to parse DDS::Duration_t for %C=%C\n"), |
| 507 | sample.key().c_str(), sample.value().c_str())); |
| 508 | } |
| 509 | } |
| 510 | } |
| 511 | } |
| 512 | |
| 513 | if (debug_logging) { |
| 514 | ACE_DEBUG((LM_DEBUG, "(%P|%t) %C: ConfigStoreImpl::get_duration: %C=%C\n", |
| 515 | CONFIG_DEBUG_LOGGING, |
| 516 | cp.key().c_str(), |
| 517 | to_dds_string(retval).c_str())); |
| 518 | |
| 519 | } |
| 520 | |
| 521 | return retval; |
| 522 | } |
| 523 | |
| 524 | void |
| 525 | ConfigStoreImpl::unset(const char* key) |
no test coverage detected