class SizedArray
Defined at line 161 of file ../../src/lib/elfldltl/include/lib/elfldltl/dynamic.h
This is a utility class for the common pattern of a pair of dynamic tags
for a table address and its size in bytes. The SizedArray object's
set_address and set_size_bytes methods should be called from Observe
methods for the respective dynamic tags. Then a Finish method calls
SizedArray::Finish
<T
, Setter, Tag1, Tag2> using explicit template
arguments giving the type of table elements,
&Info
::set_foo for the setter
in info() that takes a span
<T
>, and the two tags, passing it the
diagnostics, memory and info objects by reference. This calls the setter
only if both tags were present and the table was successfully fetched from
memory. It diagnoses all the partial and invalid cases in detail with
calls to diagnostics.FormatError, and does nothing at all if neither tag
is present.
The optional third tag is for a related count that also may be present.
If this tag is supplied, the setter takes a second argument. If the
CountTag was not present at runtime, that second argument will be zero.
The SizedArray object is contextually convertible to bool to test whether
either tag was present at all.
Public Methods
template <typename T, auto Setter, ElfDynTag AddressTag, ElfDynTag SizeBytesTag, ElfDynTag CountTag = ElfDynTag::kNull, class DiagnosticsType, class Memory>
bool Finish (DiagnosticsType && diagnostics, Memory && memory, Info & info, typename Elf::size_type count)
Defined at line 165 of file ../../src/lib/elfldltl/include/lib/elfldltl/dynamic.h
bool operator bool ()
Defined at line 203 of file ../../src/lib/elfldltl/include/lib/elfldltl/dynamic.h
void set_address (typename Elf::size_type val)
Defined at line 205 of file ../../src/lib/elfldltl/include/lib/elfldltl/dynamic.h
void set_size_bytes (typename Elf::size_type val)
Defined at line 207 of file ../../src/lib/elfldltl/include/lib/elfldltl/dynamic.h