Face Engine SDK  5.23.1
A face detection, recognition and tracking engine.
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 >

List of all members.

Public Member Functions

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

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) [inline, explicit]

Initializes object pointer with ptr.

Parameters:
[in]ptrraw pointer to initialize with.

Member Function Documentation

template<typename T >
T* fsdk::RefBase< T >::get ( ) const [inline]

Get current raw object pointer.

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

Check is object is dead.

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

Check for nullptr.

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

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 [inline]

Implicit cast to bool.

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

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 [inline]

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 [inline]

Dereference operator.

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

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) [inline]

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:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines