51#ifndef DOXYGEN_SHOULD_SKIP_THIS
60 template <
typename GUM_SCALAR >
62 const std::string& operation_name,
63 const std::string& type1,
64 const std::string& type2,
69 if (!_set_.exists(operation_name)) {
70 theset = _set_.insert(operation_name,
new OperatorSet).second;
75 __debug__::_inc_deletion_(
"HashTable", __FILE__, __LINE__,
"destructor of", (
void*)theset);
78 theset = _set_[operation_name];
81 std::pair< std::string, std::string > thepair(type1, type2);
83 theset->insert(thepair, newFunction);
87 template <
typename GUM_SCALAR >
89 const std::string& type1,
90 const std::string& type2) {
91 if (!_set_.exists(operation_name))
return;
93 OperatorSet* theset = _set_[operation_name];
95 theset->erase(std::pair< std::string, std::string >(type1, type2));
99 template <
typename GUM_SCALAR >
101 const std::string& type1,
102 const std::string& type2)
const {
103 if (!_set_.exists(operation_name))
return false;
104 const OperatorSet& theset = *(_set_[operation_name]);
105 const std::pair< std::string, std::string > key(type1, type2);
106 return theset.exists(key);
111 template <
typename GUM_SCALAR >
114 const std::string& type1,
115 const std::string& type2)
const {
116 const OperatorSet& theset = *(_set_[operation_name]);
117 const std::pair< std::string, std::string > key(type1, type2);
123 template <
typename GUM_SCALAR >
128# ifdef GUM_DEBUG_MODE
129 static std::atomic_flag first = ATOMIC_FLAG_INIT;
130 if (!first.test_and_set()) {
134 __debug__::_inc_deletion_(
"HashTable",
138 (
void*)&container._set_);
146 template <
typename GUM_SCALAR >
150 template <
typename GUM_SCALAR >
154 iter != _set_.endSafe();
160 template <
typename GUM_SCALAR >
162 const std::string& type1,
163 const std::string& type2,
HashTableIteratorSafe< Key, Val > iterator_safe
Types for STL compliance.
A container for registering binary functions on multiDimImplementations.
~OperatorRegister4MultiDim()
Destructor.
void insert(const std::string &operation_name, const std::string &type1, const std::string &type2, OperatorPtr newFunction)
adds a new entry into the register
MultiDimImplementation< GUM_SCALAR > *(*)(const MultiDimImplementation< GUM_SCALAR > *, const MultiDimImplementation< GUM_SCALAR > *) OperatorPtr
The type of functions used by the register.
void erase(const std::string &operation_name, const std::string &type1, const std::string &type2)
removes a given entry from the register
OperatorRegister4MultiDim()
Default constructor: creates an empty register.
OperatorPtr get(const std::string &operation_name, const std::string &type1, const std::string &type2) const
returns the specialized operator assigned to a given pair of MultiDimImplementations
static OperatorRegister4MultiDim< GUM_SCALAR > & Register()
A named constructor that constructs one and only one Register per data type.
bool exists(const std::string &operation_name, const std::string &type1, const std::string &type2) const
Indicates whether a given entry exists in the register.
gum is the global namespace for all aGrUM entities
void registerOperator(const std::string &operation_name, const std::string &type1, const std::string &type2, typename OperatorRegister4MultiDim< GUM_SCALAR >::OperatorPtr function)
A function to more easily register new operators in MultiDims.
A container for registering binary functions on multiDimImplementations.