Agora RTC Objective-C API Reference Refactor

Public Member Functions
RefCountedObject< T > Class Template Reference

Inherits T.

## Public Member Functions
virtual bool | HasOneRef () const

## 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/3]

RefCountedObject | ( |  | ) |
| inline

## ◆ RefCountedObject() [2/3]

RefCountedObject | ( | const P0 & | p0 | ) |
| inlineexplicit

## ◆ ~RefCountedObject()

virtual ~RefCountedObject | ( |  | ) |
| inlineprotectedvirtual

## ◆ RefCountedObject() [3/3]

RefCountedObject | ( | const RefCountedObject< T > & |  | ) |
| private

## Member Function Documentation

## ◆ AddRef()

virtual void AddRef | ( |  | ) | const
| inlinevirtual

## ◆ Release()

virtual agora::RefCountReleaseStatus Release | ( |  | ) | const
| inlinevirtual

## ◆ HasOneRef()

virtual bool 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.

## ◆ operator=()

RefCountedObject& operator= | ( | const RefCountedObject< T > & |  | ) |
| private

## Field Documentation

## ◆ ref_count_

agora::RefCounter ref_count_
| mutableprotected