21#ifndef mia_singular_refobj_hh
22#define mia_singular_refobj_hh
52 virtual void operator ()(T& MIA_PARAM_UNUSED(data))
const = 0;
93 TheObject(
const TheObject& data) =
delete;
94 TheObject&
operator = (
const TheObject& data) =
delete;
115 m_object =
new TheObject(data, d);
121 m_object = other.m_object;
133 m_object = other.m_object;
143 m_object(other.m_object)
145 other.m_object =
nullptr;
151 if (&other !=
this) {
155 m_object = other.m_object;
156 other.m_object =
nullptr;
167 if (m_object->del_ref())
174 return m_object->get();
181 return m_object->get_refcount();
197 assert(m_refcount == 0);
198 m_destructor(m_data);
211 return (m_refcount <= 0);
a singulater reference counted object that gets destroyed when the refount goes to zero
static const EmptyDestructor empty_destructor
unsigned get_refcount() const
TSingleReferencedObject()
~TSingleReferencedObject()
TSingleReferencedObject & operator=(const TSingleReferencedObject< T > &other)
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
#define NS_MIA_END
conveniance define to end the mia namespace
virtual void operator()(T &data) const =0
virtual void operator()(T &data) const