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) {
79 name_(_rhs.name_), persistent_(_rhs.persistent_), handle_(_rhs.handle_.idx()) {
87 virtual void reserve(
size_t _n) = 0;
90 virtual void resize(
size_t _n) = 0;
93 virtual void clear() = 0;
99 virtual void swap(
size_t _i0,
size_t _i1) = 0;
108 const std::string&
name()
const {
113 virtual void serialize(std::ostream& )
const {}
116 virtual void deserialize(std::istream& ) {}
119 void set_persistent(
bool _persistent) { persistent_ = _persistent; }
121 bool persistent()
const {
return persistent_; }
136 virtual size_t size_of(
size_t _n_elem)
const {
143 void set_handle(
const OpenVolumeMeshHandle& _handle) { handle_.idx(_handle.idx()); }
156 OpenVolumeMeshHandle handle_;
161 #endif //OPENVOLUMEMESHBASEPROPERTY_HH
virtual void delete_element(size_t _idx)=0
Erase an element of the vector.
static const size_t UnknownSize
Indicates an error when a size is returned by a member.
virtual size_t n_elements() const =0
Number of elements in property.
virtual void delete_multiple_entries(const std::vector< bool > &)=0
Delete multiple entries in list.
virtual void reserve(size_t _n)=0
Reserve memory for n elements.
virtual OpenVolumeMeshBaseProperty * clone() const =0
Return a deep copy of self.
virtual size_t size_of(size_t _n_elem) const
virtual void swap(size_t _i0, size_t _i1)=0
Let two elements swap their storage place.
const std::string & name() const
Return the name of the property.
virtual void resize(size_t _n)=0
Resize storage to hold n elements.
virtual void clear()=0
Clear all elements and free memory.
virtual size_t size_of() const
Return size of property in bytes.
virtual size_t element_size() const =0
Size of one element in bytes or UnknownSize if not known.
virtual void push_back()=0
Extend the number of elements by one.