21 #ifndef mia_singular_refobj_hh 22 #define mia_singular_refobj_hh 51 virtual void operator ()(T& MIA_PARAM_UNUSED(data))
const = 0;
86 TheObject(
const TheObject& data) =
delete;
87 TheObject&
operator = (
const TheObject& data) =
delete;
105 template <
typename T>
108 m_object =
new TheObject(data, d);
111 template <
typename T>
114 m_object = other.m_object;
119 template <
typename T>
124 m_object = other.m_object;
130 template <
typename T>
134 if (m_object->del_ref())
138 template <
typename T>
141 return m_object->get();
144 template <
typename T>
148 return m_object->get_refcount();
153 template <
typename T>
161 template <
typename T>
164 assert(m_refcount == 0);
165 m_destructor(m_data);
168 template <
typename T>
174 template <
typename T>
178 return (m_refcount <= 0);
181 template <
typename T>
187 template <
typename T>
~TSingleReferencedObject()
unsigned get_refcount() const
TSingleReferencedObject & operator=(const TSingleReferencedObject< T > &other)
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
virtual void operator()(T &data) const =0
a singulater reference counted object that gets destroyed when the refount goes to zero ...
TSingleReferencedObject()
static const EmptyDestructor empty_destructor
#define NS_MIA_END
conveniance define to end the mia namespace