Easy3D 2.5.3
PropertyArray< T > Class Template Reference

Implementation of a generic property array. More...

Inheritance diagram for PropertyArray< T >:
BasePropertyArray

Public Types

typedef T value_type
 
typedef std::vector< value_type > vector_type
 
typedef vector_type::reference reference
 
typedef vector_type::const_reference const_reference
 

Public Member Functions

 PropertyArray (const std::string &name, T t=T())
 
void reserve (size_t n) override
 Reserve memory for n elements. More...
 
void resize (size_t n) override
 Resize storage to hold n elements. More...
 
void push_back () override
 Extend the number of elements by one. More...
 
void reset (size_t idx) override
 Reset element to default value. More...
 
bool transfer (const BasePropertyArray &other) override
 Copy the entire properties from other. More...
 
bool transfer (const BasePropertyArray &other, std::size_t from, std::size_t to) override
 Copy the property[from] of other to this->property[to]. More...
 
void shrink_to_fit () override
 Free unused memory. More...
 
void swap (size_t i0, size_t i1) override
 Let two elements swap their storage place. More...
 
void copy (size_t from, size_t to) override
 Let copy 'from' -> 'to'. More...
 
BasePropertyArrayclone () const override
 Return a deep copy of self. More...
 
BasePropertyArrayempty_clone () const override
 Return a empty copy of self. More...
 
const std::type_info & type () const override
 Return the type_info of the property. More...
 
const T * data () const
 Get pointer to array (does not work for T==bool)
 
std::vector< T > & vector ()
 Get reference to the underlying vector.
 
reference operator[] (size_t _idx)
 Access the i'th element. No range check is performed!
 
const_reference operator[] (size_t _idx) const
 Const access to the i'th element. No range check is performed!
 
const bool * data () const
 
- Public Member Functions inherited from BasePropertyArray
 BasePropertyArray (const std::string &name)
 Default constructor.
 
virtual ~BasePropertyArray ()=default
 Destructor.
 
virtual void reserve (size_t n)=0
 Reserve memory for n elements. More...
 
virtual void resize (size_t n)=0
 Resize storage to hold n elements. More...
 
virtual void shrink_to_fit ()=0
 Free unused memory. More...
 
virtual void push_back ()=0
 Extend the number of elements by one. More...
 
virtual void reset (size_t idx)=0
 Reset element to default value. More...
 
virtual bool transfer (const BasePropertyArray &other)=0
 Copy the entire properties from other. More...
 
virtual bool transfer (const BasePropertyArray &other, std::size_t from, std::size_t to)=0
 Copy the property[from] of other to this->property[to]. More...
 
virtual void swap (size_t i0, size_t i1)=0
 Let two elements swap their storage place. More...
 
virtual void copy (size_t from, size_t to)=0
 Let copy 'from' -> 'to'. More...
 
virtual BasePropertyArrayclone () const =0
 Return a deep copy of self. More...
 
virtual BasePropertyArrayempty_clone () const =0
 Return a empty copy of self. More...
 
virtual const std::type_info & type () const =0
 Return the type_info of the property. More...
 
const std::string & name () const
 Return the name of the property.
 
void set_name (const std::string &n)
 Set the name of the property.
 
bool is_same (const BasePropertyArray &other) const
 

Detailed Description

template<class T>
class easy3d::PropertyArray< T >

Implementation of a generic property array.

Member Function Documentation

◆ clone()

BasePropertyArray * clone ( ) const
inlineoverridevirtual

Return a deep copy of self.

Implements BasePropertyArray.

◆ copy()

void copy ( size_t  from,
size_t  to 
)
inlineoverridevirtual

Let copy 'from' -> 'to'.

Implements BasePropertyArray.

◆ empty_clone()

BasePropertyArray * empty_clone ( ) const
inlineoverridevirtual

Return a empty copy of self.

Implements BasePropertyArray.

◆ push_back()

void push_back ( )
inlineoverridevirtual

Extend the number of elements by one.

Implements BasePropertyArray.

◆ reserve()

void reserve ( size_t  n)
inlineoverridevirtual

Reserve memory for n elements.

Implements BasePropertyArray.

◆ reset()

void reset ( size_t  idx)
inlineoverridevirtual

Reset element to default value.

Implements BasePropertyArray.

◆ resize()

void resize ( size_t  n)
inlineoverridevirtual

Resize storage to hold n elements.

Implements BasePropertyArray.

◆ shrink_to_fit()

void shrink_to_fit ( )
inlineoverridevirtual

Free unused memory.

Implements BasePropertyArray.

◆ swap()

void swap ( size_t  i0,
size_t  i1 
)
inlineoverridevirtual

Let two elements swap their storage place.

Implements BasePropertyArray.

◆ transfer() [1/2]

bool transfer ( const BasePropertyArray< T > &  other)
inlineoverridevirtual

Copy the entire properties from other.

Implements BasePropertyArray.

◆ transfer() [2/2]

bool transfer ( const BasePropertyArray< T > &  other,
std::size_t  from,
std::size_t  to 
)
inlineoverridevirtual

Copy the property[from] of other to this->property[to].

Implements BasePropertyArray.

◆ type()

const std::type_info & type ( ) const
inlineoverridevirtual

Return the type_info of the property.

Implements BasePropertyArray.


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