Support Class Library
A set of tools providing classes and utility
Public Member Functions | Static Public Member Functions | List of all members
scl::exceptions::InvalidResultAccess Class Reference

Exception class used when attempting to access the wrong type stored in an scl::utils::Either. More...

#include "InvalidResultAccess.h"

Inheritance diagram for scl::exceptions::InvalidResultAccess:
Inheritance graph
[legend]
Collaboration diagram for scl::exceptions::InvalidResultAccess:
Collaboration graph
[legend]

Public Member Functions

const char *const type () const noexcept override
 A string describing the name of the exception class. More...
 
- Public Member Functions inherited from scl::exceptions::Exception
template<class T >
 Exception (T &&reason)
 Construct an scl::exceptions::Exception from an error message. More...
 
const char *const reason () const override
 Retrieve the reason. More...
 
const char * what () const noexcept override
 Override that uses the user defined reason. More...
 

Static Public Member Functions

static InvalidResultAccess okWhenErr ()
 Helper function that creates an InvalidResultAccess when trying to access Ok when Err. More...
 
static InvalidResultAccess errWhenOk ()
 Helper function that creates an InvalidResultAccess when trying to access Err when Ok is active. More...
 

Additional Inherited Members

- Protected Attributes inherited from scl::exceptions::Exception
const char *const _reason = ""
 The error message that comes with this Exception. More...
 

Detailed Description

Exception class used when attempting to access the wrong type stored in an scl::utils::Either.

Definition at line 10 of file InvalidResultAccess.h.

Member Function Documentation

◆ errWhenOk()

static InvalidResultAccess scl::exceptions::InvalidResultAccess::errWhenOk ( )
inlinestatic

Helper function that creates an InvalidResultAccess when trying to access Err when Ok is active.

Returns
the exception

Definition at line 29 of file InvalidResultAccess.h.

◆ okWhenErr()

static InvalidResultAccess scl::exceptions::InvalidResultAccess::okWhenErr ( )
inlinestatic

Helper function that creates an InvalidResultAccess when trying to access Ok when Err.

Returns
the exception

Definition at line 21 of file InvalidResultAccess.h.

◆ type()

const char* const scl::exceptions::InvalidResultAccess::type ( ) const
inlineoverridevirtualnoexcept

A string describing the name of the exception class.

Returns
the fully qualified name of this class

Reimplemented from scl::exceptions::Exception.

Definition at line 13 of file InvalidResultAccess.h.


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