Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
poolslot.h
Go to the documentation of this file.
30#pragma once
31
36
37namespace abacus {
38
39class Sub;
40
41template<class BaseType, class CoType> class Pool;
42template<class BaseType, class CoType> class PoolSlotRef;
43template<class BaseType, class CoType> class StandardPool;
44template<class BaseType, class CoType> class NonDuplPool;
45template<class BaseType, class CoType> class CutBuffer;
46
47
49
77template<class BaseType, class CoType> class OGDF_EXPORT PoolSlot : public AbacusRoot {
78
79 friend class PoolSlotRef<BaseType,CoType>;
80 friend class Pool<BaseType,CoType>;
81 friend class StandardPool<BaseType,CoType>;
82 friend class CutBuffer<BaseType,CoType>;
83
84 friend class Sub;
85 friend class PoolSlotRef<Constraint, Variable>;
86 friend class PoolSlotRef<Variable, Constraint>;
87 friend class Pool<Constraint, Variable>;
88 friend class Pool<Variable, Constraint>;
89 friend class StandardPool<Constraint, Variable>;
90 friend class StandardPool<Variable, Constraint>;
91 friend class NonDuplPool<Constraint, Variable>;
92 friend class NonDuplPool<Variable, Constraint>;
93 friend class CutBuffer<Constraint, Variable>;
94 friend class CutBuffer<Variable, Constraint>;
95
96public:
97
99
110 BaseType *convar = 0);
111
113
115 BaseType *conVar() const { return conVar_; }
116
117
118private:
119
121
127
129
135 if (conVar_ == nullptr)
136 return 0;
137 if (conVar_->deletable() == false)
138 return 1;
139 hardDelete();
140 return 0;
141 }
142
144
147 void hardDelete() {
148 delete conVar_;
149 conVar_ = nullptr;
150 }
151
154 pool_->removeConVar(this);
155 }
156
158 unsigned long version() const { return version_; }
159
161 Master *master() { return master_; }
162
164 const Master *master() const { return master_; }
165
168 unsigned long version_;
170
171
175
177};
178
179}
180
Base class of all other classes of ABACUS.
Definition abacusroot.h:68
Forms the virtual base class for all possible constraints given in pool format.
Definition constraint.h:56
Cut buffers.
Definition cutbuffer.h:52
The master of the optimization.
Definition master.h:69
Standard pools without constraint duplication.
Definition nonduplpool.h:58
Base class for constraint/variabe pools.
Definition pool.h:62
Stores constraints and variables.
Definition poolslot.h:77
Master * master()
Returns a pointer to the corresponding master of the optimization.
Definition poolslot.h:161
BaseType * conVar_
A pointer to the constraint/variable.
Definition poolslot.h:167
int softDelete()
Tries to remove the item from the slot.
Definition poolslot.h:134
const Master * master() const
Returns a const pointer to the corresponding master of the optimization.
Definition poolslot.h:164
void insert(BaseType *convar)
Inserts a constraint/variable in the slot and updates the version number.
void removeConVarFromPool()
Removes the constraint contained in this slot from its pool.
Definition poolslot.h:153
unsigned long version() const
Return the version number of the constraint/variable in the slot.
Definition poolslot.h:158
Pool< BaseType, CoType > * pool_
A pointer to the corresponding pool.
Definition poolslot.h:169
const PoolSlot< BaseType, CoType > & operator=(const PoolSlot< BaseType, CoType > &rhs)
PoolSlot(Master *master, Pool< BaseType, CoType > *pool, BaseType *convar=0)
Creates a pool slot and inserts convar.
void hardDelete()
Deletes the constraint/variable in the slot.
Definition poolslot.h:147
PoolSlot(const PoolSlot< BaseType, CoType > &rhs)
Master * master_
A pointer to the corresponding master of the optimization.
Definition poolslot.h:166
BaseType * conVar() const
Returns a pointer to the constraint/variable in the pool slot.
Definition poolslot.h:115
unsigned long version_
The version of the constraint in the slot.
Definition poolslot.h:168
Stores a pointer to a pool slot with version number.
Definition poolslotref.h:54
Standard pools.
The subproblem.
Definition sub.h:68
Forms the virtual base class for all possible variables given in pool format.
Definition variable.h:59
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition config.h:101
constraint.
#define OGDF_NEW_DELETE
Makes the class use OGDF's memory allocator.
Definition memory.h:84
the master of the optimization.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
variable.