Face Engine SDK  5.23.1
A face detection, recognition and tracking engine.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
fsdk::RefBase< T > Struct Template Reference

Generic base class of a pointer for reference counted objects. More...

#include <RefBase.h>

Inheritance diagram for fsdk::RefBase< T >:
fsdk::Ref< T >

Public Member Functions

 RefBase () noexcept=default
 Initializes object pointer to nullptr.
 
 RefBase (T *ptr) noexcept
 Initializes object pointer with ptr. More...
 
 operator T * () const noexcept
 Get raw object pointer. More...
 
T & operator* () const noexcept
 Dereference operator. More...
 
 operator bool () const noexcept
 Implicit cast to bool. More...
 
bool operator== (const RefBase &other) const noexcept
 Check if two refs are the same. More...
 
bool operator!= (const RefBase &other) const noexcept
 Check if two refs are not the same. More...
 
bool isNull () const noexcept
 Check for nullptr. More...
 
bool isExpired () const noexcept
 Check is object is dead. More...
 
bool isUnique () const noexcept
 Check if object has only one strong reference. More...
 
T * get () const noexcept
 Get current raw object pointer. More...
 
void set (T *ptr) noexcept
 Replace object pointer without any checks or reference management. More...
 

Protected Attributes

T * m_ptr {nullptr}
 Raw pointer.
 

Detailed Description

template<typename T>
struct fsdk::RefBase< T >

Generic base class of a pointer for reference counted objects.

Implements common features of Ref and WeakRef and is not meant to be used directly.

Note
This is to eliminate code duplication and should not be used directly.
Template Parameters
Tobject interface (must be derived from IRefCounted)

Constructor & Destructor Documentation

template<typename T >
fsdk::RefBase< T >::RefBase ( T *  ptr)
inlineexplicitnoexcept

Initializes object pointer with ptr.

Parameters
[in]ptrraw pointer to initialize with.

Member Function Documentation

template<typename T >
T* fsdk::RefBase< T >::get ( ) const
inlinenoexcept

Get current raw object pointer.

Returns
current raw object pointer.
template<typename T >
bool fsdk::RefBase< T >::isExpired ( ) const
inlinenoexcept

Check is object is dead.

Returns
true if referenced object has no references.
template<typename T >
bool fsdk::RefBase< T >::isNull ( ) const
inlinenoexcept

Check for nullptr.

Returns
true if referenced object pointer is nullptr.
template<typename T >
bool fsdk::RefBase< T >::isUnique ( ) const
inlinenoexcept

Check if object has only one strong reference.

Returns
true if referenced object has exactly one reference.
template<typename T >
fsdk::RefBase< T >::operator bool ( ) const
inlinenoexcept

Implicit cast to bool.

Returns
true if ref is not null.
template<typename T >
fsdk::RefBase< T >::operator T * ( ) const
inlinenoexcept

Get raw object pointer.

Note
No checks are performed.
Returns
raw object pointer.
template<typename T >
bool fsdk::RefBase< T >::operator!= ( const RefBase< T > &  other) const
inlinenoexcept

Check if two refs are not the same.

Returns
true if two refs are not the same.
Parameters
[in]otherref to check against.
template<typename T >
T& fsdk::RefBase< T >::operator* ( ) const
inlinenoexcept

Dereference operator.

Returns
reference to object being held.
template<typename T >
bool fsdk::RefBase< T >::operator== ( const RefBase< T > &  other) const
inlinenoexcept

Check if two refs are the same.

Returns
true if two refs are the same.
Parameters
[in]otherref to check against.
template<typename T >
void fsdk::RefBase< T >::set ( T *  ptr)
inlinenoexcept

Replace object pointer without any checks or reference management.

Note
This operation is unsafe!
Parameters
[in]ptrraw object pointer to set.

The documentation for this struct was generated from the following file: