This reference describes unreleased code on main; no release documents it yet.

rlmesh::spaces::Dict

classExperimental#include <rlmesh.hpp>[source]

Named child spaces, read in declaration order.

class Dict : public Space

key_iterator

nested type[source]
class key_iterator

Dict

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() const

key_at

method[source]
std::string_view key_at(size_t i) const

The i-th key, borrowed while any handle sharing the Dict lives.

keys

method[source]
std::vector<std::string> keys() const

The i-th key, borrowed while any handle sharing the Dict lives.

values

method[source]
std::vector<Space> values() const

The i-th key, borrowed while any handle sharing the Dict lives.

items

method[source]
std::vector<std::pair<std::string, Space>> items() const

The i-th key, borrowed while any handle sharing the Dict lives.

spaces

method[source]
std::vector<std::pair<std::string, Space>> spaces() const

The children in declaration order, sharing the Dict’s child samplers.

get

method[source]
std::optional<Space> get(std::string_view key) const

The children in declaration order, sharing the Dict’s child samplers.

contains_key

method[source]
bool contains_key(std::string_view key) const

d[key]; throws std::out_of_range when absent.

begin

method[source]
key_iterator begin() const

end

method[source]
key_iterator end() const

operator[]

operator[source]
Space operator[](std::string_view key) const

d[key]; throws std::out_of_range when absent.