AsmGrader 0.0.0
Loading...
Searching...
No Matches
asmgrader Namespace Reference

Namespaces

namespace  common
 
namespace  detail
 
namespace  exprs
 Types and other utilities for representing expressions used in REQUIRE* statements.
 
namespace  highlight
 
namespace  inspection
 
namespace  linux
 
namespace  literals
 
namespace  metadata
 
namespace  stringize
 For everything related to test requirement stringification.
 

Classes

struct  Aarch64FlagsBase
 Derived classes should use Aarch64FlagsBase with the CRTP pattern. More...
 
struct  always_false
 Very simple type for better semantics when we want static_assert(false) to work inside primary class templates. More...
 
class  App
 
class  AsmBuffer
 
class  AsmData
 
class  AsmFunction
 
class  AsmFunction< Ret(Args...)>
 
class  AsmFunctionResult
 Transparent wrapper around Result<Ret>, as far as the user is concerned. More...
 
class  AsmSymbol
 
class  AsmSymbolResult
 Transparent wrapper around Result<T>, as far as the user is concerned. More...
 
class  Assignment
 Declaration for the logic and data encapsulating a class assignment. More...
 
class  AssignmentFileSearcher
 
struct  AssignmentResult
 
class  AssignmentTestRunner
 Manages test execution and result aggregation for a specific assignment. More...
 
class  Byte
 More user-friendly interface wrapper for a byte-like integral. More...
 
class  ByteArray
 
class  ByteVector
 
class  CommandLineArgs
 Just a wrapper around argparse for now. More...
 
struct  CompilerInfo
 
class  ContextInternalError
 Error for any internal failure conditions of TestContext. More...
 
struct  count_if
 
struct  count_if_not
 
class  DatabaseReader
 Small CSV reader implementation for student names database Expects the specified file to contain a list of newline-seperated "lastname,firstname" entries, utf-8 encoded. More...
 
struct  DebugFormatter
 
struct  DecomposedExpr
 Stores references to rhs and lhs of a comparison expression, serving as an interface to the "decomposed" expression. More...
 
struct  Decomposer
 Just a tag type for operator overloading purposes Intended use is on the lhs of operator<= e.g. Decomposer{} <= a < b + 1 Decomposes the expression "a < b + 1" into the subexpressions "a" and "b + 1". More...
 
class  ElfReader
 Adaptor to (a few) libelf functions. More...
 
class  Expected
 std::variant wrapper for a partial implementation of C++23's expected type More...
 
class  FileSearcher
 
struct  FlagsRegister
 
struct  FloatingPointRegister
 
struct  FunctionTraits
 
struct  FunctionTraits< FuncRet(FuncArgs...)>
 
class  GlobalRegistrar
 A global singleton registrar. Used with Assignments for now. More...
 
struct  IntRegister
 General Purpose Register. More...
 
class  MemoryIOBase
 Base class for interacting with a tracee's memory in a variety of ways at a (relatively) high-level Functionally a data pipeline between the tracer and tracee. More...
 
struct  MemoryIOSerde
 Example class implementation: More...
 
struct  MemoryIOSerde< NativeByteVector >
 
struct  MemoryIOSerde< NonTermString< Length > >
 
struct  MemoryIOSerde< std::string >
 
struct  MemoryIOSerde< T >
 
struct  MultiStudentResult
 
class  MultiStudentRunner
 
class  NonCopyable
 A trivially-movable, but non-copyable type. More...
 
class  NonMovable
 A non-movable and non-copyable type. More...
 
struct  NonTermString
 
struct  Overloaded
 
struct  pair
 
class  PlainTextSerializer
 
class  ProfessorApp
 
class  Program
 
struct  ProgramOptions
 
class  PtraceMemoryIO
 TraceeMemory implemented using ptrace(2) commands. More...
 
struct  RegistersState
 
struct  remove_all_pointers
 Removes all levels of pointers on a type. More...
 
struct  remove_all_pointers< T * >
 Removes all levels of pointers on a type. More...
 
class  Requirement
 
struct  RequirementResult
 
struct  RunMetadata
 
class  RunResult
 
class  Serializer
 
class  Sink
 
class  StaticString
 A fully compile-time capable string type Guaranteed to be null-terminated. More...
 
class  StdoutSink
 
class  StudentApp
 
struct  StudentInfo
 
struct  StudentResult
 
class  Subprocess
 
struct  Symbol
 Basic definition for a symbol found in an ELF file. More...
 
class  SymbolTable
 A basic symbol table, for simple interaction with a number of symbols loaded from an ELF file. More...
 
struct  SyscallEntry
 
struct  SyscallRecord
 Record of a syscall for use with Tracer to keep track of which syscalls a child process invokes. More...
 
class  TestAutoRegistrar
 Helper class that, whem constructed, automatically constructs and registers a test. More...
 
