AsmGrader 0.0.0
Loading...
Searching...
No Matches
error_types.hpp File Reference
#include <asmgrader/common/expected.hpp>
#include <asmgrader/common/formatters/macros.hpp>
#include <boost/preprocessor/cat.hpp>
Include dependency graph for error_types.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  asmgrader
 

Macros

#define TRYE_IMPL(val, e, ident)
 If the supplied argument is an error (unexpected) type, then propegate the error type e up the call stack. Otherwise, continue execution as normal.
 
#define TRY_IMPL(val, ident)
 
#define TRYE(val, e)
 
#define TRY(val)
 If the supplied argument is an error (unexpected) type, then propegate it up the call stack. Otherwise, continue execution as normal.
 

Typedefs

template<typename T >
using asmgrader::Result = Expected<T, ErrorKind>
 

Enumerations

enum class  asmgrader::ErrorKind {
  asmgrader::TimedOut , asmgrader::UnresolvedSymbol , asmgrader::UnexpectedReturn , asmgrader::BadArgument ,
  asmgrader::SyscallFailure , asmgrader::SyscallPredSat , asmgrader::UnknownError , asmgrader::MaxErrorNum
}
 

Functions

 FMT_SERIALIZE_ENUM (::asmgrader::ErrorKind, TimedOut, UnresolvedSymbol, UnexpectedReturn, BadArgument, SyscallPredSat, UnknownError, SyscallFailure, MaxErrorNum)
 

Macro Definition Documentation

◆ TRY

#define TRY ( val)
Value:
TRY_IMPL(val, BOOST_PP_CAT(errrefe_uniq__, __COUNTER__))
#define TRY_IMPL(val, ident)
Definition error_types.hpp:45

If the supplied argument is an error (unexpected) type, then propegate it up the call stack. Otherwise, continue execution as normal.

◆ TRY_IMPL

#define TRY_IMPL ( val,
ident )
Value:
TRYE_IMPL(val, ident.error(), ident)
#define TRYE_IMPL(val, e, ident)
If the supplied argument is an error (unexpected) type, then propegate the error type e up the call s...
Definition error_types.hpp:35

◆ TRYE

#define TRYE ( val,
e )
Value:
TRYE_IMPL(val, e, BOOST_PP_CAT(errref_uniq__, __COUNTER__))

◆ TRYE_IMPL

#define TRYE_IMPL ( val,
e,
ident )
Value:
__extension__({ \
const auto& ident = val; \
if (!ident.has_value()) { \
using enum ErrorKind; \
return e; \
} \
ident.value(); \
})

If the supplied argument is an error (unexpected) type, then propegate the error type e up the call stack. Otherwise, continue execution as normal.

Function Documentation

◆ FMT_SERIALIZE_ENUM()

FMT_SERIALIZE_ENUM ( ::asmgrader::ErrorKind ,
TimedOut ,
UnresolvedSymbol ,
UnexpectedReturn ,
BadArgument ,
SyscallPredSat ,
UnknownError ,
SyscallFailure ,
MaxErrorNum  )