libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
gimbal::Exception::TryBlock Class Reference

Public Member Functions

 TryBlock (SourceLocation src=SourceLocation(SRC_FILE, "TryBlock::TryBlock()", SRC_LN, SRC_COL))
 
TryBlockoperator= (std::invocable auto fn)
 
const CallRecordgetRecord (void) const
 
Result getResult (void) const
 
const SourceLocationgetSource (void) const
 
const char * getMessage (void) const
 
 operator bool () const
 

Detailed Description

Definition at line 51 of file gimbal_exception.hpp.

Constructor & Destructor Documentation

◆ TryBlock()

gimbal::Exception::TryBlock::TryBlock ( SourceLocation  src = SourceLocation(SRC_FILE, "TryBlock::TryBlock()", SRC_LN, SRC_COL))
inline

Definition at line 56 of file gimbal_exception.hpp.

56 :
57 record_(Result::Success, "Success", nullptr, src) {}

Member Function Documentation

◆ operator=()

TryBlock & gimbal::Exception::TryBlock::operator= ( std::invocable auto  fn)
inline

Definition at line 59 of file gimbal_exception.hpp.

59 {
60 record_ = Exception::tryCatchRecord(std::forward<decltype(fn)>(fn), std::move(getRecord().getSource()));
61 return *this;
62 }

◆ getRecord()

const CallRecord & gimbal::Exception::TryBlock::getRecord ( void  ) const
inline

Definition at line 64 of file gimbal_exception.hpp.

64{ return record_; }

◆ getResult()

Result gimbal::Exception::TryBlock::getResult ( void  ) const
inline

Definition at line 65 of file gimbal_exception.hpp.

65{ return getRecord().getResult(); }

◆ getSource()

const SourceLocation & gimbal::Exception::TryBlock::getSource ( void  ) const
inline

Definition at line 66 of file gimbal_exception.hpp.

66{return getRecord().getSource(); }

◆ getMessage()

const char * gimbal::Exception::TryBlock::getMessage ( void  ) const
inline

Definition at line 67 of file gimbal_exception.hpp.

67{ return getRecord().getMessage(); }

◆ operator bool()

gimbal::Exception::TryBlock::operator bool ( ) const
inline

Definition at line 69 of file gimbal_exception.hpp.

69{ return getRecord().getResult().isSuccess(); }

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