#include <input_keys.h>
A simple struct to represent input sections.
This struct contains a raw pointer to the parent section and the name of the section itself. The parent pointer is used to reconstruct the full path of labels to reach a given section from the top-level section. This is needed to declare Key objects which need the full path of labels. A Section can be implicitly converted to KeyLabels and this is desired by design (after all a YAML section is a key with a map as value).
Section are meant to be created at compile time and they are not meant to be ever modified (note the constexpr constructor). This is a crucial aspect that guarantees that compile-time construction of sections will not hit any SIOF issue. Materialization into KeyLabels is done at runtime when InputKeys members are initialized. Definition at line 64 of file input_keys.h.
Public Member Functions | |
| constexpr | Section (std::string_view name_in, const Section *parent_in=nullptr) |
| Construct a new section. More... | |
| operator KeyLabels () const | |
| Convert the section to a list of labels. More... | |
Public Attributes | |
| const Section *const | parent = nullptr |
| A pointer to the parent section. More... | |
| const std::string_view | name = "" |
| The name of the section. More... | |
Private Member Functions | |
| KeyLabels | materialize () const |
| Materialize the section into a list of labels. More... | |
|
inlineexplicitconstexpr |
Construct a new section.
| name_in | The name of the section |
| parent_in | A pointer to the parent section |
Definition at line 76 of file input_keys.h.
|
inline |
Convert the section to a list of labels.
Definition at line 85 of file input_keys.h.
|
inlineprivate |
Materialize the section into a list of labels.
Definition at line 93 of file input_keys.h.
| const Section* const smash::InputSections::Section::parent = nullptr |
A pointer to the parent section.
Definition at line 66 of file input_keys.h.
| const std::string_view smash::InputSections::Section::name = "" |
The name of the section.
Definition at line 68 of file input_keys.h.