18 #define IMPLEMENT_IREF \
19 virtual int addRef() const \
21 return ref_.addRef(); \
23 virtual int release() const \
25 long refCount = ref_.release(); \
32 artec::sdk::base::details::RefCounter ref_; \
35 namespace artec {
namespace sdk {
namespace base
51 return _InterlockedIncrement((
volatile long*)&refCount_);
54 return __sync_add_and_fetch(&refCount_, 1);
61 return _InterlockedDecrement((
volatile long*)&refCount_);
64 return __sync_sub_and_fetch(&refCount_, 1);
69 mutable volatile int refCount_;
75 template <
class Interface>
class RefBase :
public Interface
Basic reference implementation of IRef interface.
Implementation of IRef interface. To create your own class, inherit it from RefBase.