From d8b70727fdda5c1de19736724809e76e060b417e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 18 Aug 2010 17:49:47 +0200 Subject: Add callback support for zero counter event in shared_base --- odb/shared-ptr/base.hxx | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'odb/shared-ptr/base.hxx') diff --git a/odb/shared-ptr/base.hxx b/odb/shared-ptr/base.hxx index 6fdc32e..4766aa7 100644 --- a/odb/shared-ptr/base.hxx +++ b/odb/shared-ptr/base.hxx @@ -68,8 +68,19 @@ namespace odb void operator delete (void*) throw (); + struct refcount_callback + { + void* arg; + void (*zero_counter) (void*); + }; + + private: + bool + _dec_ref_callback (); + protected: std::size_t counter_; + refcount_callback* callback_; }; template -- cgit v1.1