Regina 7.3 Calculation Engine
Public Member Functions | List of all members
regina::PacketData< Held >::ChangeEventSpan Class Reference

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
 
ChangeEventSpanoperator= (const ChangeEventSpan &)=delete
 

Detailed Description

template<typename Held>
class regina::PacketData< Held >::ChangeEventSpan

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.

Python
Not present.

Constructor & Destructor Documentation

◆ ChangeEventSpan()

template<typename Held >
regina::PacketData< Held >::ChangeEventSpan::ChangeEventSpan ( PacketData data)
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.

Parameters
datathe object whose data is about to change; this may or may not be of the subclass PacketOf<Held>.

◆ ~ChangeEventSpan()

template<typename Held >
regina::PacketData< Held >::ChangeEventSpan::~ChangeEventSpan
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.


The documentation for this class was generated from the following file:

Copyright © 1999-2023, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@maths.uq.edu.au).