24#ifndef SO_REF_COUNTER_H
25#define SO_REF_COUNTER_H
100 {
return m_refcount; }
106 { m_refMutex.
lock(); }
117 static void initClass();
120 static void exitClass();
138 { s_refCountCBFunc = f; }
152 void setRefCountCallbackData(
void *userData = NULL)
153 { m_refCountCBData = userData; }
158 void invokeRefCountCB()
const;
161 static inline void setTraceRefs(
const bool enable)
165 static inline SbBool getTraceRefs()
166 {
return s_traceRefs; }
172 void setRefCount(
const int count);
175 void addOnDeleteCB(
SoRefCounter *context,
const std::function<
void()> &callBackFunction);
178 void addOnDeleteCB(
const std::function<
void()> &callBackFunction);
179 void addOnDeleteCB(
const std::function<
void(
SoRefCounter* caller)> &callBackFunction);
203 virtual bool notifyDelete()
const
210 virtual void destroy()
215 static bool s_traceRefs;
219 void* m_refCountCBData;
222 mutable int m_refcount;
226 std::vector<OnDeleteCB> *m_onDeleteCBVec;
227 std::vector<SoRefCounter*> *m_contextVec;
228 void cleanUpContextsCB();
229 void cleanUpContextsLists();
234#define SO_UNREF_RESET(object)\
void SoBaseRefCountCB(void *userData, const SoRefCounter *base)
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Portable spinloc...
void lock()
Request exclusive access for this spinlock.
void unlock()
Release exclusive access.
Base class for ref-counted objects.
void unref() const
Removes a reference from an instance.
int getRefCount() const
Returns current reference count.
void lock() const
lock this instance.
void unrefNoDelete() const
unrefNoDelete() should be called when it is desired to decrement the reference count,...
void ref() const
Adds a reference to an instance.
void unlock() const
unlock this instance.