Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
fhicl::intermediate_table Class Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/fhiclcpp/v4_06_10/source/fhiclcpp/intermediate_table.h"

Public Types

typedef extended_value::atom_t atom_t
 
typedef extended_value::complex_t complex_t
 
typedef extended_value::sequence_t sequence_t
 
typedef extended_value::table_t table_t
 
typedef table_t::iterator iterator
 
typedef table_t::const_iterator const_iterator
 

Public Member Functions

 intermediate_table ()
 
bool empty () const
 
bool exists (std::string const &name) const
 
void erase (std::string const &name, bool in_prolog=false)
 
template<typename T >
T get (std::string const &name)
 
bool put (std::string const &name, std::string const &value, bool in_prolog=false)
 
bool put (std::string const &name, char const *value, bool in_prolog=false)
 
bool put (std::string const &name, bool value, bool in_prolog=false)
 
template<typename T >
bool put (std::string const &name, std::complex< T > const &value, bool in_prolog=false)
 
template<typename T >
bool put (std::string const &name, std::vector< T > const &value, bool in_prolog=false)
 
template<typename T >
std::enable_if< tt::is_numeric< T >::value, bool >::type put (std::string const &name, T value, bool in_prolog=false)
 
bool putEmptySequence (std::string const &name, bool in_prolog=false)
 
bool putEmptyTable (std::string const &name, bool in_prolog=false)
 
bool putNil (std::string const &name, bool in_prolog=false)
 
const_iterator begin () const
 
const_iterator end () const
 
bool insert (std::string const &name, bool in_prolog, value_tag tag, boost::any const &value)
 
bool insert (std::string const &name, extended_value const &value)
 
bool insert (std::string const &name, extended_value &&value)
 
extended_value const & find (std::string const &name) const
 
extended_valuelocate (std::string const &name)
 
extended_valueupdate (std::string const &name)
 

Private Member Functions

extended_valuepre_insert_ (std::string const &name, extended_value const &value)
 
std::pair< extended_value *, bool > locate_ (std::string const &name, bool in_prolog=false)
 
std::vector< std::stringsplit (std::string const &name) const
 

Private Attributes

extended_value ex_val
 

Detailed Description

Definition at line 64 of file intermediate_table.h.

Member Typedef Documentation

Definition at line 113 of file intermediate_table.h.

Definition at line 114 of file intermediate_table.h.

Definition at line 118 of file intermediate_table.h.

Definition at line 117 of file intermediate_table.h.

Definition at line 115 of file intermediate_table.h.

Definition at line 116 of file intermediate_table.h.

Constructor & Destructor Documentation

fhicl::intermediate_table::intermediate_table ( )

Member Function Documentation

const_iterator fhicl::intermediate_table::begin ( ) const
bool fhicl::intermediate_table::empty ( ) const
const_iterator fhicl::intermediate_table::end ( ) const
void fhicl::intermediate_table::erase ( std::string const &  name,
bool  in_prolog = false 
)
bool fhicl::intermediate_table::exists ( std::string const &  name) const
extended_value const& fhicl::intermediate_table::find ( std::string const &  name) const
template<typename T >
T fhicl::intermediate_table::get ( std::string const &  name)
inline

Definition at line 284 of file intermediate_table.h.

285 {
286  static detail::it_value_get<T> getter;
287  return getter(*this, name);
288 }
const XML_Char * name
Definition: expat.h:151
bool fhicl::intermediate_table::insert ( std::string const &  name,
bool  in_prolog,
value_tag  tag,
boost::any const &  value 
)
bool fhicl::intermediate_table::insert ( std::string const &  name,
extended_value const &  value 
)
bool fhicl::intermediate_table::insert ( std::string const &  name,
extended_value &&  value 
)
fhicl::extended_value * fhicl::intermediate_table::locate ( std::string const &  name)
inline
Returns
nullptr if not able to be updated.

Definition at line 374 of file intermediate_table.h.

References locate_(), and fillBadChanDBTables::result.

Referenced by fhicl::detail::it_value_get< intermediate_table::sequence_t & >::operator()(), and fhicl::detail::it_value_get< intermediate_table::table_t & >::operator()().

375 {
376  extended_value* result = nullptr;
377  auto located = locate_(name);
378  if (located.second) {
379  result = located.first;
380  }
381  return result;
382 }
const XML_Char * name
Definition: expat.h:151
std::pair< extended_value *, bool > locate_(std::string const &name, bool in_prolog=false)
std::pair<extended_value*, bool> fhicl::intermediate_table::locate_ ( std::string const &  name,
bool  in_prolog = false 
)
private

Referenced by locate(), and update().

extended_value* fhicl::intermediate_table::pre_insert_ ( std::string const &  name,
extended_value const &  value 
)
private
bool fhicl::intermediate_table::put ( std::string const &  name,
std::string const &  value,
bool  in_prolog = false 
)
inline

Definition at line 291 of file intermediate_table.h.

References fhicl::detail::encode(), insert(), and fhicl::STRING.

Referenced by put().

294 {
295  return insert(name, in_prolog, STRING, detail::encode(value));
296 }
const XML_Char * name
Definition: expat.h:151
ps_atom_t encode(std::string const &)
bool insert(std::string const &name, bool in_prolog, value_tag tag, boost::any const &value)
const XML_Char int const XML_Char * value
Definition: expat.h:331
bool fhicl::intermediate_table::put ( std::string const &  name,
char const *  value,
bool  in_prolog = false 
)
inline

Definition at line 299 of file intermediate_table.h.

References fhicl::detail::encode(), insert(), and fhicl::STRING.

