Developer Documentation
OpenVolumeMesh::OpenVolumeMeshPropertyT< T > Class Template Reference

Default property class for any type T. More...

#include <Type-OpenVolumeMesh/libs/OpenVolumeMesh/src/OpenVolumeMesh/Core/OpenVolumeMeshProperty.hh>

Inheritance diagram for OpenVolumeMesh::OpenVolumeMeshPropertyT< T >:
OpenVolumeMesh::OpenVolumeMeshBaseProperty

Public Types

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

Public Member Functions

 OpenVolumeMeshPropertyT (const std::string &_name, const std::string &_internal_type_name, const T &_def=T())
 
 OpenVolumeMeshPropertyT (const OpenVolumeMeshPropertyT &_rhs)=default
 
void reserve (size_t _n) override
 Reserve memory for n elements.
 
void resize (size_t _n) override
 Resize storage to hold n elements.
 
size_t size () const override
 Return underlying container size.
 
void clear () override
 Clear all elements and free memory.
 
void push_back () override
 Extend the number of elements by one.
 
void swap (size_t _i0, size_t _i1) override
 Let two elements swap their storage place.
 
virtual void copy (size_t _src_idx, size_t _dst_idx)
 
void delete_element (size_t _idx) override
 Erase an element of the vector.
 
size_t n_elements () const override
 Number of elements in property.
 
size_t element_size () const override
 Size of one element in bytes or UnknownSize if not known.
 
size_t size_of () const override
 Return size of property in bytes.
 
size_t size_of (size_t _n_elem) const override
 
void serialize (std::ostream &_ostr) const override
 
void deserialize (std::istream &_istr) override
 
const T * data () const
 Get pointer to array (does not work for T==bool)
 
vector_type & data_vector ()
 Get reference to property vector (be careful, improper usage, e.g. resizing, may crash)
 
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!
 
OpenVolumeMeshPropertyT< T > * clone () const override
 Make a copy of self.
 
vector_type::const_iterator begin () const
 
vector_type::iterator begin ()
 
vector_type::const_iterator end () const
 
vector_type::iterator end ()
 
template<>
void swap (size_t _i0, size_t _i1)
 Let two elements swap their storage place.
 
template<>
size_t size_of (size_t _n_elem) const
 
template<>
size_t size_of () const
 Return size of property in bytes.
 
template<>
size_t element_size () const
 Size of one element in bytes or UnknownSize if not known.
 
template<>
void deserialize (std::istream &_istr)
 
template<>
size_t size_of (size_t) const
 
template<>
size_t size_of () const
 Return size of property in bytes.
 
template<>
size_t element_size () const
 Size of one element in bytes or UnknownSize if not known.
 
- Public Member Functions inherited from OpenVolumeMesh::OpenVolumeMeshBaseProperty
 OpenVolumeMeshBaseProperty (const std::string &_name, const std::string &_internal_type_name)
 
 OpenVolumeMeshBaseProperty (const OpenVolumeMeshBaseProperty &_rhs)=default
 
const std::string & name () const
 Return the name of the property.
 
const std::string & internal_type_name () const
 
void set_persistent (bool _persistent)
 
bool persistent () const
 
const OpenVolumeMeshHandlehandle () const
 
void set_handle (const OpenVolumeMeshHandle &_handle)
 

Protected Member Functions

void delete_multiple_entries (const std::vector< bool > &_tags) override
 Delete multiple entries in list.
 

Private Attributes

vector_type data_
 
const T def_
 

Friends

template<class PropT , class Entity >
class PropertyPtr
 

Additional Inherited Members

- Static Public Attributes inherited from OpenVolumeMesh::OpenVolumeMeshBaseProperty
static const size_t UnknownSize = std::numeric_limits<size_t>::max()
 Indicates an error when a size is returned by a member.
 

Detailed Description

template<class T>
class OpenVolumeMesh::OpenVolumeMeshPropertyT< T >

Default property class for any type T.

The default property class for any type T.

Definition at line 9 of file ForwardDeclarations.hh.

Member Function Documentation

◆ size_of() [1/3]

template<class T >
size_t OpenVolumeMesh::OpenVolumeMeshPropertyT< T >::size_of ( size_t  _n_elem) const
inlineoverridevirtual

Estimated size of property if it has _n_elem elements. The member returns UnknownSize if the size cannot be estimated.

Reimplemented from OpenVolumeMesh::OpenVolumeMeshBaseProperty.

Definition at line 139 of file OpenVolumeMeshProperty.hh.

◆ size_of() [2/3]

template<>
size_t OpenVolumeMesh::OpenVolumeMeshPropertyT< bool >::size_of ( size_t  _n_elem) const
inlinevirtual

Estimated size of property if it has _n_elem elements. The member returns UnknownSize if the size cannot be estimated.

Reimplemented from OpenVolumeMesh::OpenVolumeMeshBaseProperty.

Definition at line 245 of file OpenVolumeMeshProperty.hh.

◆ size_of() [3/3]

template<>
size_t OpenVolumeMesh::OpenVolumeMeshPropertyT< std::string >::size_of ( size_t  _n_elem) const
inlinevirtual

Estimated size of property if it has _n_elem elements. The member returns UnknownSize if the size cannot be estimated.

Reimplemented from OpenVolumeMesh::OpenVolumeMeshBaseProperty.

Definition at line 277 of file OpenVolumeMeshProperty.hh.


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