#include <status_or.h>
Public Member Functions | |
| StatusOr (const T &value) | |
| StatusOr (T &&value) | |
| StatusOr (const Status &status) | |
| StatusOr (const StatusOr &)=default | |
| StatusOr (StatusOr &&)=default | |
| StatusOr & | operator= (const StatusOr &)=default |
| StatusOr & | operator= (StatusOr &&)=default |
| StatusOr & | operator= (const T &value) |
| StatusOr & | operator= (const T &&value) |
| StatusOr & | operator= (const Status &value) |
| const Status & | status () const |
| bool | ok () const |
| const T & | value () const |
| T & | value () |
Represents a union type of an object of type T and an fml::Status.
This is often used as a replacement for C++ exceptions where a function that could fail may return an error or a result. These are typically used for errors that are meant to be recovered from. If there is no recovery available FML_CHECK is more appropriate.
Example: StatusOr<int> div(int n, int d) { if (d == 0) { return Status(StatusCode::kFailedPrecondition, "div by zero"); } return n / d; }
Definition at line 32 of file status_or.h.
|
inline |
Definition at line 36 of file status_or.h.
|
inline |
Definition at line 40 of file status_or.h.
|
inline |
Definition at line 44 of file status_or.h.
References FML_CHECK, and fml::Status::ok().
|
default |
|
default |
|
inline |
Definition at line 75 of file status_or.h.
References fml::Status::ok().
Referenced by impeller::AdvancedBlend(), impeller::PipelineVK::Create(), impeller::PipelineBlend(), impeller::Contents::RenderToSnapshot(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), and impeller::testing::TEST_P().
|
inline |
Definition at line 67 of file status_or.h.
References fml::StatusOr< T >::value().
|
default |
|
inline |
Definition at line 61 of file status_or.h.
References fml::StatusOr< T >::value().
|
inline |
Definition at line 55 of file status_or.h.
References fml::StatusOr< T >::value().
|
default |
|
inline |
Definition at line 73 of file status_or.h.
|
inline |
Definition at line 86 of file status_or.h.
References FML_DCHECK, FML_LOG, FML_UNREACHABLE, and fml::Status::ok().
|
inline |
Definition at line 77 of file status_or.h.
References FML_DCHECK, FML_LOG, FML_UNREACHABLE, and fml::Status::ok().
Referenced by impeller::AdvancedBlend(), impeller::PipelineVK::Create(), fml::StatusOr< T >::operator=(), fml::StatusOr< T >::operator=(), fml::StatusOr< T >::operator=(), impeller::PipelineBlend(), impeller::Contents::RenderToSnapshot(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), and impeller::testing::TEST_P().