Regina 7.0 Calculation Engine
|
An object that facilitates firing packetToBeChanged() and packetWasChanged() events. More...
#include <packet/packet.h>
Public Member Functions | |
ChangeEventSpan (PacketData &data) | |
Creates a new change event object for the given Held data. More... | |
~ChangeEventSpan () | |
Destroys this change event object. More... | |
ChangeEventSpan (const ChangeEventSpan &)=delete | |
ChangeEventSpan & | operator= (const ChangeEventSpan &)=delete |
An object that facilitates firing packetToBeChanged() and packetWasChanged() events.
This performs the same function as Packet::ChangeEventSpan; see that class for full details on how it works. The main differences are:
Just like Packet::ChangeEventSpan, these objects can be nested so that only the outermost object will fire change events; furthermore, PacketData<Held>::ChangeEventSpan objects and Packet::ChangeEventSpan objects can be nested within each other.
When working with PacketData<Triangulation<3>>, this class includes special code that nullifies a SnapPea triangulation when its inherited Triangulation<3> data changes unexpectedly. See the SnapPeaTriangulation class for details.
ChangeEventSpan objects are not copyable, movable or swappable. In particular, Regina does not offer any way for a ChangeEventSpan to transfer its duty (i.e., firing events upon destruction) to another object.
|
inline |
Creates a new change event object for the given Held data.
If data is part of a PacketOf<Held>, and this is the only ChangeEventSpan currently in existence for data, then this constructor will call PacketListener::packetToBeChanged() for all registered listeners for the packet.
data | the object whose data is about to change; this may or may not be of the subclass PacketOf<Held>. |
|
inline |
Destroys this change event object.
If the underlying Held object is part of a PacketOf<Held>, and this is the only ChangeEventSpan currently in existence for it, then this destructor will call PacketListener::packetWasChanged() for all registered listeners for the packet.