class  TestBase
 Base class primarily for a user-written test. More...
 
class  TestContext
 User-facing API for use within an assignment test case for: Interacting with or querying data for the student's assembled binary Test result collection (requirements, pass/fail cases) Performing any other esoteric test-related action. More...
 
struct  TestResult
 
struct  to_array_like_fn
 
struct  to_static_container_fn
 Range adaptor function to convert a range to a static (sized at compile time) container, like std::array, std::tuple, etc. More...
 
class  TracedSubprocess
 A subprocess managed by a tracer. More...
 
struct  TracedWaitid
 
class  Tracer
 A lightweight wrapper of ptrace(2) More...
 
struct  UnexpectedT
 
struct  X64FlagsBase
 Derived classes should use Aarch64FlagsBase with the CRTP pattern. More...
 

Concepts

concept  ChronoDuration
 
concept  CompatibleFunctionArgs
 
concept  C
 
concept  IsTemplate
 
concept  HasStaticSize
 
concept  MemoryReadSupported
 
concept  MemoryWriteSupported
 
concept  MemoryRWSupported
 
concept  MemoryIOCompatible
 A trait for types that are compatible in how they are read and written to memory.
 

Typedefs

template<std::size_t N>
using NativeByteArray = ByteArray<N, EndiannessKind::Native>
 
using NativeByteVector = ByteVector<EndiannessKind::Native>
 
template<typename T >
using Result = Expected<T, ErrorKind>
 
template<std::size_t NumBits>
using sized_int_t = detail::sized_int_impl<std::bit_width(NumBits) - 1>
 
template<std::size_t NumBits>
using sized_uint_t = detail::sized_uint_impl<std::bit_width(NumBits) - 1>
 
template<typename T >
using remove_all_pointers_t = remove_all_pointers<T>::type
 

Enumerations

enum class  ErrorKind {
  TimedOut , UnresolvedSymbol , UnexpectedReturn , BadArgument ,
  SyscallFailure , SyscallPredSat , UnknownError , MaxErrorNum
}
 
enum class  ProcessorKind { Aarch64 , x86_64 }
 
enum class  EndiannessKind { Little = 0 , Big = 1 , Native = (is_little_endian() ? Little : Big) }
 
enum class  PtraceEvent {
  Stop = PTRACE_EVENT_STOP , Clone = PTRACE_EVENT_CLONE , Exec = PTRACE_EVENT_EXEC , Exit = PTRACE_EVENT_EXIT ,
  Fork = PTRACE_EVENT_FORK , VFork = PTRACE_EVENT_VFORK , VForkDone = PTRACE_EVENT_VFORK_DONE , Seccomp = PTRACE_EVENT_SECCOMP
}
 
enum class  VerbosityLevel {
  Silent , Quiet , Summary , All ,
  Extra , Max
}
 See Description of Levels for an explaination of each of the levels. Max is just used as a sentinal for now. More...
 
enum class  AppMode { Student , Professor }
 

Functions

template<typename T >
constexpr DecomposedExpr<"", T > operator<= (Decomposer, T &&expr_lhs)
 
template<typename T , typename U >
constexpr DecomposedExpr<"==", T, U > operator== (DecomposedExpr<"", T > &&expr_lhs, U &&expr_rhs)
 
template<typename T , typename U >
constexpr DecomposedExpr<"!=", T, U > operator!= (DecomposedExpr<"", T > &&expr_lhs, U &&expr_rhs)
 
template<typename T , typename U >
constexpr DecomposedExpr<">=", T, U > operator>= (DecomposedExpr<"", T > &&expr_lhs, U &&expr_rhs)
 
