33#pragma GCC visibility push(default)
37template<
class BaseType,
class CoType>
42 PoolSlot<BaseType, CoType>* slot;
45 if (slot ==
nullptr) {
48 hash_.insert(cv->hashKey(), slot);
58template<
class BaseType,
class CoType>
62 int key = cv->hashKey();
64 PoolSlot<BaseType, CoType> **cand = hash_.initializeIteration(key);
66 if (cv->equal((*cand)->conVar())) {
69 cand = hash_.next(key);
74template<
class BaseType,
class CoType>
76 const BaseType *cv)
const
78 int key = cv->hashKey();
80 PoolSlot<BaseType, CoType> *
const *cand = hash_.initializeIteration(key);
82 if (cv->equal((*cand)->conVar())) {
85 cand = hash_.next(key);
90template<
class BaseType,
class CoType>
93 int key = slot->conVar()->hashKey();
96 if (hash_.remove(key, slot)) {
99 Logger::ifout() <<
"NonDuplPool::softDeleteCon(): slot not found in hash table.\n";
109template<
class BaseType,
class CoType>
111 PoolSlot<BaseType, CoType> *slot)
113 if (hash_.remove(slot->conVar()->hashKey(), slot)) {
116 Logger::ifout() <<
"NonDuplPool::hardDeleteConVar(): constraint not found in hash table.\n";
124#pragma GCC visibility pop
virtual int softDeleteConVar(PoolSlot< BaseType, CoType > *slot)
Has to be redefined because the slot has to be removed from the hash table if the constraint/variable...
virtual PoolSlot< BaseType, CoType > * present(BaseType *cv)
Checks if constraint/variables cv is already contained in the pool.
virtual PoolSlot< BaseType, CoType > * insert(BaseType *cv)
Insert constraint/variable cv in the pool.
virtual void hardDeleteConVar(PoolSlot< BaseType, CoType > *slot)
Has to be redefined because the pool slot has to be removed from the hash table.
virtual void hardDeleteConVar(PoolSlot< BaseType, CoType > *slot)
Removes a constraint/variable from the pool and adds the slot to the set of free slots.
virtual int softDeleteConVar(PoolSlot< BaseType, CoType > *slot)
Removes the constraint/variable stored in slot from the pool if it can be deleted.
virtual PoolSlot< BaseType, CoType > * insert(BaseType *cv)
Tries to insert a constraint/variable in the pool.
static std::ostream & ifout()
stream for forced output (global; used by internal libraries, e.g. Abacus)
#define OGDF_THROW_PARAM(CLASS, PARAM)
Replacement for throw.
standard pool without constraint duplication.