Template Class CSharedLifetimeControlImpl#

Inheritance Relationships#

Base Types#

Class Documentation#

template<class TClass>
class CSharedLifetimeControlImpl : public std::enable_shared_from_this<TClass>, public sdv::CLifetimeControlImpl#

Lifetime control implementation class based on shared pointer.

Template Parameters:

TClass – The type of class deriving CSharedLifetimeControlImpl class.

Public Functions

inline CSharedLifetimeControlImpl()#

Default constructor.

CSharedLifetimeControlImpl(const CSharedLifetimeControlImpl &rClass) = delete#

Deleted copy constructor.

Parameters:

rClass[in] Reference to the class to copy from.

CSharedLifetimeControlImpl(CSharedLifetimeControlImpl &&rClass) = delete#

Deleted move constructor.

Parameters:

rClass[in] Reference to the class to copy from.

inline virtual ~CSharedLifetimeControlImpl()#

Destructor.

CSharedLifetimeControlImpl &operator=(const CSharedLifetimeControlImpl &rClass) = delete#

Deleted copy assignment constructor.

Parameters:

rClass[in] Reference to the class to copy from.

Returns:

Reference to this class.

CSharedLifetimeControlImpl &operator=(CSharedLifetimeControlImpl &&rClass) = delete#

Deleted move assignment constructor.

Parameters:

rClass[in] Reference to the class to copy from.

Returns:

Reference to this class.

inline virtual void Increment() override#

Increment the lifetime. Needs to be balanced by a call to Decrement. Overload of IObjectLifetime::Increment.

inline virtual bool Decrement() override#

Decrement the lifetime. If the lifetime reaches zero, the object will be destroyed (through the exposed IObjectDestroy interface). Overload of IObjectLifetime::Decrement.

Returns:

Returns ‘true’ if the object was destroyed, false if not.

inline virtual uint32_t GetCount() const override#

Get the current lifetime count. Overload of IObjectLifetime::GetCount.

Remark

The GetCount function returns a momentary value, which can be changed at any moment.

Returns:

Returns the current counter value.

Protected Functions

inline virtual void DestroyObject() override#

Destroy the object. Default implementation deletes ‘this’. Overload of IObjectDestroy::DestroyObject.

Attention

After a call of this function, all exposed interfaces render invalid and should not be used any more.