100 {
return m_refcount; }
106 { m_refMutex.lock(); }
112 { m_refMutex.unlock(); }
117 static void initClass();
120 static void exitClass();
137 static void setRefCountCallback(SoBaseRefCountCB *f)
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)
162 { s_traceRefs = 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);
176 void addOnDeleteCB(SoRefCounter *context,
const std::function<
void(SoRefCounter* caller)> &callBackFunction);
177 void addOnDeleteCB(SoRefCounter *context,
const std::function<
void(SoRefCounter* caller, SoRefCounter* context)> &callBackFunction);
178 void addOnDeleteCB(
const std::function<
void()> &callBackFunction);
179 void addOnDeleteCB(
const std::function<
void(SoRefCounter* caller)> &callBackFunction);
187 SoRefCounter(
const SoRefCounter &);
190 SoRefCounter & operator=(
const SoRefCounter &)
194 virtual ~SoRefCounter();
203 virtual bool notifyDelete()
const
210 virtual void destroy()
215 static bool s_traceRefs;
218 static SoBaseRefCountCB* s_refCountCBFunc;
219 void* m_refCountCBData;
222 mutable int m_refcount;
223 mutable SbThreadSpinlock m_refMutex;
226 std::vector<OnDeleteCB> *m_onDeleteCBVec;
227 std::vector<SoRefCounter*> *m_contextVec;
228 void cleanUpContextsCB();
229 void cleanUpContextsLists();