35 #ifndef OPENVOLUMEMESHBASEPROPERTY_HH 36 #define OPENVOLUMEMESHBASEPROPERTY_HH 42 #include "OpenVolumeMeshHandle.hh" 43 #include "OpenVolumeMesh/Config/Export.hh" 57 template <
class PropT,
class HandleT>
friend class PropertyPtr;
65 const std::string& _name,
66 const std::string& _internal_type_name)
68 internal_type_name_(_internal_type_name),
80 virtual void reserve(
size_t _n) = 0;
83 virtual void resize(
size_t _n) = 0;
86 virtual size_t size()
const = 0;
89 virtual void clear() = 0;
92 virtual void push_back() = 0;
95 virtual void swap(
size_t _i0,
size_t _i1) = 0;
98 virtual void delete_element(
size_t _idx) = 0;
104 const std::string&
name()
const {
108 const std::string& internal_type_name()
const {
109 return internal_type_name_;
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_; }
124 virtual size_t n_elements()
const = 0;
127 virtual size_t element_size()
const = 0;
131 return size_of(n_elements());
136 virtual size_t size_of(
size_t _n_elem)
const {
137 return (element_size() != UnknownSize) ? (_n_elem * element_size())
148 virtual void delete_multiple_entries(
const std::vector<bool>&) = 0;
153 std::string internal_type_name_;
162 #endif //OPENVOLUMEMESHBASEPROPERTY_HH
const std::string & name() const
Return the name of the property.
virtual size_t size_of(size_t _n_elem) const
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.