rlmesh::spaces::Dict
Named child spaces, read in declaration order.
class Dict : public SpaceTypes
Constructors
Static methods
Methods
- size()
size_t size() const - key_at()The
i-th key, borrowed while any handle sharing the Dict lives. - keys()The
i-th key, borrowed while any handle sharing the Dict lives. - values()The
i-th key, borrowed while any handle sharing the Dict lives. - items()The
i-th key, borrowed while any handle sharing the Dict lives. - spaces()The children in declaration order, sharing the Dict's child samplers.
- get()The children in declaration order, sharing the Dict's child samplers.
- contains_key()
d[key]; throwsstd::out_of_rangewhen absent. - begin()
key_iterator begin() const - end()
key_iterator end() const
Operators
key_iterator
nested type[source]class key_iteratorDict
constructor[source]explicit Dict(
const std::vector<std::pair<std::string,
SpaceSpec>>& spaces
)Dict(spaces): each spec is copied into a fresh child; keys sort.
Dict
constructor[source]explicit Dict(const SpaceSpec& spec)Dict(spaces): each spec is copied into a fresh child; keys sort.
create
static method[source]static Dict create(
const std::vector<std::pair<std::string,
SpaceSpec>>& spaces
)Dict(spaces): each spec is copied into a fresh child; keys sort.
from_spec
static method[source]static Dict from_spec(const SpaceSpec& spec)Dict(spaces): each spec is copied into a fresh child; keys sort.
size
method[source]size_t size() constkey_at
method[source]std::string_view key_at(size_t i) constThe i-th key, borrowed while any handle sharing the Dict lives.
keys
method[source]std::vector<std::string> keys() constThe i-th key, borrowed while any handle sharing the Dict lives.
values
method[source]std::vector<Space> values() constThe i-th key, borrowed while any handle sharing the Dict lives.
items
method[source]std::vector<std::pair<std::string, Space>> items() constThe i-th key, borrowed while any handle sharing the Dict lives.
spaces
method[source]std::vector<std::pair<std::string, Space>> spaces() constThe children in declaration order, sharing the Dict’s child samplers.
get
method[source]std::optional<Space> get(std::string_view key) constThe children in declaration order, sharing the Dict’s child samplers.
contains_key
method[source]bool contains_key(std::string_view key) constd[key]; throws std::out_of_range when absent.
begin
method[source]key_iterator begin() constend
method[source]key_iterator end() constoperator[]
operator[source]Space operator[](std::string_view key) constd[key]; throws std::out_of_range when absent.