| 244 | } |
| 245 | |
| 246 | DDS::UInt32 |
| 247 | ConfigStoreImpl::get_uint32(const char* key, |
| 248 | DDS::UInt32 value) |
| 249 | { |
| 250 | const ConfigPair cp(key, ""); |
| 251 | DDS::UInt32 retval = value; |
| 252 | DCPS::InternalDataReader<ConfigPair>::SampleSequence samples; |
| 253 | DCPS::InternalSampleInfoSequence infos; |
| 254 | config_reader_->read_instance(samples, infos, DDS::LENGTH_UNLIMITED, cp, |
| 255 | DDS::ANY_SAMPLE_STATE, DDS::ANY_VIEW_STATE, DDS::ALIVE_INSTANCE_STATE); |
| 256 | for (size_t idx = 0; idx != samples.size(); ++idx) { |
| 257 | const ConfigPair& sample = samples[idx]; |
| 258 | const DDS::SampleInfo& info = infos[idx]; |
| 259 | if (info.valid_data) { |
| 260 | DDS::UInt32 x = 0; |
| 261 | if (sample.value() == "DURATION_INFINITE_NANOSEC") { |
| 262 | retval = DDS::DURATION_INFINITE_NSEC; |
| 263 | } else if (DCPS::convertToInteger(sample.value(), x)) { |
| 264 | retval = x; |
| 265 | } else { |
| 266 | retval = value; |
| 267 | if (log_level >= LogLevel::Warning) { |
| 268 | ACE_ERROR((LM_WARNING, |
| 269 | ACE_TEXT("(%P|%t) WARNING: ConfigStoreImpl::get_uint32: ") |
| 270 | ACE_TEXT("failed to parse uint32 for %C=%C\n"), |
| 271 | sample.key().c_str(), sample.value().c_str())); |
| 272 | } |
| 273 | } |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | if (debug_logging) { |
| 278 | ACE_DEBUG((LM_DEBUG, "(%P|%t) %C: ConfigStoreImpl::get_int32: %C=%u\n", |
| 279 | CONFIG_DEBUG_LOGGING, |
| 280 | cp.key().c_str(), |
| 281 | retval)); |
| 282 | |
| 283 | } |
| 284 | |
| 285 | return retval; |
| 286 | } |
| 287 | |
| 288 | void |
| 289 | ConfigStoreImpl::set_int64(const char* key, |