Regina 7.4 Calculation Engine
|
An object that facilitates firing packetToBeChanged() and packetWasChanged() events. More...
#include <packet/packet.h>
Public Member Functions | |
PacketChangeSpan (PacketData &data) | |
Creates a new change event object for the given Held data. | |
~PacketChangeSpan () | |
Destroys this change event object. | |
Held & | held () const |
Returns the underlying Held object. | |
PacketChangeSpan (const PacketChangeSpan &)=delete | |
PacketChangeSpan & | operator= (const PacketChangeSpan &)=delete |
Protected Attributes | |
PacketData & | data_ |
The object for which - if it belongs to a PacketOf<Held> - change events will be fired. | |
An object that facilitates firing packetToBeChanged() and packetWasChanged() events.
This performs the same function as Packet::PacketChangeSpan; see that class for full details on how it works. The main differences are:
Just like Packet::PacketChangeSpan, these objects can be nested so that only the outermost object will fire change events; furthermore, PacketData<Held>::PacketChangeSpan objects and Packet::PacketChangeSpan objects can be nested within each other.
Also, just like Packet::PacketChangeSpan and Packet::PacketChangeGroup, there is an equivalent type PacketData::PacketChangeGroup whose purpose is to indicate to the reader that the an object is being used only to merge many event pairs into a single event pair.
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.
PacketChangeSpan objects are not copyable, movable or swappable. In particular, Regina does not offer any way for a PacketChangeSpan 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 PacketChangeSpan 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 PacketChangeSpan currently in existence for it, then this destructor will call PacketListener::packetWasChanged() for all registered listeners for the packet.
|
inline |
Returns the underlying Held object.
|
protected |
The object for which - if it belongs to a PacketOf<Held> - change events will be fired.