53#ifndef DOXYGEN_SHOULD_SKIP_THIS
62 template <
typename GUM_ELEMENT >
64 std::string_view projection_name,
65 std::string_view type_multidim,
68 ProjectionSet* theset;
70 if (!_set_.exists(projection_name)) {
71 theset = _set_.insert(std::string{projection_name},
new ProjectionSet).second;
76 __debug__::_inc_deletion_(
"HashTable", __FILE__, __LINE__,
"destructor of", (
void*)theset);
79 theset = _set_[projection_name];
82 theset->insert(std::string{type_multidim}, newFunction);
86 template <
typename GUM_ELEMENT >
88 std::string_view type_multidim) {
89 if (!_set_.exists(projection_name))
return;
91 ProjectionSet* theset = _set_[projection_name];
93 theset->erase(type_multidim);
97 template <
typename GUM_ELEMENT >
99 std::string_view type_multidim)
const {
100 if (!_set_.exists(projection_name))
return false;
102 const ProjectionSet& theset = *(_set_[projection_name]);
103 return theset.exists(type_multidim);
108 template <
typename GUM_ELEMENT >
111 std::string_view type_multidim)
const {
112 const ProjectionSet& theset = *(_set_[projection_name]);
113 return theset[type_multidim];
118 template <
typename GUM_ELEMENT >
124# ifdef GUM_DEBUG_MODE
125 static std::atomic_flag first = ATOMIC_FLAG_INIT;
126 if (!first.test_and_set()) {
130 __debug__::_inc_deletion_(
"HashTable",
134 (
void*)&container._set_);
142 template <
typename GUM_ELEMENT >
146 template <
typename GUM_ELEMENT >
150 iter != _set_.endSafe();
156 template <
typename GUM_ELEMENT >
158 std::string_view projection_name,
159 std::string_view type_multidim,
HashTableIteratorSafe< Key, Val > iterator_safe
Types for STL compliance.
A container for registering projection functions on multiDimImplementations, i.e.,...
ProjectionPtr get(std::string_view projection_name, std::string_view type_multidim) const
returns the specialized projection operator assigned to a given type of MultiDimImplementation
ProjectionRegister4MultiDim()
Default constructor: creates an empty register.
~ProjectionRegister4MultiDim()
Destructor.
void insert(std::string_view projection_name, std::string_view type_multidim, ProjectionPtr newFunction)
adds a new entry into the register
void erase(std::string_view projection_name, std::string_view type_multidim)
removes a given entry from the register
static ProjectionRegister4MultiDim & Register()
a named constructor that constructs one and only one Register per data type
MultiDimImplementation< GUM_ELEMENT > *(*)(const MultiDimImplementation< GUM_ELEMENT > *, const gum::VariableSet &) ProjectionPtr
the type of functions used by the register
bool exists(std::string_view projection_name, std::string_view type_multidim) const
indicates whether a given entry exists in the register
gum is the global namespace for all aGrUM entities
void registerProjection(std::string_view projection_name, std::string_view type_multidim, typename ProjectionRegister4MultiDim< GUM_ELEMENT >::ProjectionPtr function)
A function to more easily register new projection functions in MultiDims.
A container for registering projection functions on multiDimImplementations.