Agora C++ API Reference for All Platforms
|
10 #ifndef __AGORA_REF_COUNTED_OBJECT_H__
11 #define __AGORA_REF_COUNTED_OBJECT_H__
14 #if defined(__AGORA_REF_COUNTED_OBJECT_INTERNAL_H__)
15 #error AgoraRefCountedObject is deprected now, its only purpose is for API compatiable.
18 #include "AgoraRefPtr.h"
19 #include "AgoraAtomicOps.h"
21 #ifndef OPTIONAL_REFCOUNTRELEASESTATUS_SPECIFIER
22 #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)
23 #define OPTIONAL_REFCOUNTRELEASESTATUS_SPECIFIER agora::RefCountReleaseStatus::
25 #define OPTIONAL_REFCOUNTRELEASESTATUS_SPECIFIER
32 explicit RefCounter(
int ref_count) : ref_count_(ref_count) {}
42 ? OPTIONAL_REFCOUNTRELEASESTATUS_SPECIFIER kDroppedLastRef
43 : OPTIONAL_REFCOUNTRELEASESTATUS_SPECIFIER kOtherRefsRemained);
60 volatile int ref_count_;
76 #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)
82 #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)
83 template <
class P0,
class P1,
class... Args>
85 : T(
std::forward<P0>(p0),
87 std::forward<Args>(args)...),
95 if (status == OPTIONAL_REFCOUNTRELEASESTATUS_SPECIFIER kDroppedLastRef) {
122 #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)
123 template <
typename T,
typename... types>
128 template <
typename T>
132 template <
typename T,
typename P0>
virtual agora::RefCountReleaseStatus Release() const
Definition: AgoraRefCountedObject.h:93
static int AcquireLoad(volatile const int *i)
Definition: AgoraAtomicOps.h:33
RefCountedObject(P0 &&p0, P1 &&p1, Args &&... args)
Definition: AgoraRefCountedObject.h:84
Definition: AgoraRefPtr.h:44
agora_refptr< T > make_refptr(types &&... args)
Definition: AgoraRefCountedObject.h:124
static int Decrement(volatile int *i)
Definition: AgoraAtomicOps.h:30
virtual bool HasOneRef() const
Definition: AgoraRefCountedObject.h:109
agora::RefCounter ref_count_
Definition: AgoraRefCountedObject.h:119
RefCountedObject()
Definition: AgoraRefCountedObject.h:73
virtual void AddRef() const
Definition: AgoraRefCountedObject.h:91
Definition: AgoraRefCountedObject.h:71
Definition: AgoraAtomicOps.h:21
static int Increment(volatile int *i)
Definition: AgoraAtomicOps.h:27
RefCountedObject(const P0 &p0)
Definition: AgoraRefCountedObject.h:79
RefCountedObject(P0 &&p0)
Definition: AgoraRefCountedObject.h:77
void IncRef()
Definition: AgoraRefCountedObject.h:34
bool HasOneRef() const
Definition: AgoraRefCountedObject.h:54
Definition: AgoraOptional.h:881
virtual ~RefCountedObject()
Definition: AgoraRefCountedObject.h:112
Definition: AgoraRefCountedObject.h:30
OPTIONAL_ENUM_CLASS RefCountReleaseStatus
Definition: AgoraRefPtr.h:25
agora::RefCountReleaseStatus DecRef()
Definition: AgoraRefCountedObject.h:40
RefCounter(int ref_count)
Definition: AgoraRefCountedObject.h:32