| 149 | } |
| 150 | |
| 151 | DDS::Boolean |
| 152 | ConfigStoreImpl::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 | |
| 190 | void |
| 191 | ConfigStoreImpl::set_int32(const char* key, |
no test coverage detected