 |
Face Engine SDK
5.8.0
A face detection, recognition and tracking engine.
|
11 #ifndef DOXYGEN_SHOULD_SKIP_THIS
14 template<
typename T>
struct WeakRef;
31 Ref() noexcept = default;
35 Ref(std::nullptr_t) noexcept {}
41 FSDK_DEPRECATED(
"construction from raw pointer is deprecated, use make_ref function instead")
42 explicit
Ref(T* ptr) noexcept { *
this = ptr; }
54 template<class D, typename = typename std::enable_if<std::is_convertible<D*, T*>::value>::type>
57 #ifndef DOXYGEN_SHOULD_SKIP_THIS
62 Ref(
const WeakRef<T>& other) noexcept { *
this = other; }
87 this->
get()->release();
99 return this->
get() == other.get();
107 return !(*
this == other);
110 #ifndef DOXYGEN_SHOULD_SKIP_THIS
133 template<class D, typename = typename std::enable_if<std::is_convertible<D*, T*>::value>::type>
144 FSDK_DEPRECATED(
"Assignment from raw pointer is deprecated, use make_ref function instead")
145 Ref& operator = (T* ptr) noexcept {
164 if(this->
get() != ptr)
167 this->
get()->release();
172 this->
get()->retain();
182 if(this->
get() != ptr)
185 this->
get()->release();
204 T* ptr = this->
get();
237 template<
typename S,
typename T>
241 return ref.template as<S>();
262 template<
typename S,
typename T>
265 ref.
acquire(
static_cast<S*
>(ptr));
T * reset() noexcept
Reset reference counted object and assign nullptr to the pointer.
Definition: Ref.h:203
Ref< S > acquire_as(T *ptr) noexcept
Acquire ownership of IRefCounted based object with a cast to a given type.
Definition: Ref.h:263
Ref(const Ref< D > &other)
Initializes object pointer with other and retains a reference.
Definition: Ref.h:55
Ref< T > acquire(T *ptr) noexcept
Acquire ownership of IRefCounted based object.
Definition: Ref.h:250
void set(T *ptr) noexcept
Replace object pointer without any checks or reference management.
Definition: RefBase.h:101
Ref & operator=(const Ref &other) noexcept
Assign a strong reference.
Definition: Ref.h:124
SDK namespace.
Definition: IAGSEstimator.h:8
bool operator==(const Ref &other) const noexcept
Check if two refs are the same.
Definition: Ref.h:98
Ref & make_ref(T *ptr) noexcept
Create ref without acquiring ownership.
Definition: Ref.h:196
Ref & acquire(T *ptr) noexcept
Acquire ownership of the object.
Definition: Ref.h:181
Ref() noexcept=default
Constructor. Initializes object pointer to nullptr.
~Ref() noexcept
Releases reference being held (if any).
Definition: Ref.h:68
bool isNull() const noexcept
Check for nullptr.
Definition: RefBase.h:70
Ref< S > make_ref_as(T *ptr) noexcept
Make smart reference to a IRefCounted based object without acquiring ownership.
Definition: Ref.h:238
Generic base class of a pointer for reference counted objects.
Definition: RefBase.h:17
Ref & assign(T *ptr) noexcept
Assign an object. Presumes shared ownership, increases reference count.
Definition: Ref.h:163
T * m_ptr
Raw pointer.
Definition: RefBase.h:106
Ref< T > make_ref(T *ptr) noexcept
Make smart reference to a IRefCounted based object without acquiring ownership.
Definition: Ref.h:225
bool operator!=(const Ref &other) const noexcept
Check if two refs are not the same.
Definition: Ref.h:106
Smart pointer for reference counted objects.
Definition: Ref.h:26
T ** getInitReference() noexcept
Access pointer for initialization.
Definition: Ref.h:85
Ref< S > as() const noexcept
Make smart reference with relative type.
Definition: Ref.h:212
Ref(const Ref &other)
Initializes object pointer with other and retains a reference.
Definition: Ref.h:48
T * get() const noexcept
Get current raw object pointer.
Definition: RefBase.h:93
T * operator->() const noexcept
Access pointer.
Definition: Ref.h:76