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

Simple result type for error handling when common_system is unavailable. More...

#include <dicom_session.h>

Collaboration diagram for kcenon::pacs::integration::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
 
 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::integration::Result< T >

Simple result type for error handling when common_system is unavailable.

Definition at line 96 of file network_adapter.h.

Constructor & Destructor Documentation

◆ Result() [1/4]

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

◆ Result() [2/4]

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

Definition at line 92 of file dicom_session.h.

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

◆ Result() [3/4]

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

Definition at line 98 of file network_adapter.h.

98: data_(std::move(value)), has_value_(true) {}

◆ Result() [4/4]

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

Definition at line 99 of file network_adapter.h.

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

Member Function Documentation

◆ error() [1/2]

◆ error() [2/2]

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

Definition at line 106 of file network_adapter.h.

106{ return error_; }

References kcenon::pacs::integration::Result< T >::error_.

◆ is_err() [1/2]

◆ is_err() [2/2]

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

Definition at line 102 of file network_adapter.h.

102{ return !has_value_; }

References kcenon::pacs::integration::Result< T >::has_value_.

◆ is_ok() [1/2]

◆ is_ok() [2/2]

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

Definition at line 101 of file network_adapter.h.

101{ return has_value_; }

References kcenon::pacs::integration::Result< T >::has_value_.

◆ value() [1/6]

◆ value() [2/6]

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

Definition at line 103 of file network_adapter.h.

103{ return data_; }

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

◆ value() [3/6]

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

Definition at line 98 of file dicom_session.h.

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

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

◆ value() [4/6]

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

Definition at line 105 of file network_adapter.h.

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

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

◆ value() [5/6]

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

Definition at line 97 of file dicom_session.h.

97{ return data_; }

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

◆ value() [6/6]

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

Definition at line 104 of file network_adapter.h.

104{ return data_; }

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

Member Data Documentation

◆ data_

◆ error_

◆ has_value_


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