Stores a calculable property of an object.
More...
#include <utilities/property.h>
template<typename T, template< typename Stored > class Storage = StoreValue>
class regina::Property< T, Storage >
Stores a calculable property of an object.
The property may be marked as known or unknown, and its value may be set or retrieved.
The template parameter Storage specifies how the property will be internally stored. Storage options range from simple storage by value (see class StoreValue) to more intelligent storage options that include memory management of pointers (see class StoreManagedPtr).
- See also
- StoreValue
-
StoreConstPtr
-
StoreManagedPtr
- Python:
- Not present.
◆ InitType
template<typename T, template< typename Stored > class Storage = StoreValue>
The type by which new values for the underlying property are passed.
◆ QueryType
template<typename T, template< typename Stored > class Storage = StoreValue>
The type by which the property value is returned to the user.
◆ Property()
template<typename T, template< typename Stored > class Storage = StoreValue>
Constructor.
This property is initially marked as unknown.
◆ clear()
template<typename T, template< typename Stored > class Storage = StoreValue>
Marks this property as unknown.
◆ known()
template<typename T, template< typename Stored > class Storage = StoreValue>
Returns whether or not this property is currently marked as known.
- Returns
- whether this property is marked as known.
◆ operator=() [1/2]
template<typename T, template< typename Stored > class Storage = StoreValue>
Assigns a new value to this property.
The property will be marked as known.
- Parameters
-
newValue | the new value to assign to this property. |
- Returns
- the new value of this property.
◆ operator=() [2/2]
template<typename T, template< typename Stored > class Storage = StoreValue>
Copies the given property into this property.
If the given property is marked as known, its value will be copied and this property will also be marked as known. Otherwise this property will be marked as unknown.
- Parameters
-
newValue | the property to copy into this property. |
- Returns
- a reference to this property.
◆ swap()
template<typename T, template< typename Stored > class Storage = StoreValue>
Swaps this with the given property.
Both the known status and the values (if known) will swapped in the most efficient manner that the compiler is aware of.
- Parameters
-
other | the property to swap with this. |
◆ value()
template<typename T, template< typename Stored > class Storage = StoreValue>
Returns the current value of this property.
If this property is marked as unknown then the results are undefined.
- Precondition
- This property is currently marked as known.
- Returns
- the current value of this property.
The documentation for this class was generated from the following file: