AsmGrader 0.0.0
Loading...
Searching...
No Matches
asmgrader::ByteVector Class Reference

#include <byte_vector.hpp>

Public Types

using value_type = std::byte
 
using allocator_type = std::allocator<std::byte>
 
using size_type = std::size_t
 
using difference_type = std::ptrdiff_t
 
using reference = value_type&
 
using const_reference = const value_type&
 
using pointer = value_type*
 
using const_pointer = const value_type*
 
using iterator = std::vector<std::byte>::iterator
 
using const_iterator = std::vector<std::byte>::const_iterator
 
using reverse_iterator = std::vector<std::byte>::reverse_iterator
 
using const_reverse_iterator = std::vector<std::byte>::const_reverse_iterator
 

Public Member Functions

 ByteVector ()=default
 
template<ranges::input_iterator It>
 ByteVector (It first, It last)
 
 ByteVector (std::initializer_list< std::byte > init)
 
template<typename ByteLike = std::byte>
requires requires(ByteLike value) { static_cast<std::byte>(value); }
 ByteVector (std::size_t count, ByteLike value=std::byte{0})
 
std::byte & operator[] (size_t idx)
 
const std::byte & operator[] (size_t idx) const
 
template<ranges::input_iterator It>
auto insert (const_iterator pos, It first, It last)
 
template<typename ByteLike >
requires requires(ByteLike value) { static_cast<std::byte>(value); }
void push_back (ByteLike value)
 
template<typename ByteLike >
requires requires(ByteLike value) { static_cast<std::byte>(value); }
void emplace_back (ByteLike value)
 
auto begin ()
 
auto begin () const
 
auto cbegin () const
 
auto end ()
 
auto end () const
 
auto cend () const
 
auto data ()
 
auto data () const
 
size_t size () const
 
void resize (std::size_t new_size)
 
 ByteVector (std::initializer_list< u8 > init)
 
template<ranges::range Range>
requires requires(Range range, std::size_t size, std::byte byte) { { range.resize(size) }; { std::to_integer<ranges::range_value_t<Range>>(byte) }; }
Range to_range () const
 T should be a stdlib-compatible container type where std::byte is convertible to T::value_type.
 
template<typename... Types>
requires (std::is_trivially_copyable_v<Types> && ...)
auto bit_cast_to () const -> std::conditional_t< sizeof...(Types)==1, boost::mp11::mp_first< boost::mp11::mp_list< Types... > >, std::tuple< Types... > >
 

Static Public Member Functions

template<ranges::range Range>
static ByteVector from (const Range &range)
 
template<typename... Ts>
static ByteVector from (const Ts &... args)
 

Member Typedef Documentation

◆ allocator_type

using asmgrader::ByteVector::allocator_type = std::allocator<std::byte>

◆ const_iterator

using asmgrader::ByteVector::const_iterator = std::vector<std::byte>::const_iterator

◆ const_pointer

◆ const_reference

◆ const_reverse_iterator

using asmgrader::ByteVector::const_reverse_iterator = std::vector<std::byte>::const_reverse_iterator

◆ difference_type

◆ iterator

using asmgrader::ByteVector::iterator = std::vector<std::byte>::iterator

◆ pointer

◆ reference

◆ reverse_iterator

using asmgrader::ByteVector::reverse_iterator = std::vector<std::byte>::reverse_iterator

◆ size_type

using asmgrader::ByteVector::size_type = std::size_t

◆ value_type

Constructor & Destructor Documentation

◆ ByteVector() [1/5]

asmgrader::ByteVector::ByteVector ( )
default

◆ ByteVector() [2/5]

template<ranges::input_iterator It>
asmgrader::ByteVector::ByteVector ( It first,
It last )
inline

◆ ByteVector() [3/5]

asmgrader::ByteVector::ByteVector ( std::initializer_list< std::byte > init)
inline

◆ ByteVector() [4/5]

template<typename ByteLike = std::byte>
requires requires(ByteLike value) { static_cast<std::byte>(value); }
asmgrader::ByteVector::ByteVector ( std::size_t count,
ByteLike value = std::byte{0} )
inlineexplicit

◆ ByteVector() [5/5]

asmgrader::ByteVector::ByteVector ( std::initializer_list< u8 > init)
inline

Member Function Documentation

◆ begin() [1/2]

auto asmgrader::ByteVector::begin ( )
inline

◆ begin() [2/2]

auto asmgrader::ByteVector::begin ( ) const
inline

◆ bit_cast_to()

template<typename... Types>
requires (std::is_trivially_copyable_v<Types> && ...)
auto asmgrader::ByteVector::bit_cast_to ( ) const -> std::conditional_t<sizeof...(Types) == 1, boost::mp11::mp_first<boost::mp11::mp_list<Types...>>, std::tuple<Types...>>
inline

◆ cbegin()

auto asmgrader::ByteVector::cbegin ( ) const
inline

◆ cend()

auto asmgrader::ByteVector::cend ( ) const
inline

◆ data() [1/2]

auto asmgrader::ByteVector::data ( )
inline

◆ data() [2/2]

auto asmgrader::ByteVector::data ( ) const
inline

◆ emplace_back()

template<typename ByteLike >
requires requires(ByteLike value) { static_cast<std::byte>(value); }
void asmgrader::ByteVector::emplace_back ( ByteLike value)
inline

◆ end() [1/2]

auto asmgrader::ByteVector::end ( )
inline

◆ end() [2/2]

auto asmgrader::ByteVector::end ( ) const
inline

◆ from() [1/2]

template<ranges::range Range>
static ByteVector asmgrader::ByteVector::from ( const Range & range)
inlinestatic

◆ from() [2/2]

template<typename... Ts>
static ByteVector asmgrader::ByteVector::from ( const Ts &... args)
inlinestatic

◆ insert()

template<ranges::input_iterator It>
auto asmgrader::ByteVector::insert ( const_iterator pos,
It first,
It last )
inline

◆ operator[]() [1/2]

std::byte & asmgrader::ByteVector::operator[] ( size_t idx)
inline

◆ operator[]() [2/2]

const std::byte & asmgrader::ByteVector::operator[] ( size_t idx) const
inline

◆ push_back()

template<typename ByteLike >
requires requires(ByteLike value) { static_cast<std::byte>(value); }
void asmgrader::ByteVector::push_back ( ByteLike value)
inline

◆ resize()

void asmgrader::ByteVector::resize ( std::size_t new_size)
inline

◆ size()

size_t asmgrader::ByteVector::size ( ) const
inline

◆ to_range()

template<ranges::range Range>
requires requires(Range range, std::size_t size, std::byte byte) { { range.resize(size) }; { std::to_integer<ranges::range_value_t<Range>>(byte) }; }
Range asmgrader::ByteVector::to_range ( ) const
inline

T should be a stdlib-compatible container type where std::byte is convertible to T::value_type.


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