Reference-counting helpers - Disable copy/move cons/ass in base class

This commit is contained in:
Emmanuel BENOîT 2019-01-02 17:24:22 +01:00
parent 6afe127d13
commit 270da6492a

View file

@ -40,10 +40,22 @@ class T_ReferenceCountedClass
bool decreaseReferences_( ) noexcept; bool decreaseReferences_( ) noexcept;
protected: protected:
// Initialise the counter to 0
T_ReferenceCountedClass( ) noexcept; T_ReferenceCountedClass( ) noexcept;
public: public:
// Get the reference count
uint32_t getReferenceCount( ) const noexcept; uint32_t getReferenceCount( ) const noexcept;
// Deleted copy/move constructors and assignment operators
T_ReferenceCountedClass(
T_ReferenceCountedClass< UseAtomic > const& ) = delete;
T_ReferenceCountedClass< UseAtomic >& operator =(
T_ReferenceCountedClass< UseAtomic > const& ) = delete;
T_ReferenceCountedClass(
T_ReferenceCountedClass< UseAtomic >&& ) = delete;
T_ReferenceCountedClass< UseAtomic >& operator =(
T_ReferenceCountedClass< UseAtomic >&& ) = delete;
}; };
// Shortcuts // Shortcuts