IDLive Face C++ API 1.47.0
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
facesdk::OptionalResult< T > Struct Template Reference

Optional result wrapper. Wraps an instance of a result class and only allows to access it when status is OK. More...

#include <facesdk/Common.h>

Public Member Functions

 OptionalResult (const facesdk::FaceException &e)
 
 OptionalResult (StatusInfo status)
 
 OptionalResult (T value, StatusInfo status)
 
 OptionalResult (const OptionalResult &other)
 
OptionalResultoperator= (const OptionalResult &other)
 
const T & value () const
 Get result value.
 
const StatusInfostatus () const
 
bool ok () const
 

Friends

std::ostream & operator<< (std::ostream &os, const OptionalResult &optional_result)
 

Detailed Description

template<typename T>
struct facesdk::OptionalResult< T >

Optional result wrapper. Wraps an instance of a result class and only allows to access it when status is OK.

Member Function Documentation

◆ value()

template<typename T >
const T & facesdk::OptionalResult< T >::value ( ) const
inline

Get result value.

Returns
Result value.
Exceptions
facesdk::FaceExceptionif status is not OK.
Note
Use ok() method before value() call to check if result is valid and available.