Skip to content

sgns::runtime::binaryen::InherentData

More...

#include <inherent_data.hpp>

Public Functions

Name
template <typename T >
outcome::result< void >
putData(InherentIdentifier identifier, T inherent)
template <typename T >
void
replaceData(InherentIdentifier identifier, T inherent)
template <typename T >
outcome::result< T >
getData(const InherentIdentifier & identifier) const
bool operator==(const InherentData & rhs) const
bool operator!=(const InherentData & rhs) const

Public Attributes

Name
std::map< InherentIdentifier, base::Buffer > data

Friends

Name
std::ostream & operator<<(std::ostream & out, const InherentData & v)

Detailed Description

struct sgns::runtime::binaryen::InherentData;

Inherent data to include in a block

Public Functions Documentation

function putData

template <typename T >
inline outcome::result< void > putData(
    InherentIdentifier identifier,
    T inherent
)

Put data for an inherent into the internal storage.

  • identifier need to be unique, otherwise decoding of these values will not work!
  • inherent encoded data to be stored success if the data could be inserted an no data for an inherent with the same

function replaceData

template <typename T >
inline void replaceData(
    InherentIdentifier identifier,
    T inherent
)

Replace the data for an inherent. If it does not exist, the data is just inserted.

  • inherent encoded data to be stored

function getData

template <typename T >
inline outcome::result< T > getData(
    const InherentIdentifier & identifier
) const

Return: the data for the requested inherent.

function operator==

bool operator==(
    const InherentData & rhs
) const

function operator!=

bool operator!=(
    const InherentData & rhs
) const

Public Attributes Documentation

variable data

std::map< InherentIdentifier, base::Buffer > data;

Friends

friend operator<<

friend std::ostream & operator<<(
    std::ostream & out,

    const InherentData & v
);

Updated on 2026-03-04 at 13:10:43 -0800