51#ifndef DOXYGEN_SHOULD_SKIP_THIS
60 template <
typename GUM_SCALAR >
62 const std::string& projection_name,
63 const std::string& type_multidim,
66 ProjectionSet* theset;
68 if (!_set_.exists(projection_name)) {
69 theset = _set_.insert(projection_name,
new ProjectionSet).second;
74 __debug__::_inc_deletion_(
"HashTable", __FILE__, __LINE__,
"destructor of", (
void*)theset);
77 theset = _set_[projection_name];
80 theset->insert(type_multidim, newFunction);
84 template <
typename GUM_SCALAR >
86 const std::string& type_multidim) {
87 if (!_set_.exists(projection_name))
return;
89 ProjectionSet* theset = _set_[projection_name];
91 theset->erase(type_multidim);
95 template <
typename GUM_SCALAR >
98 const std::string& type_multidim)
const {
99 if (!_set_.exists(projection_name))
return false;
101 const ProjectionSet& theset = *(_set_[projection_name]);
102 return theset.exists(type_multidim);
107 template <
typename GUM_SCALAR >
110 const std::string& type_multidim)
const {
111 const ProjectionSet& theset = *(_set_[projection_name]);
112 return theset[type_multidim];
117 template <
typename GUM_SCALAR >
122# ifdef GUM_DEBUG_MODE
123 static std::atomic_flag first = ATOMIC_FLAG_INIT;
124 if (!first.test_and_set()) {
128 __debug__::_inc_deletion_(
"HashTable",
132 (
void*)&container._set_);
140 template <
typename GUM_SCALAR >
144 template <
typename GUM_SCALAR >
148 iter != _set_.endSafe();
154 template <
typename GUM_SCALAR >
156 const std::string& projection_name,
157 const std::string& type_multidim,
HashTableIteratorSafe< Key, Val > iterator_safe
Types for STL compliance.
A container for registering projection functions on multiDimImplementations, i.e.,...
void insert(const std::string &projection_name, const std::string &type_multidim, ProjectionPtr newFunction)
adds a new entry into the register
ProjectionRegister4MultiDim()
Default constructor: creates an empty register.
void erase(const std::string &projection_name, const std::string &type_multidim)
removes a given entry from the register
MultiDimImplementation< GUM_SCALAR > *(*)(const MultiDimImplementation< GUM_SCALAR > *, const gum::VariableSet &) ProjectionPtr
the type of functions used by the register
bool exists(const std::string &projection_name, const std::string &type_multidim) const
indicates whether a given entry exists in the register
~ProjectionRegister4MultiDim()
Destructor.
ProjectionPtr get(const std::string &projection_name, const std::string &type_multidim) const
returns the specialized projection operator assigned to a given type of MultiDimImplementation
static ProjectionRegister4MultiDim & Register()
a named constructor that constructs one and only one Register per data type
gum is the global namespace for all aGrUM entities
void registerProjection(const std::string &projection_name, const std::string &type_multidim, typename ProjectionRegister4MultiDim< GUM_SCALAR >::ProjectionPtr function)
A function to more easily register new projection functions in MultiDims.
A container for registering projection functions on multiDimImplementations.