 |
Face Engine SDK
5.6.0
A face detection, recognition and tracking engine.
|
7 #ifndef DOXYGEN_SHOULD_SKIP_THIS
10 template<
typename T>
struct WeakRef;
31 Ref(std::nullptr_t) noexcept {}
37 explicit Ref(T* ptr) noexcept { *
this = ptr; }
45 #ifndef DOXYGEN_SHOULD_SKIP_THIS
50 Ref(
const WeakRef<T>& other) noexcept { *
this = other; }
75 this->
get()->release();
87 return this->
get() == other.get();
95 return !(*
this == other);
98 #ifndef DOXYGEN_SHOULD_SKIP_THIS
113 return assign(other.get());
139 if(this->
get() != ptr)
142 this->
get()->release();
149 if(this->
get() && this->
get()->retain() < 1)
160 if(this->
get() != ptr)
163 this->
get()->release();
176 T* ptr = this->
get();
185 return Ref<S>(
static_cast<S*
>(this->
get()));
205 template<
typename S,
typename T>
207 return Ref<S>(
static_cast<S*
>(ptr));
228 template<
typename S,
typename T>
231 ref.
acquire(
static_cast<S*
>(ptr));
T * reset() noexcept
Reset reference counted object and assign nullptr to the pointer.
Definition: Ref.h:175
Ref< S > acquire_as(T *ptr) noexcept
Acquire ownership of IRefCounted based object with a cast to a given type.
Definition: Ref.h:229
Ref< T > acquire(T *ptr) noexcept
Acquire ownership of IRefCounted based object.
Definition: Ref.h:216
void set(T *ptr) noexcept
Replace object pointer without any checks or reference management.
Definition: RefBase.h:99
Ref & operator=(const Ref &other) noexcept
Assign a strong reference.
Definition: Ref.h:112
Ref(std::nullptr_t) noexcept
Initializes object pointer to nullptr.
Definition: Ref.h:31
SDK namespace.
Definition: IAGSEstimator.h:8
bool operator==(const Ref &other) const noexcept
Check if two refs are the same.
Definition: Ref.h:86
Ref & acquire(T *ptr) noexcept
Acquire ownership of the object.
Definition: Ref.h:159
Ref() noexcept
Constructor. Initializes object pointer to nullptr.
Definition: Ref.h:27
~Ref() noexcept
Releases reference being held (if any).
Definition: Ref.h:56
bool isNull() const noexcept
Check for nullptr.
Definition: RefBase.h:68
Ref< S > make_ref_as(T *ptr) noexcept
Make smart reference to a IRefCounted based object.
Definition: Ref.h:206
Generic base class of a pointer for reference counted objects.
Definition: RefBase.h:15
Ref & assign(T *ptr) noexcept
Assign an object. Presumes shared ownership, increases reference count.
Definition: Ref.h:138
T * m_ptr
Raw pointer.
Definition: RefBase.h:104
Ref(T *ptr) noexcept
Initializes object pointer with ptr and retains a reference.
Definition: Ref.h:37
Ref< T > make_ref(T *ptr) noexcept
Make smart reference to a IRefCounted based object.
Definition: Ref.h:195
bool operator!=(const Ref &other) const noexcept
Check if two refs are not the same.
Definition: Ref.h:94
Smart pointer for reference counted objects.
Definition: Ref.h:22
T ** getInitReference() noexcept
Access pointer for initialization.
Definition: Ref.h:73
Ref< S > as() const noexcept
Make smart reference with relative type.
Definition: Ref.h:184
Ref(const Ref &other)
Initializes object pointer with other and retains a reference.
Definition: Ref.h:43
T * get() const noexcept
Get current raw object pointer.
Definition: RefBase.h:91
T * operator->() const noexcept
Access pointer.
Definition: Ref.h:64