class eosio::fixed_bytes

Class List > eosio :: fixed_bytes

Classes

Type Name
struct bool_pack

Public Types

Type Name
typedef uint128_t word_t

Public Static Functions

Type Name
static constexpr size_t num_words ()
static constexpr size_t padded_bytes ()
static fixed_bytes< Size > make_from_word_sequence (typename std::enable_if< std::is_integral< FirstWord >::value &&std::is_unsigned< FirstWord >::value &&!std::is_same< FirstWord, bool >::value &&sizeof(FirstWord)<=sizeof(word_t) &&all_true<(std::is_same< FirstWord, Rest >::value)... >::value, FirstWord >::type first_word, Rest... rest)

Public Functions

Type Name
constexpr fixed_bytes ()
fixed_bytes (const std::array< word_t, num_words()> & arr)
fixed_bytes (const std::array< Word, NumWords > & arr)
fixed_bytes (const Word(&) arr)
const auto & get_array () const
auto data ()
auto size () const
std::array< uint8_t, Size > extract_as_byte_array () const
void print () const

Detailed Description

Fixed size byte array sorted lexicographically

Template parameters:

Public Types Documentation

typedef word_t

typedef uint128_t eosio::fixed_bytes< Size >::word_t;

Public Static Functions Documentation

function num_words

static static constexpr size_t eosio::fixed_bytes< Size >::num_words()

Get number of words contained in this fixed_bytes object. A word is defined to be 16 bytes in size

function padded_bytes

static static constexpr size_t eosio::fixed_bytes< Size >::padded_bytes()

Get number of padded bytes contained in this fixed_bytes object. Padded bytes are the remaining bytes inside the fixed_bytes object after all the words are allocated

function make_from_word_sequence

template<typename FirstWord, typename... Rest>
static static fixed_bytes<Size> eosio::fixed_bytes< Size >::make_from_word_sequence(
    typename std::enable_if< std::is_integral< FirstWord >::value &&std::is_unsigned< FirstWord >::value &&!std::is_same< FirstWord, bool >::value &&sizeof(FirstWord)<=sizeof(word_t) &&all_true<(std::is_same< FirstWord, Rest >::value)... >::value, FirstWord >::type first_word,
    Rest... rest
)

Create a new fixed_bytes object from a sequence of words

Template parameters:

  • FirstWord - The type of the first word in the sequence
  • Rest - The type of the remaining words in the sequence

Parameters:

  • first_word - The first word in the sequence
  • rest - The remaining words in the sequence

Public Functions Documentation

function fixed_bytes (1/4)

constexpr eosio::fixed_bytes< Size >::fixed_bytes()

Default constructor to fixed_bytes object which initializes all bytes to zero

function fixed_bytes (2/4)

eosio::fixed_bytes< Size >::fixed_bytes(
    const std::array< word_t, num_words()> & arr
)

Constructor to fixed_bytes object from std::array of num_words() word_t types

Parameters:

  • arr data

function fixed_bytes (3/4)

template<typename Word, size_t NumWords, typename Enable>
eosio::fixed_bytes< Size >::fixed_bytes(
    const std::array< Word, NumWords > & arr
)

Constructor to fixed_bytes object from std::array of Word types smaller in size than word_t

Parameters:

  • arr - Source data

function fixed_bytes (4/4)

template<typename Word, size_t NumWords, typename Enable>
eosio::fixed_bytes< Size >::fixed_bytes(
    const Word(&) arr
)

Constructor to fixed_bytes object from fixed-sized C array of Word types smaller in size than word_t

Parameters:

  • arr - Source data

function get_array

const auto& eosio::fixed_bytes< Size >::get_array() const

Get the contained std::array

function data

auto eosio::fixed_bytes< Size >::data()

Get the underlying data of the contained std::array

function size

auto eosio::fixed_bytes< Size >::size() const

Get the size of the contained std::array

function extract_as_byte_array

std::array<uint8_t, Size> eosio::fixed_bytes< Size >::extract_as_byte_array() const

Extract the contained data as an array of bytes

Returns:

  • the extracted data as array of bytes

function print

void eosio::fixed_bytes< Size >::print() const

Prints fixed_bytes as a hexidecimal string

Parameters:

  • val to be printed

The documentation for this class was generated from the following file: libraries/eosiolib/core/eosio/fixed\_bytes.hpp