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

Method get_uint32

dds/DCPS/ConfigStoreImpl.cpp:246–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244}
245
246DDS::UInt32
247ConfigStoreImpl::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
288void
289ConfigStoreImpl::set_int64(const char* key,

Callers 15

parse_datawriterqosMethod · 0.80
parse_datareaderqosMethod · 0.80
n_chunksMethod · 0.80
configure_poolMethod · 0.80
max_packet_sizeMethod · 0.80
optimum_packet_sizeMethod · 0.80

Calls 5

convertToIntegerFunction · 0.85
read_instanceMethod · 0.45
sizeMethod · 0.45
valueMethod · 0.45
keyMethod · 0.45

Tested by 1

testConfigStoreMethod · 0.64