Template Class PropertyArray

Inheritance Relationships

Base Type

Class Documentation

template<class T>
class PropertyArray : public pmp::BasePropertyArray

Public Types

typedef T ValueType
typedef std::vector<ValueType> VectorType
typedef VectorType::reference reference
typedef VectorType::const_reference const_reference

Public Functions

inline PropertyArray(const std::string &name, T t = T())
inline virtual void reserve(size_t n) override

Reserve memory for n elements.

inline virtual void resize(size_t n) override

Resize storage to hold n elements.

inline virtual void free_memory() override

Free unused memory.

inline virtual void shallow_clear() override

Erase the contents of the property without calling destructors.

inline virtual void swap(size_t i0, size_t i1) override

Let two elements swap their storage place.

inline virtual void copy_prop(const BasePropertyArray *src, size_t src_i, size_t dst_i) override

Copy an element from another array.

inline virtual BasePropertyArray *clone() const override

Return a deep copy of self.

inline virtual BasePropertyArray *empty_copy() const override

Return an empty copy of self.

inline virtual const std::type_info &type() const override

Return the type_info of the property.

inline T *data()

Get pointer to array (does not work for T==bool)

inline const T *data() const

Get pointer to array (does not work for T==bool)

inline VectorType &vector()

Get reference to the underlying vector.

inline const VectorType &vector() const

Get reference to the underlying vector.

inline reference operator[](size_t idx)

Access the i’th element. No range check is performed!

inline const_reference operator[](size_t idx) const

Const access to the i’th element. No range check is performed!

inline bool *data()
inline const bool *data() const
inline virtual void swap(size_t i0, size_t i1)

Let two elements swap their storage place.

inline virtual void shallow_clear()

Erase the contents of the property without calling destructors.