libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
gbl::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 chargetMessage (void) const
 
 operator bool () const
 

Detailed Description

Definition at line 51 of file gimbal_exception.hpp.

Constructor & Destructor Documentation

◆ TryBlock()

gbl::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 & gbl::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 & gbl::Exception::TryBlock::getRecord ( void  ) const
inline

Definition at line 64 of file gimbal_exception.hpp.

64{ return record_; }

◆ getResult()

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

Definition at line 65 of file gimbal_exception.hpp.

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

◆ getSource()

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

Definition at line 66 of file gimbal_exception.hpp.

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

◆ getMessage()

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

Definition at line 67 of file gimbal_exception.hpp.

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

◆ operator bool()

gbl::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: