OpenMesh::PropertyT< T > Class Template Reference

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

#include <OpenMesh/Core/Utils/PropertyT.hh>

Inheritance diagram for OpenMesh::PropertyT< T >:
Inheritance graph
[legend]

List of all members.

Classes

struct  plus

Public Types

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

Public Member Functions

virtual void clear ()
 Clear all elements and free memory.
PropertyT< T > * clone () const
 Make a copy of self.
const T * data () const
 Get pointer to array (does not work for T==bool).
vector_typedata_vector ()
 Get reference to property vector (be careful, improper usage, e.g. resizing, may crash OpenMesh!!!).
virtual size_t element_size () const
 Size of one element in bytes or UnknownSize if not known.
virtual size_t n_elements () const
 Number of elements in property.
const_reference operator[] (int _idx) const
 Const access to the i'th element. No range check is performed!
reference operator[] (int _idx)
 Access the i'th element. No range check is performed!
 PropertyT (const PropertyT &_rhs)
 Copy constructor.
 PropertyT (const std::string &_name="<unknown>")
 Default constructor.
virtual void push_back ()
 Extend the number of elements by one.
virtual void reserve (size_t _n)
 Reserve memory for n elements.
virtual void resize (size_t _n)
 Resize storage to hold n elements.
virtual size_t restore (std::istream &_istr, bool _swap)
virtual void set_persistent (bool _yn)
virtual size_t size_of (size_t _n_elem) const
virtual size_t size_of (void) const
 Return size of property in bytes.
virtual size_t store (std::ostream &_ostr, bool _swap) const
 Store self as one binary block.
virtual void swap (size_t _i0, size_t _i1)
 Let two elements swap their storage place.

Private Attributes

vector_type data_

Detailed Description

template<class T>
class OpenMesh::PropertyT< T >

Default property class for any type T.

The default property class for any type T.

The property supports persistency if T is a "fundamental" type:

Persistency of non-fundamental types is supported if and only if a specialization of struct IO::binary<> exists for the wanted type.

Property.hh <OpenMesh/Core/Utils/PropertyT.hh>

Property specialization for bool type. The data will be stored as a bitset.

Property.hh <OpenMesh/Core/Utils/PropertyT.hh>

Property specialization for std::string type.

Definition at line 87 of file Property.hh.


Member Typedef Documentation

template<class T>
typedef vector_type::const_reference OpenMesh::PropertyT< T >::const_reference

Definition at line 95 of file Property.hh.

template<class T>
typedef vector_type::reference OpenMesh::PropertyT< T >::reference

Definition at line 94 of file Property.hh.

template<class T>
typedef T OpenMesh::PropertyT< T >::Value

Definition at line 91 of file Property.hh.

template<class T>
typedef T OpenMesh::PropertyT< T >::value_type

Definition at line 93 of file Property.hh.

template<class T>
typedef std::vector<T> OpenMesh::PropertyT< T >::vector_type

Definition at line 92 of file Property.hh.


Constructor & Destructor Documentation

template<class T>
OpenMesh::PropertyT< T >::PropertyT ( const std::string &  _name = "<unknown>"  )  [inline]

Default constructor.

Definition at line 100 of file Property.hh.

template<class T>
OpenMesh::PropertyT< T >::PropertyT ( const PropertyT< T > &  _rhs  )  [inline]

Copy constructor.

Definition at line 105 of file Property.hh.


Member Function Documentation

template<class T>
virtual void OpenMesh::PropertyT< T >::clear (  )  [inline, virtual]

Clear all elements and free memory.

Implements OpenMesh::BaseProperty.

Definition at line 112 of file Property.hh.

template<class T>
PropertyT<T>* OpenMesh::PropertyT< T >::clone (  )  const [inline, virtual]

Make a copy of self.

Implements OpenMesh::BaseProperty.

Definition at line 194 of file Property.hh.

template<class T>
const T* OpenMesh::PropertyT< T >::data (  )  const [inline]

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

Definition at line 165 of file Property.hh.

template<class T>
vector_type& OpenMesh::PropertyT< T >::data_vector (  )  [inline]

Get reference to property vector (be careful, improper usage, e.g. resizing, may crash OpenMesh!!!).

Definition at line 174 of file Property.hh.

template<class T>
virtual size_t OpenMesh::PropertyT< T >::element_size (  )  const [inline, virtual]

Size of one element in bytes or UnknownSize if not known.

Implements OpenMesh::BaseProperty.

Definition at line 123 of file Property.hh.

template<class T>
virtual size_t OpenMesh::PropertyT< T >::n_elements (  )  const [inline, virtual]

Number of elements in property.

Implements OpenMesh::BaseProperty.

Definition at line 122 of file Property.hh.

template<class T>
const_reference OpenMesh::PropertyT< T >::operator[] ( int  _idx  )  const [inline]

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

Definition at line 187 of file Property.hh.

template<class T>
reference OpenMesh::PropertyT< T >::operator[] ( int  _idx  )  [inline]

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

Definition at line 180 of file Property.hh.

template<class T>
virtual void OpenMesh::PropertyT< T >::push_back (  )  [inline, virtual]

Extend the number of elements by one.

Implements OpenMesh::BaseProperty.

Definition at line 113 of file Property.hh.

template<class T>
virtual void OpenMesh::PropertyT< T >::reserve ( size_t  _n  )  [inline, virtual]

Reserve memory for n elements.

Implements OpenMesh::BaseProperty.

Definition at line 110 of file Property.hh.

template<class T>
virtual void OpenMesh::PropertyT< T >::resize ( size_t  _n  )  [inline, virtual]

Resize storage to hold n elements.

Implements OpenMesh::BaseProperty.

Definition at line 111 of file Property.hh.

template<class T>
virtual size_t OpenMesh::PropertyT< T >::restore ( std::istream &  _istr,
bool  _swap 
) [inline, virtual]

Restore self from a binary block. Uses reserve() to set the size of self before restoring.

Implements OpenMesh::BaseProperty.

Definition at line 152 of file Property.hh.

template<class T>
virtual void OpenMesh::PropertyT< T >::set_persistent ( bool  _yn  )  [inline, virtual]

Enable or disable persistency. Self must be a named property to enable persistency.

Implements OpenMesh::BaseProperty.

Definition at line 119 of file Property.hh.

template<class T>
virtual size_t OpenMesh::PropertyT< T >::size_of ( size_t  _n_elem  )  const [inline, virtual]

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

Reimplemented from OpenMesh::BaseProperty.

Definition at line 139 of file Property.hh.

template<class T>
virtual size_t OpenMesh::PropertyT< T >::size_of ( void   )  const [inline, virtual]

Return size of property in bytes.

Reimplemented from OpenMesh::BaseProperty.

Definition at line 132 of file Property.hh.

template<class T>
virtual size_t OpenMesh::PropertyT< T >::store ( std::ostream &  _ostr,
bool  _swap 
) const [inline, virtual]

Store self as one binary block.

Implements OpenMesh::BaseProperty.

Definition at line 142 of file Property.hh.

template<class T>
virtual void OpenMesh::PropertyT< T >::swap ( size_t  _i0,
size_t  _i1 
) [inline, virtual]

Let two elements swap their storage place.

Implements OpenMesh::BaseProperty.

Definition at line 114 of file Property.hh.


Member Data Documentation

template<class T>
vector_type OpenMesh::PropertyT< T >::data_ [private]

Definition at line 203 of file Property.hh.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


openmesh
Author(s): Benjamin Pitzer
autogenerated on Fri Jan 11 12:11:16 2013