1 #ifndef fhiclcpp_intermediate_table_h 2 #define fhiclcpp_intermediate_table_h 60 #include <type_traits> 71 bool exists(std::string
const& key)
const;
73 void erase(std::string
const& key,
bool in_prolog =
false);
76 T
get(std::string
const& name);
78 bool put(std::string
const& name,
79 std::string
const&
value,
80 bool in_prolog =
false);
81 bool put(std::string
const& name,
83 bool in_prolog =
false);
84 bool put(std::string
const& name,
86 bool in_prolog =
false);
88 bool put(std::string
const& name,
89 std::complex<T>
const& value,
90 bool in_prolog =
false);
92 bool put(std::string
const& name,
93 std::vector<T>
const& value,
94 bool in_prolog =
false);
98 bool in_prolog =
false);
101 bool in_prolog =
false);
103 bool in_prolog =
false);
104 bool putNil(std::string
const& name,
105 bool in_prolog =
false);
121 bool insert(std::string
const& key,
124 std::any
const& value);
144 std::pair<extended_value*, bool>
locate_(std::string
const& key,
145 bool in_prolog =
false);
147 static std::vector<std::string>
split(std::string
const& key);
156 template <
typename T,
typename Enable =
void>
160 template <
typename T>
163 std::is_pointer_v<T>>
::type> {
175 template <
typename U>
179 std::is_pointer_v<std::complex<U>>>
::type> {
188 return std::complex<U>(
r, i);
208 intermediate_table::sequence_t&
211 auto item = table.
locate(key);
212 if (item !=
nullptr) {
213 return std::any_cast<intermediate_table::sequence_t&>(item->value);
216 <<
"Requested non-updatable parameter \"" << key <<
"\" for update.\n";
224 intermediate_table::sequence_t
const&
227 return std::any_cast<intermediate_table::sequence_t
const&>(
247 intermediate_table::table_t&
250 auto item = table.
locate(key);
251 if (item !=
nullptr) {
252 return std::any_cast<intermediate_table::table_t&>(item->value);
255 <<
"Requested non-updatable parameter " << key <<
" for update.\n";
263 intermediate_table::table_t
const&
266 return std::any_cast<intermediate_table::table_t
const&>(
272 template <
typename T>
277 return getter(*
this, key);
282 std::string
const&
value,
291 bool const in_prolog)
299 bool const in_prolog)
304 template <
typename T>
307 std::complex<T>
const&
value,
308 bool const in_prolog)
317 template <
typename T>
320 std::vector<T>
const&
value,
321 bool const in_prolog)
328 for (
auto const& item : value) {
335 template <
typename T>
339 bool const in_prolog)
346 bool const in_prolog)
353 bool const in_prolog)
360 bool const in_prolog)
370 if (located.second) {
371 result = located.first;
380 if (!located.second) {
382 <<
"Requested non-modifiable item \"" << key <<
"\" for update.\n";
384 return *located.first;
iter< iterator_tag, std::pair< Key const, T >> iterator
ps_atom_t encode(std::string const &)
std::pair< std::string, std::string > complex_t
void decode(std::any const &, std::string &)
decltype(auto) constexpr to_string(T &&obj)
ADL-aware version of std::to_string.
std::vector< extended_value > sequence_t
shims::map< std::string, extended_value > table_t
fhicl::extended_value::sequence_t sequence_t
std::enable_if<!b, T > disable_if
std::complex< U > operator()(intermediate_table &table, std::string const &key)
T operator()(intermediate_table &table, std::string const &key)
iter< iterator_tag, std::pair< Key const, T > const > const_iterator
cet::coded_exception< error, detail::translate > exception