44 #ifndef OPENVOLUMEMESHBASEPROPERTY_HH 45 #define OPENVOLUMEMESHBASEPROPERTY_HH 51 #include "OpenVolumeMeshHandle.hh" 67 template <
class PropT,
class HandleT>
friend class PropertyPtr;
75 name_(_name), persistent_(false), handle_(-1) {
85 virtual void reserve(
size_t _n) = 0;
88 virtual void resize(
size_t _n) = 0;
91 virtual void clear() = 0;
97 virtual void swap(
size_t _i0,
size_t _i1) = 0;
106 const std::string&
name()
const {
111 virtual void serialize(std::ostream& )
const {}
114 virtual void deserialize(std::istream& ) {}
117 void set_persistent(
bool _persistent) { persistent_ = _persistent; }
119 bool persistent()
const {
return persistent_; }
134 virtual size_t size_of(
size_t _n_elem)
const {
159 #endif //OPENVOLUMEMESHBASEPROPERTY_HH virtual size_t element_size() const =0
Size of one element in bytes or UnknownSize if not known.
virtual void clear()=0
Clear all elements and free memory.
virtual void push_back()=0
Extend the number of elements by one.
virtual size_t size_of(size_t _n_elem) const
virtual OpenVolumeMeshBaseProperty * clone() const =0
Return a deep copy of self.
virtual void reserve(size_t _n)=0
Reserve memory for n elements.
virtual size_t n_elements() const =0
Number of elements in property.
const std::string & name() const
Return the name of the property.
virtual void delete_element(size_t _idx)=0
Erase an element of the vector.
virtual void swap(size_t _i0, size_t _i1)=0
Let two elements swap their storage place.
virtual void resize(size_t _n)=0
Resize storage to hold n elements.
static const size_t UnknownSize
Indicates an error when a size is returned by a member.
virtual size_t size_of() const
Return size of property in bytes.
virtual void delete_multiple_entries(const std::vector< bool > &)=0
Delete multiple entries in list.