Private Types | Static Private Member Functions | Private Attributes | Friends | List of all members
fhicl::detail::TableMemberRegistry Class Reference

#include <TableMemberRegistry.h>

Private Types

using base_ptr = cet::exempt_ptr< ParameterBase >
 
using table_members_t = std::vector< base_ptr >
 

Static Private Member Functions

static TableMemberRegistryinstance_ ()
 
static std::vector< base_ptrrelease_members ()
 
static void emplace_table_member (ParameterBase *pb)
 
static void new_table ()
 

Private Attributes

std::stack< table_members_ttables_
 

Friends

template<typename T , typename KeysToIgnore >
class fhicl::Table
 
template<typename T >
class fhicl::OptionalTable
 
class RegisterIfTableMember
 

Detailed Description

Definition at line 50 of file TableMemberRegistry.h.

Member Typedef Documentation

Definition at line 52 of file TableMemberRegistry.h.

Definition at line 53 of file TableMemberRegistry.h.

Member Function Documentation

static void fhicl::detail::TableMemberRegistry::emplace_table_member ( ParameterBase pb)
inlinestaticprivate

Definition at line 90 of file TableMemberRegistry.h.

91  {
92  instance_().tables_.top().emplace_back(pb);
93  }
std::stack< table_members_t > tables_
static constexpr double pb
Definition: Units.h:82
static TableMemberRegistry & instance_()
static TableMemberRegistry& fhicl::detail::TableMemberRegistry::instance_ ( )
inlinestaticprivate

Definition at line 57 of file TableMemberRegistry.h.

58  {
59  // The use of the registry is restricted to the construction
60  // of fhiclcpp types. As construction happens on only one
61  // thread, it is sufficient for each thread to have its own
62  // copy. Although a thread-local static would be appropriate
63  // here, not all implementations adequately support
64  // thread-local variables for the use case here. We thus use
65  // a custom-built per-thread cache.
66  static per_thread_holder<TableMemberRegistry> registry;
67  return registry.slot_for_current_thread();
68  }
static void fhicl::detail::TableMemberRegistry::new_table ( )
inlinestaticprivate

Definition at line 96 of file TableMemberRegistry.h.

97  {
98  instance_().tables_.emplace();
99  }
std::stack< table_members_t > tables_
static TableMemberRegistry & instance_()
static std::vector<base_ptr> fhicl::detail::TableMemberRegistry::release_members ( )
inlinestaticprivate

Definition at line 78 of file TableMemberRegistry.h.

79  {
80  auto& tables = instance_().tables_;
81  auto result = std::exchange(tables.top(), {});
82  tables.pop();
83  return result;
84  }
static QCString result
std::stack< table_members_t > tables_
static TableMemberRegistry & instance_()

Friends And Related Function Documentation

template<typename T >
friend class fhicl::OptionalTable
friend

Definition at line 75 of file TableMemberRegistry.h.

template<typename T , typename KeysToIgnore >
friend class fhicl::Table
friend

Definition at line 73 of file TableMemberRegistry.h.

friend class RegisterIfTableMember
friend

Definition at line 88 of file TableMemberRegistry.h.

Member Data Documentation

std::stack<table_members_t> fhicl::detail::TableMemberRegistry::tables_
private

Definition at line 54 of file TableMemberRegistry.h.


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