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

Method get_boolean

dds/DCPS/ConfigStoreImpl.cpp:151–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151DDS::Boolean
152ConfigStoreImpl::get_boolean(const char* key,
153 DDS::Boolean value)
154{
155 const ConfigPair cp(key, "");
156 DDS::Boolean retval = value;
157 DCPS::InternalDataReader<ConfigPair>::SampleSequence samples;
158 DCPS::InternalSampleInfoSequence infos;
159 config_reader_->read_instance(samples, infos, DDS::LENGTH_UNLIMITED, cp,
160 DDS::ANY_SAMPLE_STATE, DDS::ANY_VIEW_STATE, DDS::ALIVE_INSTANCE_STATE);
161 for (size_t idx = 0; idx != samples.size(); ++idx) {
162 const ConfigPair& sample = samples[idx];
163 const DDS::SampleInfo& info = infos[idx];
164 if (info.valid_data) {
165 bool x = false;
166 if (convert_value(sample.value(), x)) {
167 retval = x;
168 } else {
169 retval = value;
170 if (log_level >= LogLevel::Warning) {
171 ACE_ERROR((LM_WARNING,
172 ACE_TEXT("(%P|%t) WARNING: ConfigStoreImpl::parse_boolean: ")
173 ACE_TEXT("failed to parse boolean for %C=%C\n"),
174 sample.key().c_str(), sample.value().c_str()));
175 }
176 }
177 }
178 }
179
180 if (debug_logging) {
181 ACE_DEBUG((LM_DEBUG, "(%P|%t) %C: ConfigStoreImpl::get_boolean: %C=%C\n",
182 CONFIG_DEBUG_LOGGING,
183 cp.key().c_str(),
184 retval ? "true" : "false"));
185 }
186
187 return retval;
188}
189
190void
191ConfigStoreImpl::set_int32(const char* key,

Callers 15

parse_publisherqosMethod · 0.80
parse_subscriberqosMethod · 0.80
parse_argsMethod · 0.80
use_bidir_giopMethod · 0.80
get_securityMethod · 0.80
get_BITMethod · 0.80
on_data_availableMethod · 0.80
reloadMethod · 0.80
thread_per_connectionMethod · 0.80
drop_messagesMethod · 0.80

Calls 5

convert_valueFunction · 0.85
read_instanceMethod · 0.45
sizeMethod · 0.45
valueMethod · 0.45
keyMethod · 0.45

Tested by

no test coverage detected