302 {
303  return insert(name, in_prolog, STRING, detail::encode(value));
304 }
const XML_Char * name
Definition: expat.h:151
ps_atom_t encode(std::string const &)
bool insert(std::string const &name, bool in_prolog, value_tag tag, boost::any const &value)
const XML_Char int const XML_Char * value
Definition: expat.h:331
bool fhicl::intermediate_table::put ( std::string const &  name,
bool  value,
bool  in_prolog = false 
)
inline

Definition at line 307 of file intermediate_table.h.

References fhicl::BOOL, fhicl::detail::encode(), and insert().

310 {
311  return insert(name, in_prolog, BOOL, detail::encode(value));
312 }
const XML_Char * name
Definition: expat.h:151
ps_atom_t encode(std::string const &)
bool insert(std::string const &name, bool in_prolog, value_tag tag, boost::any const &value)
const XML_Char int const XML_Char * value
Definition: expat.h:331
template<typename T >
bool fhicl::intermediate_table::put ( std::string const &  name,
std::complex< T > const &  value,
bool  in_prolog = false 
)

Definition at line 316 of file intermediate_table.h.

References fhicl::COMPLEX, fhicl::detail::encode(), and insert().

319 {
320  return insert(
321  name,
322  in_prolog,
323  COMPLEX,
325 }
const XML_Char * name
Definition: expat.h:151
ps_atom_t encode(std::string const &)
bool insert(std::string const &name, bool in_prolog, value_tag tag, boost::any const &value)
extended_value::complex_t complex_t
const XML_Char int const XML_Char * value
Definition: expat.h:331
template<typename T >
bool fhicl::intermediate_table::put ( std::string const &  name,
std::vector< T > const &  value,
bool  in_prolog = false 
)
inline

Definition at line 329 of file intermediate_table.h.

References confusionMatrixTree::count, put(), putEmptySequence(), fillBadChanDBTables::result, and art::to_string().

332 {
333  bool result = putEmptySequence(name, in_prolog);
334  if (!result) {
335  return result;
336  }
337  size_t count(0);
338  for (auto const& item : value) {
339  result = result &&
340  put(name + "[" + std::to_string(count++) + "]", item, in_prolog);
341  }
342  return result;
343 }
const XML_Char * name
Definition: expat.h:151
bool putEmptySequence(std::string const &name, bool in_prolog=false)
const XML_Char int const XML_Char * value
Definition: expat.h:331
bool put(std::string const &name, std::string const &value, bool in_prolog=false)
std::string to_string(ModuleType mt)
Definition: ModuleType.h:32
template<typename T >
std::enable_if< tt::is_numeric< T >::value, bool >::type fhicl::intermediate_table::put ( std::string const &  name,
T  value,
bool  in_prolog = false 
)
inline

Definition at line 347 of file intermediate_table.h.

References fhicl::detail::encode(), insert(), and fhicl::NUMBER.

350 {
351  return insert(name, in_prolog, NUMBER, detail::encode(value));
352 }
const XML_Char * name
Definition: expat.h:151
ps_atom_t encode(std::string const &)
bool insert(std::string const &name, bool in_prolog, value_tag tag, boost::any const &value)
const XML_Char int const XML_Char * value
Definition: expat.h:331
bool fhicl::intermediate_table::putEmptySequence ( std::string const &  name,
bool  in_prolog = false 
)
inline

Definition at line 354 of file intermediate_table.h.

References insert(), and fhicl::SEQUENCE.

Referenced by put().

357 {
358  return insert(name, in_prolog, SEQUENCE, sequence_t());
359 }
const XML_Char * name
Definition: expat.h:151
bool insert(std::string const &name, bool in_prolog, value_tag tag, boost::any const &value)
extended_value::sequence_t sequence_t
bool fhicl::intermediate_table::putEmptyTable ( std::string const &  name,
bool  in_prolog = false 
)
inline

Definition at line 361 of file intermediate_table.h.

References insert(), and fhicl::TABLE.

363 {
364  return insert(name, in_prolog, TABLE, table_t());
365 }
const XML_Char * name
Definition: expat.h:151
bool insert(std::string const &name, bool in_prolog, value_tag tag, boost::any const &value)
extended_value::table_t table_t
bool fhicl::intermediate_table::putNil ( std::string const &  name,
bool  in_prolog = false 
)
inline

Definition at line 367 of file intermediate_table.h.

References fhicl::detail::encode(), insert(), and fhicl::NIL.

369 {
370  return insert(name, in_prolog, NIL, detail::encode((void*)0));
371 }
const XML_Char * name
Definition: expat.h:151
ps_atom_t encode(std::string const &)
bool insert(std::string const &name, bool in_prolog, value_tag tag, boost::any const &value)
std::vector<std::string> fhicl::intermediate_table::split ( std::string const &  name) const
private
fhicl::extended_value & fhicl::intermediate_table::update ( std::string const &  name)
inline
Exceptions
ifnot able to be updated.

Definition at line 385 of file intermediate_table.h.

References locate_(), and fhicl::protection_violation.

386 {
387  auto located = locate_(name);
388  if (!located.second) {
390  << "Requested non-modifiable item \"" << name << "\" for update.\n";
391  }
392  return *located.first;
393 }
const XML_Char * name
Definition: expat.h:151
std::pair< extended_value *, bool > locate_(std::string const &name, bool in_prolog=false)
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33

Member Data Documentation

extended_value fhicl::intermediate_table::ex_val
private

Definition at line 152 of file intermediate_table.h.


The documentation for this class was generated from the following file: