regina::NProperty< T, Storage > Class Template Reference
Utilities

Stores a calculable property of an object. More...

`#include <utilities/nproperty.h>`

Inheritance diagram for regina::NProperty< T, Storage >:

## Public Types

typedef Storage< T >::InitType | InitType
| The type by which new values for the underlying property are passed. More...
typedef Storage< T >::QueryType | QueryType
| The type by which the property value is returned to the user. More...

## Public Member Functions

| NProperty ()
| Constructor. More...
QueryType | value () const
| Returns the current value of this property. More...
QueryType | operator= (InitType newValue)
| Assigns a new value to this property. More...
const NProperty< T, Storage > & | operator= (const NProperty< T, Storage > &newValue)
| Copies the given property into this property. More...
bool | known () const
| Returns whether or not this property is currently marked as known. More...
void | clear ()
| Marks this property as unknown. More...

## Detailed Description

### template<typename T, template< typename Stored > class Storage = StoreValue>
class regina::NProperty< 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.

## Member Typedef Documentation

template<typename T, template< typename Stored > class Storage = StoreValue>

typedef Storage<T>::InitType regina::NProperty< T, Storage >::InitType

The type by which new values for the underlying property are passed.

template<typename T, template< typename Stored > class Storage = StoreValue>

typedef Storage<T>::QueryType regina::NProperty< T, Storage >::QueryType

The type by which the property value is returned to the user.

## Constructor & Destructor Documentation

template<typename T, template< typename Stored > class Storage = StoreValue>

regina::NProperty< T, Storage >::NProperty | ( |  | ) |

inline

Constructor.

This property is initially marked as unknown.

## Member Function Documentation

template<typename T, template< typename Stored > class Storage = StoreValue>

void regina::NProperty< T, Storage >::clear | ( |  | ) |

inline virtual

Marks this property as unknown.

Implements regina::NPropertyBase.

template<typename T, template< typename Stored > class Storage = StoreValue>

bool regina::NProperty< T, Storage >::known | ( |  | ) | const

inline virtual

Returns whether or not this property is currently marked as known.

Returns
  whether this property is marked as known.

Implements regina::NPropertyBase.

template<typename T, template< typename Stored > class Storage = StoreValue>

QueryType regina::NProperty< T, Storage >::operator= | ( | InitType | newValue | ) |

inline

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.

template<typename T, template< typename Stored > class Storage = StoreValue>

const NProperty<T, Storage>& regina::NProperty< T, Storage >::operator= | ( | const NProperty< T, Storage > & | newValue | ) |

inline

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.

template<typename T, template< typename Stored > class Storage = StoreValue>

QueryType regina::NProperty< T, Storage >::value | ( |  | ) | const

inline

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:

- utilities/nproperty.h

Copyright © 1999-2014, 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@debian.org).