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

Method get_duration

dds/DCPS/ConfigStoreImpl.cpp:484–522  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

482}
483
484DDS::Duration_t
485ConfigStoreImpl::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
524void
525ConfigStoreImpl::unset(const char* key)

Callers 3

TESTFunction · 0.45

Calls 5

to_dds_stringFunction · 0.70
read_instanceMethod · 0.45
sizeMethod · 0.45
valueMethod · 0.45
keyMethod · 0.45

Tested by

no test coverage detected