template <class Item, typename... Payload>

class SingleVariantItemBase

Defined at line 130 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

This is a base class for defining simple item types that store their data

directly and can handle a fixed set of alternative payload types. The

different Payload... template parameters give different types, e.g.

zbi_dcfg_this_t and zbi_dcfg_that_t. The derived class Item must then define an

overload for each Payload type:

```

static constexpr zbi_header_t ItemHeader(const zbi_dcfg_this_t

&

cfg) {

return {.type = ZBI_TYPE_KERNEL_DRIVER, .extra = ZBI_KERNEL_DRIVER_THIS};

}

static constexpr zbi_header_t ItemHeader(const zbi_dcfg_that_t

&

cfg) {

return {.type = ZBI_TYPE_KERNEL_DRIVER, .extra = ZBI_KERNEL_DRIVER_THAT};

}

```

Calling set_payload with either a zbi_dcfg_this_t or zbi_dcfg_that_t argument

installs a value. The ItemHeader overload corresponding to the type of the

argument to set_payload will be used to produce the ZBI item. set_payload

with no arguments resets it to initial state so no item is produced.

Public Methods

size_t size_bytes ()

Defined at line 136 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

Item & set_payload (const AnyPayload & payload)

Defined at line 138 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

Item & set_payload (const AnyPayload & payload)

Defined at line 138 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

Item & set_payload ()

Defined at line 143 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

fit::result<DataZbi::Error> AppendItems (DataZbi & zbi)

Defined at line 148 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

fit::result<DataZbi::Error> AppendItems (DataZbi & zbi)

Defined at line 148 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

fit::result<DataZbi::Error> AppendItems (DataZbi & zbi)

Defined at line 148 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

fit::result<DataZbi::Error> AppendItems (DataZbi & zbi)

Defined at line 148 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

Protected Methods

zbi_header_t ItemHeader (std::monostate none)

The derived class defines overloads for each Payload... type.

Defined at line 154 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

zbi_header_t ItemHeader (std::monostate none)

The derived class defines overloads for each Payload... type.

Defined at line 154 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

size_t SizeBytes (std::monostate none)

Defined at line 156 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

size_t SizeBytes (std::monostate none)

Defined at line 156 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

template <typename T>
size_t SizeBytes (const T & payload)

Defined at line 159 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

template <typename T>
size_t SizeBytes (const T & payload)

Defined at line 159 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

template <typename T>
size_t SizeBytes (const T & payload)

Defined at line 159 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

fit::result<DataZbi::Error> Append (DataZbi & zbi, std::monostate none)

Defined at line 163 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

fit::result<DataZbi::Error> Append (DataZbi & zbi, std::monostate none)

Defined at line 163 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

fit::result<DataZbi::Error> Append (DataZbi & zbi, std::monostate none)

Defined at line 163 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

fit::result<DataZbi::Error> Append (DataZbi & zbi, std::monostate none)

Defined at line 163 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

template <typename T>
fit::result<DataZbi::Error> Append (DataZbi & zbi, const T & payload)

Defined at line 168 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

template <typename T>
fit::result<DataZbi::Error> Append (DataZbi & zbi, const T & payload)

Defined at line 168 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

template <typename T>
fit::result<DataZbi::Error> Append (DataZbi & zbi, const T & payload)

Defined at line 168 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

template <typename T>
fit::result<DataZbi::Error> Append (DataZbi & zbi, const T & payload)

Defined at line 168 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

template <typename... Args>
fit::result<DataZbi::Error> Append (Args &&... args)

Defined at line 174 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

template <typename... Args>
fit::result<DataZbi::Error> Append (Args &&... args)

Defined at line 174 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

template <typename... Args>
fit::result<DataZbi::Error> Append (Args &&... args)

Defined at line 174 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

template <typename... Args>
fit::result<DataZbi::Error> Append (Args &&... args)

Defined at line 174 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h

template <typename PayloadVisitor>
void VisitPayload (PayloadVisitor && visitor)

Defined at line 180 of file ../../zircon/kernel/phys/lib/boot-shim/include/lib/boot-shim/item-base.h