43 #ifndef PROPERTYPTR_HH_
44 #define PROPERTYPTR_HH_
48 #include "BaseProperty.hh"
49 #include "OpenVolumeMeshHandle.hh"
50 #include "../System/MemoryInclude.hh"
54 class ResourceManager;
64 template <
class PropT,
class HandleT>
70 typedef typename PropT::value_type value_type;
71 typedef typename PropT::vector_type::const_iterator const_iterator;
72 typedef typename PropT::vector_type::iterator iterator;
73 typedef typename PropT::reference reference;
74 typedef typename PropT::const_reference const_reference;
82 virtual const std::string& name()
const;
84 virtual void delete_element(
size_t _idx);
86 virtual void swap_elements(
size_t _idx0,
size_t _idx1);
88 const_iterator begin()
const {
return ptr::shared_ptr<PropT>::get()->begin(); }
89 iterator begin() {
return ptr::shared_ptr<PropT>::get()->begin(); }
91 const_iterator end()
const {
return ptr::shared_ptr<PropT>::get()->end(); }
92 iterator end() {
return ptr::shared_ptr<PropT>::get()->end(); }
94 reference operator[](
size_t _idx) {
return (*ptr::shared_ptr<PropT>::get())[_idx]; }
95 const_reference operator[](
size_t _idx)
const {
return (*ptr::shared_ptr<PropT>::get())[_idx]; }
97 reference operator[](
const OpenVolumeMeshHandle& _h) {
return (*ptr::shared_ptr<PropT>::get())[_h.idx()]; }
98 const_reference operator[](
const OpenVolumeMeshHandle& _h)
const {
return (*ptr::shared_ptr<PropT>::get())[_h.idx()]; }
102 virtual bool persistent()
const {
return ptr::shared_ptr<PropT>::get()->persistent(); }
104 virtual bool anonymous()
const {
return ptr::shared_ptr<PropT>::get()->name().empty(); }
108 virtual void delete_multiple_entries(
const std::vector<bool>& _tags);
110 virtual void resize(
unsigned int _size);
117 #if defined(INCLUDE_TEMPLATES) && !defined(PROPERTYPTRT_CC)
118 #include "PropertyPtrT.cc"
PropertyPtr(PropT *_ptr, ResourceManager &_resMan, HandleT _handle)
Constructor.
virtual ~PropertyPtr()
Destructor.