AWS IoT Device SDK C++ v2  1.33.0
AWS IoT Device SDK C++ v2
Protected Member Functions | List of all members
Aws::Crt::RefCounted< T > Class Template Reference

#include <RefCounted.h>

Protected Member Functions

 RefCounted ()
 
 ~RefCounted ()
 
void AcquireRef ()
 
void ReleaseRef ()
 

Detailed Description

template<class T>
class Aws::Crt::RefCounted< T >

Inherit from RefCounted to allow reference-counting from C code, which will keep your C++ object alive as long as the count is non-zero.

A class must inherit from RefCounted and std::enable_shared_from_this. Your class must always be placed inside a shared_ptr (do not create on the stack, or keep on the heap as a raw pointer).

Whenever the reference count goes from 0 to 1 a shared_ptr is created internally to keep this object alive. Whenever the reference count goes from 1 to 0 the internal shared_ptr is reset, allowing this object to be destroyed.

Constructor & Destructor Documentation

◆ RefCounted()

template<class T >
Aws::Crt::RefCounted< T >::RefCounted ( )
inlineprotected

◆ ~RefCounted()

template<class T >
Aws::Crt::RefCounted< T >::~RefCounted ( )
inlineprotected

Member Function Documentation

◆ AcquireRef()

template<class T >
void Aws::Crt::RefCounted< T >::AcquireRef ( )
inlineprotected

◆ ReleaseRef()

template<class T >
void Aws::Crt::RefCounted< T >::ReleaseRef ( )
inlineprotected

The documentation for this class was generated from the following file: