51#ifndef DOXYGEN_SHOULD_SKIP_THIS
60 template <
typename GUM_SCALAR >
62 const std::string& projection_name,
63 const std::string& type_multidim,
67 CompleteProjectionSet* theset;
69 if (!_set_.exists(projection_name)) {
70 theset = _set_.insert(projection_name,
new CompleteProjectionSet).second;
75 __debug__::_inc_deletion_(
"HashTable", __FILE__, __LINE__,
"destructor of", (
void*)theset);
78 theset = _set_[projection_name];
81 theset->insert(type_multidim, newFunction);
85 template <
typename GUM_SCALAR >
87 const std::string& type_multidim) {
88 if (!_set_.exists(projection_name))
return;
90 CompleteProjectionSet* theset = _set_[projection_name];
92 theset->erase(type_multidim);
96 template <
typename GUM_SCALAR >
98 const std::string& projection_name,
99 const std::string& type_multidim)
const {
100 if (!_set_.exists(projection_name))
return false;
102 const CompleteProjectionSet& theset = *(_set_[projection_name]);
103 return theset.exists(type_multidim);
108 template <
typename GUM_SCALAR >
111 const std::string& projection_name,
112 const std::string& type_multidim)
const {
113 const CompleteProjectionSet& theset = *(_set_[projection_name]);
114 return theset[type_multidim];
119 template <
typename GUM_SCALAR >
125# ifdef GUM_DEBUG_MODE
126 static std::atomic_flag first = ATOMIC_FLAG_INIT;
127 if (!first.test_and_set()) {
131 __debug__::_inc_deletion_(
"HashTable",
135 (
void*)&container._set_);
143 template <
typename GUM_SCALAR >
147 template <
typename GUM_SCALAR >
152 iter != _set_.endSafe();
158 template <
typename GUM_SCALAR >
160 const std::string& projection_name,
161 const std::string& type_multidim,
A container for registering complete projection functions on multiDimImplementations,...
static CompleteProjectionRegister4MultiDim & Register()
A named constructor that constructs one and only one Register per data type.
CompleteProjectionPtr get(const std::string &projection_name, const std::string &type_multidim) const
returns the specialized projection operator assigned to a given type of MultiDimImplementation
void erase(const std::string &projection_name, const std::string &type_multidim)
Removes a given entry from the register.
bool exists(const std::string &projection_name, const std::string &type_multidim) const
Indicates whether a given entry exists in the register.
~CompleteProjectionRegister4MultiDim()
Destructor.
CompleteProjectionRegister4MultiDim()
Default constructor: creates an empty register.
void insert(const std::string &projection_name, const std::string &type_multidim, CompleteProjectionPtr newFunction)
Adds a new entry into the register.
GUM_SCALAR(*)(const MultiDimImplementation< GUM_SCALAR > *, Instantiation *instantiation) CompleteProjectionPtr
the type of functions used by the register
HashTableIteratorSafe< Key, Val > iterator_safe
Types for STL compliance.
A container for registering complete projection functions on multiDimImplementations,...
void registerCompleteProjection(const std::string &projection_name, const std::string &type_multidim, typename CompleteProjectionRegister4MultiDim< GUM_SCALAR >::CompleteProjectionPtr function)
A function to more easily register new projection functions in MultiDims.
gum is the global namespace for all aGrUM entities