Menu

class eosio::fixed_bytes

Class List > eosio :: fixed_bytes

Fixed size array of bytes sorted lexicographically. More...

Classes

Type Name
struct bool_pack

Public Types

Type Name
typedef uint128_t word_t
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 ()
static constexpr size_t num_words ()
Get number of words contained in this fixed_bytes object.
static constexpr size_t padded_bytes ()
Get number of padded bytes contained in this fixed_bytes object.
static fixed_bytes< Size > make_from_word_sequence ()
Create a new fixed_bytes object from a sequence of words.

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
constexpr fixed_bytes ()
Default constructor to fixed_bytes object.
fixed_bytes (const std::array< word_t, num_words()> & arr)
Constructor to fixed_bytes object from std::array of num_words() word_t types.
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.
fixed_bytes (const Word(&) arr)
Constructor to fixed_bytes object from fixed-sized C array of Word types smaller in size than word_t.
const auto & get_array () const
Get the contained std::array.
auto data ()
Get the underlying data of the contained std::array.
auto data () const
Get the underlying data of the contained std::array.
auto size () const
Get the size of the contained std::array.
std::array< uint8_t, Size > extract_as_byte_array () const
Extract the contained data as an array of bytes.

Friends

Type Name
friend bool operator==
Compares two fixed_bytes variables c1 and c2.
friend bool operator !=
Compares two fixed_bytes variables c1 and c2.
friend bool operator >
Compares two fixed_bytes variables c1 and c2.
friend bool operator<
Compares two fixed_bytes variables c1 and c2.
friend bool operator >=
Compares two fixed_bytes variables c1 and c2.
friend bool operator<=
Compares two fixed_bytes variables c1 and c2.

Detailed Description

Fixed size byte array sorted lexicographically

Template parameters:

Public Types Documentation

typedef word_t (2/2)

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

typedef word_t (2/2)

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

Public Static Functions Documentation

function num_words (2/2)

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 (2/2)

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 (1/2)

template<typename FirstWord, typename... Rest>
static static fixed_bytes<Size> eosio::fixed_bytes< Size >::make_from_word_sequence()

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

function num_words (2/2)

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

Get number of words contained in this fixed_bytes object.

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

function padded_bytes (2/2)

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

Get number of padded bytes contained in this fixed_bytes object.

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 (2/2)

template<typename FirstWord, typename... Rest>
static static fixed_bytes<Size> eosio::fixed_bytes< Size >::make_from_word_sequence()

Create a new fixed_bytes object from a sequence of words.

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 (5/8)

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

Default constructor to fixed_bytes object which initializes all bytes to zero

function fixed_bytes (6/8)

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 (7/8)

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 (8/8)

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 (2/2)

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

Get the contained std::array

function data (2/3)

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

Get the underlying data of the contained std::array

function size (2/2)

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

Get the size of the contained std::array

function extract_as_byte_array (2/2)

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

function fixed_bytes (5/8)

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

Default constructor to fixed_bytes object.

Default constructor to fixed_bytes object which initializes all bytes to zero

function fixed_bytes (6/8)

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.

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

Parameters:

  • arr data

function fixed_bytes (7/8)

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.

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

Parameters:

  • arr - Source data

function fixed_bytes (8/8)

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.

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 (2/2)

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

Get the contained std::array.

Get the contained std::array

function data (2/3)

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

Get the underlying data of the contained std::array.

Get the underlying data of the contained std::array

function data (3/3)

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

Get the underlying data of the contained std::array.

Get the underlying data of the contained std::array

function size (2/2)

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

Get the size of the contained std::array.

Get the size of the contained std::array

function extract_as_byte_array (2/2)

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

Extract the contained data as an array of bytes.

Extract the contained data as an array of bytes

Returns:

  • the extracted data as array of bytes

Friends Documentation

friend operator==

bool operator==(
    const fixed_bytes< Size > & c1,
    const fixed_bytes< Size > & c2
)

Compares two fixed_bytes variables c1 and c2.

Lexicographically compares two fixed_bytes variables c1 and c2

Parameters:

Returns:

if c1 == c2, return true, otherwise false

friend operator !=

bool operator !=(
    const fixed_bytes< Size > & c1,
    const fixed_bytes< Size > & c2
)

Compares two fixed_bytes variables c1 and c2.

Lexicographically compares two fixed_bytes variables c1 and c2

Parameters:

Returns:

if c1 != c2, return true, otherwise false

friend operator >

bool operator >(
    const fixed_bytes< Size > & c1,
    const fixed_bytes< Size > & c2
)

Compares two fixed_bytes variables c1 and c2.

Lexicographically compares two fixed_bytes variables c1 and c2

Parameters:

Returns:

if c1 > c2, return true, otherwise false

friend operator<

bool operator<(
    const fixed_bytes< Size > & c1,
    const fixed_bytes< Size > & c2
)

Compares two fixed_bytes variables c1 and c2.

Lexicographically compares two fixed_bytes variables c1 and c2

Parameters:

Returns:

if c1 < c2, return true, otherwise false

friend operator >=

bool operator >=(
    const fixed_bytes< Size > & c1,
    const fixed_bytes< Size > & c2
)

Compares two fixed_bytes variables c1 and c2.

Lexicographically compares two fixed_bytes variables c1 and c2

Parameters:

Returns:

if c1 >= c2, return true, otherwise false

friend operator<=

bool operator<=(
    const fixed_bytes< Size > & c1,
    const fixed_bytes< Size > & c2
)

Compares two fixed_bytes variables c1 and c2.

Lexicographically compares two fixed_bytes variables c1 and c2

Parameters:

Returns:

if c1 <= c2, return true, otherwise false


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