1 #ifndef fhiclcpp_intermediate_table_h 2 #define fhiclcpp_intermediate_table_h 51 #include "boost/any.hpp" 73 bool exists(std::string
const& name)
const;
75 void erase(std::string
const& name,
bool in_prolog =
false);
78 T
get(std::string
const& name);
80 bool put(std::string
const& name,
81 std::string
const&
value,
82 bool in_prolog =
false);
83 bool put(std::string
const& name,
85 bool in_prolog =
false);
86 bool put(std::string
const& name,
88 bool in_prolog =
false);
90 bool put(std::string
const& name,
91 std::complex<T>
const& value,
92 bool in_prolog =
false);
94 bool put(std::string
const& name,
95 std::vector<T>
const& value,
96 bool in_prolog =
false);
99 std::string
const& name,
101 bool in_prolog =
false);
104 bool in_prolog =
false);
106 bool in_prolog =
false);
107 bool putNil(std::string
const& name,
108 bool in_prolog =
false);
120 const_iterator
begin()
const;
121 const_iterator
end()
const;
124 bool insert(std::string
const& name,
127 boost::any
const& value);
147 std::pair<extended_value*, bool>
locate_(std::string
const& name,
bool in_prolog =
false);
149 std::vector<std::string>
split(std::string
const& name)
const;
159 template <
typename T,
typename Enable =
void>
163 template <
typename T>
167 std::is_pointer<T>::value>::type> {
179 template <
typename U>
182 typename
tt::disable_if<std::is_reference<std::complex<U>>::value ||
183 std::is_pointer<std::complex<U>>::value>::type> {
192 return std::complex<U>(r, i);
212 intermediate_table::sequence_t&
215 auto item = sequence.
locate(name);
216 if (item !=
nullptr) {
217 return boost::any_cast<intermediate_table::sequence_t&>(item->value);
220 <<
"Requested non-updatable parameter \"" << name
221 <<
"\" for update.\n";
230 intermediate_table::sequence_t
const&
233 return boost::any_cast<intermediate_table::sequence_t
const&>(
254 intermediate_table::table_t&
257 auto item = table.
locate(name);
258 if (item !=
nullptr) {
259 return boost::any_cast<intermediate_table::table_t&>(item->value);
262 <<
"Requested non-updatable parameter " << name <<
" for update.\n";
271 intermediate_table::table_t
const&
274 return boost::any_cast<intermediate_table::table_t
const&>(
281 template <
typename T>
286 return getter(*
this, name);
291 std::string
const&
value,
313 template <
typename T>
316 std::complex<T>
const&
value,
326 template <
typename T>
329 std::vector<T>
const&
value,
337 for (
auto const& item : value) {
344 template <
typename T>
354 std::string
const& name,
377 if (located.second) {
378 result = located.first;
387 if (!located.second) {
389 <<
"Requested non-modifiable item \"" << name <<
"\" for update.\n";
391 return *located.first;
void decode(boost::any const &, std::string &)
ps_atom_t encode(std::string const &)
T operator()(intermediate_table &table, std::string const &name)
std::pair< std::string, std::string > complex_t
std::vector< extended_value > sequence_t
fhicl::extended_value::sequence_t sequence_t
std::enable_if<!b, T > disable_if
std::string value(boost::any const &)
std::string to_string(Flag_t< Storage > const flag)
Convert a flag into a stream (shows its index).
std::complex< U > operator()(intermediate_table &table, std::string const &name)
cet::coded_exception< error, detail::translate > exception