Agora C++ API Reference for All Platforms

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
agora::RefCountedObject< T > Class Template Reference

`#include <AgoraRefCountedObject.h>`

Inherits T, and T.

## Public Member Functions
| RefCountedObject ()
template<class P0>
| RefCountedObject (P0 &&p0)
| RefCountedObject (const P0 &p0)
template<class P0, class P1, class... Args>
| RefCountedObject (P0 &&p0, P1 &&p1, Args &&... args)
virtual void | AddRef () const
virtual agora::RefCountReleaseStatus | Release () const
virtual bool | HasOneRef () const
| RefCountedObject ()
template<class P0>
| RefCountedObject (P0 &&p0)
| RefCountedObject (const P0 &p0)
template<class P0, class P1, class... Args>
| RefCountedObject (P0 &&p0, P1 &&p1, Args &&... args)
virtual void | AddRef () const
virtual agora::RefCountReleaseStatus | Release () const
virtual bool | HasOneRef () const

## Public Attributes
friend | Deleter

## Protected Member Functions
virtual | ~RefCountedObject ()
virtual | ~RefCountedObject ()

## Protected Attributes
agora::RefCounter | ref_count_
Deleter | deleter_

## Detailed Description

template<class T>
class agora::RefCountedObject< T >

Agora sample code for wrapping a class that needs to inherit from RefCountInterface in order to be held by agora::agora_refptr Usage: agora::agora_refptr<TypeName> ptr = new RefCountedObject<TypeName>(Arg1, Arg2, ...);

## Constructor & Destructor Documentation

## ◆ RefCountedObject() [1/8]

template<class T>

agora::RefCountedObject< T >::RefCountedObject | ( |  | ) |
| inline

## ◆ RefCountedObject() [2/8]

template<class T>
template<class P0>

agora::RefCountedObject< T >::RefCountedObject | ( | P0 && | p0 | ) |
| inlineexplicit

## ◆ RefCountedObject() [3/8]

template<class T>

agora::RefCountedObject< T >::RefCountedObject | ( | const P0 & | p0 | ) |
| inlineexplicit

## ◆ RefCountedObject() [4/8]

template<class T>
template<class P0, class P1, class... Args>

agora::RefCountedObject< T >::RefCountedObject | ( | P0 && | p0,
|  | P1 && | p1,
|  | Args &&... | args )
| inline

## ◆ ~RefCountedObject() [1/2]

template<class T>

virtual agora::RefCountedObject< T >::~RefCountedObject | ( |  | ) |
| inlineprotectedvirtual

## ◆ RefCountedObject() [5/8]

template<class T>

agora::RefCountedObject< T >::RefCountedObject | ( |  | ) |
| inline

## ◆ RefCountedObject() [6/8]

template<class T>
template<class P0>

agora::RefCountedObject< T >::RefCountedObject | ( | P0 && | p0 | ) |
| inlineexplicit

## ◆ RefCountedObject() [7/8]

template<class T>

agora::RefCountedObject< T >::RefCountedObject | ( | const P0 & | p0 | ) |
| inlineexplicit

## ◆ RefCountedObject() [8/8]

template<class T>
template<class P0, class P1, class... Args>

agora::RefCountedObject< T >::RefCountedObject | ( | P0 && | p0,
|  | P1 && | p1,
|  | Args &&... | args )
| inline

## ◆ ~RefCountedObject() [2/2]

template<class T>

virtual agora::RefCountedObject< T >::~RefCountedObject | ( |  | ) |
| inlineprotectedvirtual

## Member Function Documentation

## ◆ AddRef() [1/2]

template<class T>

virtual void agora::RefCountedObject< T >::AddRef | ( |  | ) | const
| inlinevirtual

## ◆ Release() [1/2]

template<class T>

virtual agora::RefCountReleaseStatus agora::RefCountedObject< T >::Release | ( |  | ) | const
| inlinevirtual

## ◆ HasOneRef() [1/2]

template<class T>

virtual bool agora::RefCountedObject< T >::HasOneRef | ( |  | ) | const
| inlinevirtual

Return whether the reference count is one. If the reference count is used in the conventional way, a reference count of 1 implies that the current thread owns the reference and no other thread shares it. This call performs the test for a reference count of one, and performs the memory barrier needed for the owning thread to act on the object, knowing that it has exclusive access to the object.

## ◆ AddRef() [2/2]

template<class T>

virtual void agora::RefCountedObject< T >::AddRef | ( |  | ) | const
| inlinevirtual

## ◆ Release() [2/2]

template<class T>

virtual agora::RefCountReleaseStatus agora::RefCountedObject< T >::Release | ( |  | ) | const
| inlinevirtual

## ◆ HasOneRef() [2/2]

template<class T>

virtual bool agora::RefCountedObject< T >::HasOneRef | ( |  | ) | const
| inlinevirtual

Return whether the reference count is one. If the reference count is used in the conventional way, a reference count of 1 implies that the current thread owns the reference and no other thread shares it. This call performs the test for a reference count of one, and performs the memory barrier needed for the owning thread to act on the object, knowing that it has exclusive access to the object.

## Member Data Documentation

## ◆ ref_count_

template<class T>

agora::RefCounter agora::RefCountedObject< T >::ref_count_
| mutableprotected

## ◆ Deleter

template<class T>

friend agora::RefCountedObject< T >::Deleter

## ◆ deleter_

template<class T>

Deleter agora::RefCountedObject< T >::deleter_
| protected