LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
TableMemberRegistry.cc
Go to the documentation of this file.
4 
5 namespace fhicl::detail {
6 
7  TableMemberRegistry&
9  {
10  // The use of the registry is restricted to the construction
11  // of fhiclcpp types. As construction happens on only one
12  // thread, it is sufficient for each thread to have its own
13  // copy. Although a thread-local static would be appropriate
14  // here, not all implementations adequately support
15  // thread-local variables for the use case here. We thus use
16  // a custom-built per-thread cache.
18  return registry.slot_for_current_thread();
19  }
20 
21  std::vector<cet::exempt_ptr<ParameterBase>>
23  {
24  auto& tables = instance_().tables_;
25  auto result = std::exchange(tables.top(), {});
26  tables.pop();
27  return result;
28  }
29 
30  void
32  {
33  instance_().tables_.top().emplace_back(pb);
34  }
35 
36  void
38  {
39  instance_().tables_.emplace();
40  }
41 
43  {
44  if (is_table_member(pb->key())) {
46  }
47  if (is_table(pb->parameter_type())) {
49  }
50  }
51 }
static TableMemberRegistry & instance_()
std::stack< table_members_t > tables_
static void emplace_table_member(ParameterBase *pb)
static std::vector< base_ptr > release_members()
par_type parameter_type() const
std::string const & key() const
Definition: ParameterBase.cc:6
bool is_table_member(std::string const &key)
bool is_table(std::any const &val)
Definition: coding.h:55