35 #ifndef OPENVOLUMEMESHBASEPROPERTY_HH 36 #define OPENVOLUMEMESHBASEPROPERTY_HH 42 #include "OpenVolumeMeshHandle.hh" 56 template <
class PropT,
class HandleT>
friend class PropertyPtr;
64 const std::string& _name,
65 const std::string& _internal_type_name)
67 internal_type_name_(_internal_type_name),
79 virtual void reserve(
size_t _n) = 0;
82 virtual void resize(
size_t _n) = 0;
85 virtual size_t size()
const = 0;
88 virtual void clear() = 0;
94 virtual void swap(
size_t _i0,
size_t _i1) = 0;
103 const std::string&
name()
const {
107 const std::string& internal_type_name()
const {
108 return internal_type_name_;
112 virtual void serialize(std::ostream& )
const {}
115 virtual void deserialize(std::istream& ) {}
118 void set_persistent(
bool _persistent) { persistent_ = _persistent; }
120 bool persistent()
const {
return persistent_; }
135 virtual size_t size_of(
size_t _n_elem)
const {
152 std::string internal_type_name_;
161 #endif //OPENVOLUMEMESHBASEPROPERTY_HH
const std::string & name() const
Return the name of the property.
virtual void reserve(size_t _n)=0
Reserve memory for n elements.
virtual size_t size_of(size_t _n_elem) const
virtual void delete_multiple_entries(const std::vector< bool > &)=0
Delete multiple entries in list.
virtual size_t size() const =0
Return underlying container size.
virtual void clear()=0
Clear all elements and free memory.
virtual size_t n_elements() const =0
Number of elements in 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 size_t element_size() const =0
Size of one element in bytes or UnknownSize if not known.
virtual size_t size_of() const
Return size of property in bytes.
static const size_t UnknownSize
Indicates an error when a size is returned by a member.
virtual void push_back()=0
Extend the number of elements by one.
virtual void resize(size_t _n)=0
Resize storage to hold n elements.
virtual OpenVolumeMeshBaseProperty * clone() const =0
Return a deep copy of self.