Face Engine SDK  5.25.0
A face detection, recognition and tracking engine.
fsdk::Ref< T > Struct Template Reference

Smart pointer for reference counted objects. More...

#include <Ref.h>

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

List of all members.

Public Member Functions

 Ref () noexcept
 Constructor. Initializes object pointer to nullptr.
 Ref (std::nullptr_t) noexcept
 Initializes object pointer to nullptr.
 Ref (T *ptr) noexcept
 Initializes object pointer with ptr and retains a reference.
 Ref (const Ref &other)
 Initializes object pointer with other and retains a reference.
template<class D , typename = typename std::enable_if<std::is_convertible<D*, T*>::value>::type>
 Ref (const Ref< D > &other)
 Initializes object pointer with other and retains a reference.
 ~Ref () noexcept
 Releases reference being held (if any).
T * operator-> () const noexcept
 Access pointer.
T ** getInitReference () noexcept
 Access pointer for initialization.
bool operator== (const Ref &other) const noexcept
 Check if two refs are the same.
bool operator!= (const Ref &other) const noexcept
 Check if two refs are not the same.
Refoperator= (const Ref &other) noexcept
 Assign a strong reference.
template<class D , typename = typename std::enable_if<std::is_convertible<D*, T*>::value>::type>
Refoperator= (const Ref< D > &other) noexcept
 Assign a strong reference.
Refoperator= (T *ptr) noexcept
 Assign a raw pointer.
Refoperator= (std::nullptr_t) noexcept
 Assign a nullptr_t.
Refassign (T *ptr) noexcept
 Assign an object. Presumes shared ownership, increases reference count.
Refacquire (T *ptr) noexcept
 Acquire ownership of the object.
Refmake_ref (T *ptr) noexcept
 Create ref without acquiring ownership.
T * reset () noexcept
 Reset reference counted object and assign nullptr to the pointer.
template<typename S >
Ref< S > as () const noexcept
 Make smart reference with relative type.

Detailed Description

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

Smart pointer for reference counted objects.

Automatically calls retain/release and provides safety assertions.

Template Parameters:
Tobject interface (must be derived from IRefCounted)

Constructor & Destructor Documentation

template<typename T>
fsdk::Ref< T >::Ref ( T *  ptr) [inline, explicit]

Initializes object pointer with ptr and retains a reference.

Note:
this shares ownership.
Parameters:
[in]ptrraw pointer to initialize with.
template<typename T>
fsdk::Ref< T >::Ref ( const Ref< T > &  other) [inline]

Initializes object pointer with other and retains a reference.

Note:
this shares ownership.
Parameters:
[in]otherpointer to initialize with.
template<typename T>
template<class D , typename = typename std::enable_if<std::is_convertible<D*, T*>::value>::type>
fsdk::Ref< T >::Ref ( const Ref< D > &  other) [inline, explicit]

Initializes object pointer with other and retains a reference.

Note:
this shares ownership.
Parameters:
[in]otherpointer of derived template class to initialize with.

Member Function Documentation

template<typename T>
Ref& fsdk::Ref< T >::acquire ( T *  ptr) [inline]

Acquire ownership of the object.

Parameters:
[in]ptrraw object pointer to acquire.
template<typename T>
template<typename S >
Ref<S> fsdk::Ref< T >::as ( ) const [inline]

Make smart reference with relative type.

Template Parameters:
Starget interface (must be relative to T)
template<typename T>
Ref& fsdk::Ref< T >::assign ( T *  ptr) [inline]

Assign an object. Presumes shared ownership, increases reference count.

Parameters:
[in]ptrraw object pointer to assign.
template<typename T>
T** fsdk::Ref< T >::getInitReference ( ) [inline]

Access pointer for initialization.

Note:
previously held pointer is released.
Returns:
pointer to pointer to object.
template<typename T>
Ref& fsdk::Ref< T >::make_ref ( T *  ptr) [inline]

Create ref without acquiring ownership.

Parameters:
[in]ptrraw object pointer.
template<typename T>
bool fsdk::Ref< T >::operator!= ( const Ref< 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::Ref< T >::operator-> ( ) const [inline]

Access pointer.

Note:
pointer is checked for null in runtime.
Returns:
pointer to object.
template<typename T>
Ref& fsdk::Ref< T >::operator= ( const Ref< T > &  other) [inline]

Assign a strong reference.

Parameters:
[in]otherstrong reference.
Returns:
reference.
template<typename T>
template<class D , typename = typename std::enable_if<std::is_convertible<D*, T*>::value>::type>
Ref& fsdk::Ref< T >::operator= ( const Ref< D > &  other) [inline]

Assign a strong reference.

Parameters:
[in]otherstrong reference of derived template class.
Returns:
reference.
template<typename T>
Ref& fsdk::Ref< T >::operator= ( T *  ptr) [inline]

Assign a raw pointer.

Note:
this shares ownership.
Parameters:
[in]ptrraw pointer.
Returns:
reference.
template<typename T>
Ref& fsdk::Ref< T >::operator= ( std::nullptr_t  ) [inline]

Assign a nullptr_t.

Note:
this releases previously held reference (if any).
Returns:
reference.
template<typename T>
bool fsdk::Ref< T >::operator== ( const Ref< 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.

The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines