PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
kcenon::pacs::ai::Result< T > Class Template Reference

Simple result type for error handling. More...

#include <ai_service_connector.h>

Collaboration diagram for kcenon::pacs::ai::Result< T >:
Collaboration graph

Public Member Functions

 Result (T value)
 
 Result (const error_info &err)
 
bool is_ok () const noexcept
 
bool is_err () const noexcept
 
T & value () &
 
const T & value () const &
 
T && value () &&
 
const error_infoerror () const
 

Private Attributes

data_ {}
 
error_info error_
 
bool has_value_
 

Detailed Description

template<typename T>
class kcenon::pacs::ai::Result< T >

Simple result type for error handling.

Definition at line 70 of file ai_service_connector.h.

Constructor & Destructor Documentation

◆ Result() [1/2]

template<typename T >
kcenon::pacs::ai::Result< T >::Result ( T value)
inline

◆ Result() [2/2]

template<typename T >
kcenon::pacs::ai::Result< T >::Result ( const error_info & err)
inline

Definition at line 73 of file ai_service_connector.h.

73: error_(err), has_value_(false) {}

Member Function Documentation

◆ error()

template<typename T >
const error_info & kcenon::pacs::ai::Result< T >::error ( ) const
inlinenodiscard

◆ is_err()

template<typename T >
bool kcenon::pacs::ai::Result< T >::is_err ( ) const
inlinenodiscardnoexcept

◆ is_ok()

template<typename T >
bool kcenon::pacs::ai::Result< T >::is_ok ( ) const
inlinenodiscardnoexcept

◆ value() [1/3]

template<typename T >
T & kcenon::pacs::ai::Result< T >::value ( ) &
inlinenodiscard

◆ value() [2/3]

template<typename T >
T && kcenon::pacs::ai::Result< T >::value ( ) &&
inlinenodiscard

Definition at line 79 of file ai_service_connector.h.

79{ return std::move(data_); }

References kcenon::pacs::ai::Result< T >::data_.

◆ value() [3/3]

template<typename T >
const T & kcenon::pacs::ai::Result< T >::value ( ) const &
inlinenodiscard

Definition at line 78 of file ai_service_connector.h.

78{ return data_; }

References kcenon::pacs::ai::Result< T >::data_.

Member Data Documentation

◆ data_

◆ error_

◆ has_value_


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