52#ifndef DOXYGEN_SHOULD_SKIP_THIS
61 template <
typename GUM_ELEMENT >
63 std::string_view instantiation_func_name,
64 std::string_view type_multidim,
68 PartialInstantiationSet* theset =
nullptr;
70 if (!_set_.exists(instantiation_func_name)) {
72 = _set_.insert(std::string{instantiation_func_name},
new PartialInstantiationSet).second;
78 __debug__::_inc_deletion_(
"HashTable", __FILE__, __LINE__,
"destructor of", (
void*)theset);
81 theset = _set_[instantiation_func_name];
84 theset->insert(std::string{type_multidim}, newFunction);
88 template <
typename GUM_ELEMENT >
90 std::string_view instantiation_func_name,
91 std::string_view type_multidim) {
92 if (!_set_.exists(instantiation_func_name))
return;
94 PartialInstantiationSet* theset = _set_[instantiation_func_name];
96 theset->erase(type_multidim);
100 template <
typename GUM_ELEMENT >
102 std::string_view instantiation_func_name,
103 std::string_view type_multidim)
const {
104 if (!_set_.exists(instantiation_func_name))
return false;
106 const PartialInstantiationSet& theset = *(_set_[instantiation_func_name]);
107 return theset.exists(type_multidim);
112 template <
typename GUM_ELEMENT >
115 std::string_view instantiation_func_name,
116 std::string_view type_multidim)
const {
117 const PartialInstantiationSet& theset = *(_set_[instantiation_func_name]);
118 return theset[type_multidim];
123 template <
typename GUM_ELEMENT >
129# ifdef GUM_DEBUG_MODE
130 static std::atomic_flag first = ATOMIC_FLAG_INIT;
131 if (!first.test_and_set()) {
136 __debug__::_inc_deletion_(
"HashTable",
140 (
void*)&container._set_);
148 template <
typename GUM_ELEMENT >
153 template <
typename GUM_ELEMENT >
158 iter != _set_.endSafe();
165 template <
typename GUM_ELEMENT >
167 std::string_view instantiation_func_name,
168 std::string_view type_multidim,
HashTableIteratorSafe< Key, Val > iterator_safe
Types for STL compliance.
A container for registering partial instantiation functions on multiDimImplementations,...
void erase(std::string_view instantiation_func_name, std::string_view type_multidim)
Removes a given entry from the register.
PartialInstantiationRegister4MultiDim()
Default constructor: creates an empty register.
~PartialInstantiationRegister4MultiDim()
Class destructor.
void insert(std::string_view instantiation_func_name, std::string_view type_multidim, PartialInstantiationPtr newFunction)
Adds a new entry into the register.
MultiDimImplementation< GUM_ELEMENT > *(*)(const MultiDimImplementation< GUM_ELEMENT > *, const HashTable< const DiscreteVariable *, Idx > &) PartialInstantiationPtr
The type of functions used by the register.
PartialInstantiationPtr get(std::string_view instantiation_func_name, std::string_view type_multidim) const
Returns the specialized partial instantiation operator assigned to a given type of MultiDimImplementa...
static PartialInstantiationRegister4MultiDim & Register()
A named constructor that constructs one and only one Register per data type.
bool exists(std::string_view instantiation_func_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 registerPartialInstantiation(std::string_view instantiation_func_name, std::string_view type_multidim, typename PartialInstantiationRegister4MultiDim< GUM_ELEMENT >::PartialInstantiationPtr function)
A function to more easily register new instantiation functions in MultiDims.
Headers for PartialInstantiationRegister4MultiDim.