DISABLE_OPERATOR & DISABLE_OPERATOR (|);DISABLE_OPERATOR(^
 
DISABLE_OPERATOR && DISABLE_OPERATOR (||);DISABLE_OPERATOR(+=
 
 DISABLE_OPERATOR (-=)
 
DISABLE_OPERATOR * DISABLE_OPERATOR (/=);DISABLE_OPERATOR(%=
 
 DISABLE_OPERATOR (<<=)
 
 DISABLE_OPERATOR (> >=)
 
DISABLE_OPERATOR & DISABLE_OPERATOR (^=);DISABLE_OPERATOR(|=
 
 DISABLE_OPERATOR (COMMA)
 
 DISABLE_CHAINED_OPERATOR (==)
 
 DISABLE_CHAINED_OPERATOR (!=)
 
 DISABLE_CHAINED_OPERATOR (<=)
 
 DISABLE_CHAINED_OPERATOR (>=)
 
template<StaticString OpStr, typename T >
 Requirement (DecomposedExpr< OpStr, T > &&, const inspection::Tokenizer<> &, std::string) -> Requirement< exprs::Noop< T > >
 Deduction guide for a single type decomposition expr.
 
template<StaticString OpStr, typename T , typename U >
 Requirement (DecomposedExpr< OpStr, T, U > &&, const inspection::Tokenizer<> &, std::string) -> Requirement< exprs::OpStrToType< OpStr, T, U > >
 Deduction guide for a binary type decomposition expr.
 
template<template< EndiannessKind > typename To, EndiannessKind Endianness, ranges::range Range>
requires (std::is_trivially_copyable_v<ranges::range_value_t<Range>>)
constexpr auto to_bytes (const Range &range)
 Reinterpret a range of trivially copyable values as a ByteVector of specified endianness, or as a ByteArray of specified or deduced size and specified endianness.
 
template<std::same_as< NativeByteVector > NativeTo, ranges::range Range>
requires (std::is_trivially_copyable_v<ranges::range_value_t<Range>>)
constexpr auto to_bytes (const Range &range)
 
template<template< std::size_t, EndiannessKind > typename SizedTo, std::size_t Size, EndiannessKind Endianness, ranges::range Range>
requires (std::is_trivially_copyable_v<ranges::range_value_t<Range>>)
constexpr auto to_bytes (const Range &range)
 
template<template< std::size_t, EndiannessKind > typename SizedTo, EndiannessKind Endianness, ranges::range Range>
requires (std::is_trivially_copyable_v<ranges::range_value_t<Range>> && std::is_trivially_copyable_v<ranges::range_value_t<Range>>)
constexpr auto to_bytes (const Range &range)
 
template<template< std::size_t > typename NativeSizedTo, std::size_t Size, ranges::range Range>
requires (std::same_as<NativeSizedTo<Size>, NativeByteArray<Size>> && std::is_trivially_copyable_v<ranges::range_value_t<Range>>)
constexpr auto to_bytes (const Range &range)
 
template<template< std::size_t > typename NativeSizedTo, ranges::range Range>
requires (std::same_as<NativeSizedTo<0>, NativeByteArray<0>> && std::is_trivially_copyable_v<ranges::range_value_t<Range>>)
constexpr auto to_bytes (const Range &range)
 
template<template< EndiannessKind > typename To, EndiannessKind Endianness, C< std::is_trivially_copyable >... Ts>
constexpr auto to_bytes (const Ts &... values)
 Reinterpret trivially copyable value(s) as a ByteVector or ByteArray, specifications ditto.
 
template<std::same_as< NativeByteVector > NativeTo, C< std::is_trivially_copyable >... Ts>
constexpr auto to_bytes (const Ts &... values)
 
template<template< std::size_t, EndiannessKind > typename SizedTo, std::size_t Size, EndiannessKind Endianness, C< std::is_trivially_copyable >... Ts>
constexpr auto to_bytes (const Ts &... values)
 
template<template< std::size_t > typename NativeSizedTo, std::size_t Size, C< std::is_trivially_copyable >... Ts>
requires (std::same_as<NativeSizedTo<Size>, NativeByteArray<Size>>)
constexpr auto to_bytes (const Ts &... values)
 
template<template< std::size_t N > typename NativeSizedTo, C< std::is_trivially_copyable >... Ts>
requires (std::same_as<NativeSizedTo<0>, NativeByteArray<0>>)
constexpr auto to_bytes (const Ts &... values)
 
template<EndiannessKind Endianness = EndiannessKind::Native>
constexpr decltype(auto) as_bytes ()
 callable providing a view adaptor to reinterpret a range of trivially copyable values as bytes.
 
template<typename T , typename... U>
 ByteArray (T, U...) -> ByteArray< sizeof...(U)+1, EndiannessKind::Native >
 Deduction guide.
 
 CCTYPE_IMPL (isdigit, bool)
 
 CCTYPE_IMPL (isxdigit, bool)
 
 CCTYPE_IMPL (islower, bool)
 
 CCTYPE_IMPL (isupper, bool)
 
 CCTYPE_IMPL (isalpha, bool)
 
 CCTYPE_IMPL (isalnum, bool)
 
 CCTYPE_IMPL (iscntrl, bool)
 
 CCTYPE_IMPL (isgraph, bool)
 
 CCTYPE_IMPL (isprint, bool)
 
 CCTYPE_IMPL (isblank, bool)
 
 CCTYPE_IMPL (isspace, bool)
 
 CCTYPE_IMPL (ispunct, bool)
 
 CCTYPE_IMPL (toupper, char)
 
 CCTYPE_IMPL (tolower, char)
 
template<typename T >
requires std::is_arithmetic_v<T>
constexpr T abs (T val)
 
template<typename BaseT , std::unsigned_integral ExpT>
requires std::is_arithmetic_v<BaseT>
constexpr std::common_type_t< BaseT, ExpT > pow (BaseT base, ExpT exp)
 
template<typename T >
requires (fmt::formattable<T>)
std::string format_or_unknown (T &&value, fmt::format_string< T > fmt="{}")
 
template<typename T >
requires (!fmt::formattable<T>)
std::string format_or_unknown (T &&, fmt::format_string< std::string_view > fmt="{}")
 
template<typename OutputIt , typename T >
requires (fmt::formattable<T>)
auto format_to_or_unknown (OutputIt &&out, T &&value, fmt::format_string< T > fmt="{}")
 
template<typename OutputIt , typename T >
requires (!fmt::formattable<T>)
auto format_to_or_unknown (OutputIt &&out, T &&, fmt::format_string< std::string_view > fmt="{}")
 
consteval bool is_little_endian ()
 
template<typename T1 , typename T2 >
 pair (T1, T2) -> pair< T1, T2 >
 
template<std::size_t N>
 StaticString (const char(&input)[N]) -> StaticString< N - 1 >
 
template<StaticString Fmt, std::size_t MaxSz = 10 * 1'024, fmt::formattable... Args>
constexpr auto static_format (Args &&... args)
 
template<std::size_t N>
constexpr std::string_view format_as (const StaticString< N > &str)
 
template<std::size_t I, std::size_t Size>
requires (I < Size)
constexpr char get (const ::asmgrader::StaticString< Size > &str)
 Specialization of get to play nice with algorithms that work on tuple-like types.
 
template<ranges::range StaticallySizedContainer>
requires (HasStaticSize<StaticallySizedContainer>)
constexpr auto static_to ()
 A pipeable adaptor to convert to any static container. Just like ranges::to, but statically sized.
 
template<std::size_t N, template< typename, std::size_t > typename ArrayLike>
constexpr auto static_to ()
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Specify a static size and an "array-like" class template to convert to.
 
template<std::size_t N>
constexpr auto to_array ()
 A pipeable adaptor to a std::array.
 
template<ranges::range Container>
constexpr auto maybe_static_to ()
 A pipeable adaptor to convert to any container, statically or dynamically sized. Internally uses static_to for supported containers, and ranges::to for all others.
 
void unreachable ()
 
std::string get_err_msg (int err)
 Obtain Linux error code message given by err via libc functions.
 
std::string get_err_msg ()
 Obtain Linux error (i.e., errno) message via libc functions.
 
void init_loggers ()
 
template<typename Range >
consteval std::size_t get_static_size ()
 
template<typename Range >
constexpr std::size_t get_static_size_or (std::size_t default_value)
 
template<typename Func , typename Tuple >
constexpr auto tuple_find_first (Func &&pred, const Tuple &val)
 
constexpr bool operator== (const std::timespec &lhs, const std::timespec &rhs)
 
template<std::floating_point Arg>
auto setup_function_param (const Arg &arg)
 
template<typename T >
void trace_exception (const T &exception)
 
template<typename Func , typename... Args>
requires (std::invocable<Func, Args...>)
std::optional< std::invoke_result_t< Func, Args... > > wrap_throwable_fn (Func &&fn, Args &&... args)
 
bool is_color_terminal () noexcept
 
bool in_terminal (FILE *file) noexcept
 
Expected< winsize > terminal_size (FILE *file) noexcept
 
 __attribute__ ((format(strftime, 2, 0))) inline Expected< std
 
constexpr bool should_output_requirement (VerbosityLevel level, bool passed)
 See VerbosityLevel.
 
constexpr bool should_output_test (VerbosityLevel level)
 See VerbosityLevel.
 
constexpr bool should_output_student_summary (VerbosityLevel level)
 See VerbosityLevel.
 
constexpr bool should_output_grade_percentage (VerbosityLevel level)
 See VerbosityLevel.
 
constexpr bool should_output_requirement_details (VerbosityLevel level)
 See VerbosityLevel.
 
constexpr bool should_output_run_metadata (VerbosityLevel level)
 See VerbosityLevel.
 
ProgramOptions parse_args_or_exit (std::span< const char * > args, int exit_code) noexcept
 
consteval unsigned int get_version ()
 

Variables

template<typename T >
constexpr bool always_false_v = always_false<T>::value
 
template<template< typename > typename Cond, typename... Ts>
constexpr std::size_t count_if_v = count_if<Cond, Ts...>::value
 
template<template< typename > typename Cond, typename... Ts>
constexpr std::size_t count_if_not_v = count_if_not<Cond, Ts...>::value
 
template<typename IntType >
constexpr std::size_t digits10_max_count = std::numeric_limits<std::decay_t<IntType>>::digits10 + 1
 This was a little confusing (to me at least) digits10 => maximum number of base-10 digits that can be represented with IntType below is a definition for the inverse of that i.e. => maximmum number of base-10 digits that IntType can represent For both signed and unsigned integer types, the value that produces the maximal amount of base10 digits will never itself be a power of 10. The proof for this is trivial using parity to check when all bits are set [2^(n+1) - 1] and factorization to check 2^n (for the negative complement of signed min).
 
constexpr auto APP_MODE = AppMode::Student
 

Typedef Documentation

◆ NativeByteArray

template<std::size_t N>
using asmgrader::NativeByteArray = ByteArray<N, EndiannessKind::Native>

◆ NativeByteVector

◆ remove_all_pointers_t

template<typename T >
using asmgrader::remove_all_pointers_t = remove_all_pointers<T>::type

◆ Result

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

◆ sized_int_t

template<std::size_t NumBits>
using asmgrader::sized_int_t = detail::sized_int_impl<std::bit_width(NumBits) - 1>

◆ sized_uint_t

template<std::size_t NumBits>
using asmgrader::sized_uint_t = detail::sized_uint_impl<std::bit_width(NumBits) - 1>

Enumeration Type Documentation

◆ AppMode

enum class asmgrader::AppMode
strong
Enumerator
Student 
Professor 

◆ EndiannessKind

enum class asmgrader::EndiannessKind
strong
Enumerator
Little 
Big 
Native 

◆ ErrorKind

enum class asmgrader::ErrorKind
strong
Enumerator
TimedOut 

Program / operation surpassed maximum timeout (gennerally specified)

UnresolvedSymbol 

Failed to resolve a named symbol in a program.

UnexpectedReturn 

A function returned happened due to an unexpected condition.

BadArgument 

Bad argument to an AsmFunction. For an unwrappable type with no inner value.

SyscallFailure 

A Linux syscall failed.

SyscallPredSat 

The syscall predicate passed to Tracer::run_until was satisfied.

UnknownError 

As named; use this as little as possible.

MaxErrorNum 

◆ ProcessorKind

enum class asmgrader::ProcessorKind
strong
Enumerator
Aarch64 
x86_64 

◆ PtraceEvent

enum class asmgrader::PtraceEvent
strong
Enumerator
Stop 
Clone 
Exec 
Exit 
Fork 
VFork 
VForkDone 
Seccomp 

◆ VerbosityLevel

enum class asmgrader::VerbosityLevel
strong

See Description of Levels for an explaination of each of the levels. Max is just used as a sentinal for now.

Enumerator
Silent 

Silent

Quiet 

Quiet

Summary 

Summary (default)

All 

All

Extra 

Extra

Max 

Max

Function Documentation

◆ __attribute__()

asmgrader::__attribute__ ( (format(strftime, 2, 0)) )

◆ abs()

template<typename T >
requires std::is_arithmetic_v<T>
T asmgrader::abs ( T val)
constexpr

◆ as_bytes()

template<EndiannessKind Endianness = EndiannessKind::Native>
decltype(auto) asmgrader::as_bytes ( )
constexpr

callable providing a view adaptor to reinterpret a range of trivially copyable values as bytes.

See also
to_bytes

◆ ByteArray()

template<typename T , typename... U>
asmgrader::ByteArray ( T ,
U...  ) -> ByteArray< sizeof...(U)+1, EndiannessKind::Native >

Deduction guide.

◆ CCTYPE_IMPL() [1/14]

asmgrader::CCTYPE_IMPL ( isalnum ,
bool  )

◆ CCTYPE_IMPL() [2/14]

asmgrader::CCTYPE_IMPL ( isalpha ,
bool  )

◆ CCTYPE_IMPL() [3/14]

asmgrader::CCTYPE_IMPL ( isblank ,
bool  )

◆ CCTYPE_IMPL() [4/14]

asmgrader::CCTYPE_IMPL ( iscntrl ,
bool  )

◆ CCTYPE_IMPL() [5/14]

asmgrader::CCTYPE_IMPL ( isdigit ,
bool  )

◆ CCTYPE_IMPL() [6/14]

asmgrader::CCTYPE_IMPL ( isgraph ,
bool  )

◆ CCTYPE_IMPL() [7/14]

asmgrader::CCTYPE_IMPL ( islower ,
bool  )

◆ CCTYPE_IMPL() [8/14]

asmgrader::CCTYPE_IMPL ( isprint ,
bool  )

◆ CCTYPE_IMPL() [9/14]

asmgrader::CCTYPE_IMPL ( ispunct ,
bool  )

◆ CCTYPE_IMPL() [10/14]

asmgrader::CCTYPE_IMPL ( isspace ,
bool  )

◆ CCTYPE_IMPL() [11/14]

asmgrader::CCTYPE_IMPL ( isupper ,
bool  )

◆ CCTYPE_IMPL() [12/14]

asmgrader::CCTYPE_IMPL ( isxdigit ,
bool  )

◆ CCTYPE_IMPL() [13/14]

asmgrader::CCTYPE_IMPL ( tolower ,
char  )

◆ CCTYPE_IMPL() [14/14]

asmgrader::CCTYPE_IMPL ( toupper ,
char  )

◆ DISABLE_CHAINED_OPERATOR() [1/4]

asmgrader::DISABLE_CHAINED_OPERATOR ( ! )

◆ DISABLE_CHAINED_OPERATOR() [2/4]

asmgrader::DISABLE_CHAINED_OPERATOR ( <= )

◆ DISABLE_CHAINED_OPERATOR() [3/4]

asmgrader::DISABLE_CHAINED_OPERATOR ( )

◆ DISABLE_CHAINED_OPERATOR() [4/4]

asmgrader::DISABLE_CHAINED_OPERATOR ( >= )

◆ DISABLE_OPERATOR() [1/8]

asmgrader::DISABLE_OPERATOR ( - )

◆ DISABLE_OPERATOR() [2/8]

DISABLE_OPERATOR * asmgrader::DISABLE_OPERATOR ( / )

◆ DISABLE_OPERATOR() [3/8]

asmgrader::DISABLE_OPERATOR ( << )

◆ DISABLE_OPERATOR() [4/8]

asmgrader::DISABLE_OPERATOR ( >= )

◆ DISABLE_OPERATOR() [5/8]

DISABLE_OPERATOR & asmgrader::DISABLE_OPERATOR ( ^ )

◆ DISABLE_OPERATOR() [6/8]

asmgrader::DISABLE_OPERATOR ( COMMA )

◆ DISABLE_OPERATOR() [7/8]

DISABLE_OPERATOR & asmgrader::DISABLE_OPERATOR ( | )

◆ DISABLE_OPERATOR() [8/8]

DISABLE_OPERATOR && asmgrader::DISABLE_OPERATOR ( || )

◆ format_as()

template<std::size_t N>
std::string_view asmgrader::format_as ( const StaticString< N > & str)
constexpr

◆ format_or_unknown() [1/2]

template<typename T >
requires (!fmt::formattable<T>)
std::string asmgrader::format_or_unknown ( T && ,
fmt::format_string< std::string_view > fmt = "{}" )
inline

◆ format_or_unknown() [2/2]

template<typename T >
requires (fmt::formattable<T>)
std::string asmgrader::format_or_unknown ( T && value,
fmt::format_string< T > fmt = "{}" )
inline

◆ format_to_or_unknown() [1/2]

template<typename OutputIt , typename T >
requires (!fmt::formattable<T>)
auto asmgrader::format_to_or_unknown ( OutputIt && out,
T && ,
fmt::format_string< std::string_view > fmt = "{}" )
inline

◆ format_to_or_unknown() [2/2]

template<typename OutputIt , typename T >
requires (fmt::formattable<T>)
auto asmgrader::format_to_or_unknown ( OutputIt && out,
T && value,
fmt::format_string< T > fmt = "{}" )
inline

◆ get()

template<std::size_t I, std::size_t Size>
requires (I < Size)
char asmgrader::get ( const ::asmgrader::StaticString< Size > & str)
constexpr

Specialization of get to play nice with algorithms that work on tuple-like types.

◆ get_err_msg() [1/2]

std::string asmgrader::get_err_msg ( )
inline

Obtain Linux error (i.e., errno) message via libc functions.

◆ get_err_msg() [2/2]

std::string asmgrader::get_err_msg ( int err)
inline

Obtain Linux error code message given by err via libc functions.

◆ get_static_size()

template<typename Range >
std::size_t asmgrader::get_static_size ( )
consteval

◆ get_static_size_or()

template<typename Range >
std::size_t asmgrader::get_static_size_or ( std::size_t default_value)
constexpr

◆ get_version()

unsigned int asmgrader::get_version ( )
consteval

◆ in_terminal()

bool asmgrader::in_terminal ( FILE * file)
noexcept

◆ init_loggers()

void asmgrader::init_loggers ( )
inline

◆ is_color_terminal()

bool asmgrader::is_color_terminal ( )
noexcept

◆ is_little_endian()

bool asmgrader::is_little_endian ( )
consteval

◆ maybe_static_to()

template<ranges::range Container>
auto asmgrader::maybe_static_to ( )
constexpr

A pipeable adaptor to convert to any container, statically or dynamically sized. Internally uses static_to for supported containers, and ranges::to for all others.

◆ operator!=()

template<typename T , typename U >
DecomposedExpr<"!=", T, U > asmgrader::operator!= ( DecomposedExpr<"", T > && expr_lhs,
U && expr_rhs )
constexpr

◆ operator<=()

template<typename T >
DecomposedExpr<"", T > asmgrader::operator<= ( Decomposer ,
T && expr_lhs )
constexpr

◆ operator==() [1/2]

bool asmgrader::operator== ( const std::timespec & lhs,
const std::timespec & rhs )
constexpr

◆ operator==() [2/2]

template<typename T , typename U >
DecomposedExpr<"==", T, U > asmgrader::operator== ( DecomposedExpr<"", T > && expr_lhs,
U && expr_rhs )
constexpr

◆ operator>=()

template<typename T , typename U >
DecomposedExpr<">=", T, U > asmgrader::operator>= ( DecomposedExpr<"", T > && expr_lhs,
U && expr_rhs )
constexpr

◆ pair()

template<typename T1 , typename T2 >
asmgrader::pair ( T1 ,
T2  ) -> pair< T1, T2 >

◆ parse_args_or_exit()

ProgramOptions asmgrader::parse_args_or_exit ( std::span< const char * > args,
int exit_code )
noexcept

◆ pow()

template<typename BaseT , std::unsigned_integral ExpT>
requires std::is_arithmetic_v<BaseT>
std::common_type_t< BaseT, ExpT > asmgrader::pow ( BaseT base,
ExpT exp )
constexpr

◆ Requirement() [1/2]

template<StaticString OpStr, typename T >
asmgrader::Requirement ( DecomposedExpr< OpStr, T > && ,
const inspection::Tokenizer<> & ,
std::string  ) -> Requirement< exprs::Noop< T > >

Deduction guide for a single type decomposition expr.

◆ Requirement() [2/2]

template<StaticString OpStr, typename T , typename U >
asmgrader::Requirement ( DecomposedExpr< OpStr, T, U > && ,
const inspection::Tokenizer<> & ,
std::string  ) -> Requirement< exprs::OpStrToType< OpStr, T, U > >

Deduction guide for a binary type decomposition expr.

◆ setup_function_param()

template<std::floating_point Arg>
auto asmgrader::setup_function_param ( const Arg & arg)

◆ should_output_grade_percentage()

bool asmgrader::should_output_grade_percentage ( VerbosityLevel level)
constexpr

◆ should_output_requirement()

bool asmgrader::should_output_requirement ( VerbosityLevel level,
bool passed )
constexpr

◆ should_output_requirement_details()

bool asmgrader::should_output_requirement_details ( VerbosityLevel level)
constexpr

◆ should_output_run_metadata()

bool asmgrader::should_output_run_metadata ( VerbosityLevel level)
constexpr

◆ should_output_student_summary()

bool asmgrader::should_output_student_summary ( VerbosityLevel level)
constexpr

◆ should_output_test()

bool asmgrader::should_output_test ( VerbosityLevel level)
constexpr

◆ static_format()

template<StaticString Fmt, std::size_t MaxSz = 10 * 1'024, fmt::formattable... Args>
auto asmgrader::static_format ( Args &&... args)
constexpr

◆ static_to() [1/2]

template<ranges::range StaticallySizedContainer>
requires (HasStaticSize<StaticallySizedContainer>)
auto asmgrader::static_to ( )
constexpr

A pipeable adaptor to convert to any static container. Just like ranges::to, but statically sized.

◆ static_to() [2/2]

template<std::size_t N, template< typename, std::size_t > typename ArrayLike>
auto asmgrader::static_to ( )
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Specify a static size and an "array-like" class template to convert to.

◆ StaticString()

template<std::size_t N>
asmgrader::StaticString ( const char(&) input[N]) -> StaticString< N - 1 >

◆ terminal_size()

Expected< winsize > asmgrader::terminal_size ( FILE * file)
noexcept

◆ to_array()

template<std::size_t N>
auto asmgrader::to_array ( )
constexpr

A pipeable adaptor to a std::array.

◆ to_bytes() [1/11]

template<template< EndiannessKind > typename To, EndiannessKind Endianness, ranges::range Range>
requires (std::is_trivially_copyable_v<ranges::range_value_t<Range>>)
auto asmgrader::to_bytes ( const Range & range)
constexpr

Reinterpret a range of trivially copyable values as a ByteVector of specified endianness, or as a ByteArray of specified or deduced size and specified endianness.

NativeByteVector or NativeByteArray aliases may alternatively provided, ommitting the endianness parameter.

Template Parameters
Toa ByteVector class template
Endiannessthe endianness of the ByteVector
Rangethe type of the range
Parameters
rangea range of trivially copyable values

◆ to_bytes() [2/11]

template<std::same_as< NativeByteVector > NativeTo, ranges::range Range>
requires (std::is_trivially_copyable_v<ranges::range_value_t<Range>>)
auto asmgrader::to_bytes ( const Range & range)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Template Parameters
NativeToa NativeByteVector class template

◆ to_bytes() [3/11]

template<template< std::size_t, EndiannessKind > typename SizedTo, std::size_t Size, EndiannessKind Endianness, ranges::range Range>
requires (std::is_trivially_copyable_v<ranges::range_value_t<Range>>)
auto asmgrader::to_bytes ( const Range & range)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Template Parameters
SizedToa ByteArray class template
Sizethe size of the ByteArray

◆ to_bytes() [4/11]

template<template< std::size_t, EndiannessKind > typename SizedTo, EndiannessKind Endianness, ranges::range Range>
requires (std::is_trivially_copyable_v<ranges::range_value_t<Range>> && std::is_trivially_copyable_v<ranges::range_value_t<Range>>)
auto asmgrader::to_bytes ( const Range & range)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ to_bytes() [5/11]

template<template< std::size_t > typename NativeSizedTo, std::size_t Size, ranges::range Range>
requires (std::same_as<NativeSizedTo<Size>, NativeByteArray<Size>> && std::is_trivially_copyable_v<ranges::range_value_t<Range>>)
auto asmgrader::to_bytes ( const Range & range)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Template Parameters
NativeSizedToa NativeByteArray class template

◆ to_bytes() [6/11]

template<template< std::size_t > typename NativeSizedTo, ranges::range Range>
requires (std::same_as<NativeSizedTo<0>, NativeByteArray<0>> && std::is_trivially_copyable_v<ranges::range_value_t<Range>>)
auto asmgrader::to_bytes ( const Range & range)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ to_bytes() [7/11]

template<template< EndiannessKind > typename To, EndiannessKind Endianness, C< std::is_trivially_copyable >... Ts>
auto asmgrader::to_bytes ( const Ts &... values)
constexpr

Reinterpret trivially copyable value(s) as a ByteVector or ByteArray, specifications ditto.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Template Parameters
Tsthe types of the values to reinterpret
Parameters
valuesthe values to reinterpret

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ to_bytes() [8/11]

template<std::same_as< NativeByteVector > NativeTo, C< std::is_trivially_copyable >... Ts>
auto asmgrader::to_bytes ( const Ts &... values)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ to_bytes() [9/11]

template<template< std::size_t, EndiannessKind > typename SizedTo, std::size_t Size, EndiannessKind Endianness, C< std::is_trivially_copyable >... Ts>
auto asmgrader::to_bytes ( const Ts &... values)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ to_bytes() [10/11]

template<template< std::size_t > typename NativeSizedTo, std::size_t Size, C< std::is_trivially_copyable >... Ts>
requires (std::same_as<NativeSizedTo<Size>, NativeByteArray<Size>>)
auto asmgrader::to_bytes ( const Ts &... values)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ to_bytes() [11/11]

template<template< std::size_t N > typename NativeSizedTo, C< std::is_trivially_copyable >... Ts>
requires (std::same_as<NativeSizedTo<0>, NativeByteArray<0>>)
auto asmgrader::to_bytes ( const Ts &... values)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ trace_exception()

template<typename T >
void asmgrader::trace_exception ( const T & exception)

◆ tuple_find_first()

template<typename Func , typename Tuple >
auto asmgrader::tuple_find_first ( Func && pred,
const Tuple & val )
constexpr

◆ unreachable()

void asmgrader::unreachable ( )
inline

◆ wrap_throwable_fn()

template<typename Func , typename... Args>
requires (std::invocable<Func, Args...>)
std::optional< std::invoke_result_t< Func, Args... > > asmgrader::wrap_throwable_fn ( Func && fn,
Args &&... args )

Variable Documentation

◆ always_false_v

template<typename T >
bool asmgrader::always_false_v = always_false<T>::value
constexpr

◆ APP_MODE

auto asmgrader::APP_MODE = AppMode::Student
constexpr

◆ count_if_not_v

template<template< typename > typename Cond, typename... Ts>
std::size_t asmgrader::count_if_not_v = count_if_not<Cond, Ts...>::value
constexpr

◆ count_if_v

template<template< typename > typename Cond, typename... Ts>
std::size_t asmgrader::count_if_v = count_if<Cond, Ts...>::value
constexpr

◆ digits10_max_count

template<typename IntType >
std::size_t asmgrader::digits10_max_count = std::numeric_limits<std::decay_t<IntType>>::digits10 + 1
constexpr

This was a little confusing (to me at least) digits10 => maximum number of base-10 digits that can be represented with IntType below is a definition for the inverse of that i.e. => maximmum number of base-10 digits that IntType can represent For both signed and unsigned integer types, the value that produces the maximal amount of base10 digits will never itself be a power of 10. The proof for this is trivial using parity to check when all bits are set [2^(n+1) - 1] and factorization to check 2^n (for the negative complement of signed min).

Using the property above, we know that the maximum maximum number of base-10 digits that IntType can represent is digits10 + 1