LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
fhicl::NameStackRegistry Class Reference

#include "NameStackRegistry.h"

Public Member Functions

std::string full_key (std::string const &key)
 
bool empty () const
 
std::string current () const
 
void clear ()
 

Static Public Member Functions

static void end_of_ctor ()
 
static NameStackRegistryinstance ()
 

Private Member Functions

 NameStackRegistry ()=default
 

Private Attributes

std::vector< std::string > names_ {}
 

Detailed Description

Definition at line 48 of file NameStackRegistry.h.

Constructor & Destructor Documentation

fhicl::NameStackRegistry::NameStackRegistry ( )
privatedefault

Referenced by instance().

Member Function Documentation

void fhicl::NameStackRegistry::clear ( void  )
inline

Definition at line 71 of file NameStackRegistry.h.

References names_.

72  {
73  names_.clear();
74  }
std::vector< std::string > names_
std::string fhicl::NameStackRegistry::current ( ) const
inline

Definition at line 59 of file NameStackRegistry.h.

References names_.

60  {
61  return names_.back();
62  }
std::vector< std::string > names_
bool fhicl::NameStackRegistry::empty ( void  ) const
inline

Definition at line 53 of file NameStackRegistry.h.

References names_.

54  {
55  return names_.empty();
56  }
std::vector< std::string > names_
static void fhicl::NameStackRegistry::end_of_ctor ( )
inlinestatic
std::string fhicl::NameStackRegistry::full_key ( std::string const &  key)

Definition at line 11 of file NameStackRegistry.cc.

References names_, and fhicl::other.

Referenced by fhicl::detail::ParameterMetadata::ParameterMetadata().

12  {
13  if (name.empty()) {
14  throw exception{error::other, "NameStackRegistry::full_key"}
15  << "Cannot insert empty name into 'NameStackRegistry'.\n";
16  }
17 
18  if (names_.empty() ||
19  std::regex_match(name, std::regex{R"(\[\d+\])"})) // Sequence elements
20  names_.emplace_back(name);
21  else
22  names_.emplace_back("." + name);
23  return std::accumulate(names_.begin(), names_.end(), std::string{});
24  }
std::vector< std::string > names_
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
static NameStackRegistry& fhicl::NameStackRegistry::instance ( )
inlinestatic

Member Data Documentation

std::vector<std::string> fhicl::NameStackRegistry::names_ {}
private

Definition at line 85 of file NameStackRegistry.h.

Referenced by clear(), current(), empty(), end_of_ctor(), and full_key().


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