53#ifndef DOXYGEN_SHOULD_SKIP_THIS
62 template <
typename GUM_ELEMENT >
64 std::string_view projection_name,
65 std::string_view type_multidim,
69 CompleteProjectionSet* theset;
71 if (!_set_.exists(projection_name)) {
72 theset = _set_.insert(std::string{projection_name},
new CompleteProjectionSet).second;
77 __debug__::_inc_deletion_(
"HashTable", __FILE__, __LINE__,
"destructor of", (
void*)theset);
80 theset = _set_[projection_name];
83 theset->insert(std::string{type_multidim}, newFunction);
87 template <
typename GUM_ELEMENT >
89 std::string_view type_multidim) {
90 if (!_set_.exists(projection_name))
return;
92 CompleteProjectionSet* theset = _set_[projection_name];
94 theset->erase(type_multidim);
98 template <
typename GUM_ELEMENT >
100 std::string_view projection_name,
101 std::string_view type_multidim)
const {
102 if (!_set_.exists(projection_name))
return false;
104 const CompleteProjectionSet& theset = *(_set_[projection_name]);
105 return theset.exists(type_multidim);
110 template <
typename GUM_ELEMENT >
113 std::string_view projection_name,
114 std::string_view type_multidim)
const {
115 const CompleteProjectionSet& theset = *(_set_[projection_name]);
116 return theset[type_multidim];
121 template <
typename GUM_ELEMENT >
127# ifdef GUM_DEBUG_MODE
128 static std::atomic_flag first = ATOMIC_FLAG_INIT;
129 if (!first.test_and_set()) {
133 __debug__::_inc_deletion_(
"HashTable",
137 (
void*)&container._set_);
145 template <
typename GUM_ELEMENT >
150 template <
typename GUM_ELEMENT >
155 iter != _set_.endSafe();
161 template <
typename GUM_ELEMENT >
163 std::string_view projection_name,
164 std::string_view type_multidim,
A container for registering complete projection functions on multiDimImplementations,...
void insert(std::string_view projection_name, std::string_view type_multidim, CompleteProjectionPtr newFunction)
Adds a new entry into the register.
static CompleteProjectionRegister4MultiDim & Register()
A named constructor that constructs one and only one Register per data type.
CompleteProjectionRegister4MultiDim()
Default constructor: creates an empty register.
bool exists(std::string_view projection_name, std::string_view type_multidim) const
Indicates whether a given entry exists in the register.
~CompleteProjectionRegister4MultiDim()
Destructor.
void erase(std::string_view projection_name, std::string_view type_multidim)
Removes a given entry from the register.
GUM_ELEMENT(*)(const MultiDimImplementation< GUM_ELEMENT > *, Instantiation *instantiation) CompleteProjectionPtr
the type of functions used by the register
CompleteProjectionPtr get(std::string_view projection_name, std::string_view type_multidim) const
returns the specialized projection operator assigned to a given type of MultiDimImplementation
HashTableIteratorSafe< Key, Val > iterator_safe
Types for STL compliance.
A container for registering complete projection functions on multiDimImplementations,...
void registerCompleteProjection(std::string_view projection_name, std::string_view type_multidim, typename CompleteProjectionRegister4MultiDim< GUM_ELEMENT >::CompleteProjectionPtr function)
A function to more easily register new projection functions in MultiDims.
gum is the global namespace for all aGrUM entities