Regina 7.0 Calculation Engine
|
Creates a temporary lock on the topological properties of the given triangulation. More...
#include <triangulation/detail/triangulation.h>
Public Member Functions | |
TopologyLock (TriangulationBase< dim > &tri) | |
Creates a new lock on the given triangulation. More... | |
~TopologyLock () | |
Removes this lock on the associated triangulation. More... | |
TopologyLock (const TopologyLock &)=delete | |
TopologyLock & | operator= (const TopologyLock &)=delete |
Creates a temporary lock on the topological properties of the given triangulation.
While this object exists, any computed properties of the underlying manifold will be preserved even when the triangulation changes. This allows you to avoid recomputing expensive invariants when the underlying manifold is retriangulated.
The lock will be created by the class constructor and removed by the class destructor. That is, the lock will remain in effect until the TopologyLock object goes out of scope (or is otherwise destroyed).
Multiple locks are allowed. If multiple locks are created, then computed properties of the manifold will be preserved as long as any one of these locks still exists. Multiple locks do not necessarily need to be nested (i.e., the order of destruction does not need to be the reverse order of construction).
Regina is currently only able to handle 255 distinct locks on the same triangulation at a time. This should be enormously more than enough (since external users cannot construct TopologyLock objects, and Regina's own code should not be recursing deeply inside TopologyLock scopes). However, even if there are somehow more than 255 locks, the worst that will happen is some CPU wastage: some properties may be cleared and need to be recomputed when this was not mathematically necessary.
TopologyLock objects are not copyable, movable or swappable. In particular, Regina does not offer any way for a TopologyLock to transfer its destructor's responsibilities (i.e., "unlocking" the topological properties of the triangulation) to another object.
|
inline |
Creates a new lock on the given triangulation.
tri | the triangulation whose topological properties are to be locked. This may be null (in which case the lock has no effect). |
|
inline |
Removes this lock on the associated triangulation.