Toast Engine
Loading...
Searching...
No Matches
assets::InputLayout Class Reference

Asset representing an input layout loaded from a .tlayout file. More...

#include <input_layout.hpp>

Inheritance diagram for assets::InputLayout:
Collaboration diagram for assets::InputLayout:

Classes

struct  Entry
 One action reference inside a layout. More...

Public Member Functions

 InputLayout (const toml::table &table, Handle< Schema > schema={})
 Parses the layout from a TOML table, keeping all keys for round-trip serialization.
auto type () const -> std::string_view override
auto name () const noexcept -> std::string_view
auto layers () const noexcept -> const std::vector< std::string > &
auto entries () const noexcept -> const std::vector< Entry > &
Public Member Functions inherited from assets::Data
 Data (const toml::table &table, Handle< Schema > schema={})
 Data (const toml::table &table, Handle< Schema > schema, KeepAllKeysTag)
 Stores the schema handle for round-trip serialization but runs free-form buildRoot, keeping every TOML key.
auto operator[] (std::string_view k) -> DataValue &
auto operator[] (std::string_view k) const -> const DataValue &
auto contains (std::string_view k) const -> bool
auto root () const -> const DataValue &
auto schema () const -> const Handle< Schema > &
auto serialize (SaveMode mode) const -> std::vector< uint8_t > override
virtual void reload (const toml::table &table)
 Re-parses the asset contents in place.
Public Member Functions inherited from assets::Asset
 Asset (const Asset &)=delete
auto operator= (const Asset &) -> Asset &=delete
auto refCount () const noexcept -> uint32_t

Static Public Member Functions

static auto isActiveForLayer (const Entry &entry, std::string_view layer) noexcept -> bool
 Whether an action is active for a given layer under this layout.

Static Public Attributes

static constexpr std::string_view default_layer = "default"
 Hidden layer that is always present in every layout.
Static Public Attributes inherited from assets::Data
static constexpr KeepAllKeysTag keep_all_keys {}

Protected Member Functions

void onReloaded () override
Protected Member Functions inherited from assets::Asset
void addRef () noexcept
void release () noexcept

Additional Inherited Members

Protected Attributes inherited from assets::Data
DataValue m_root
 Object DataValue holding all fields.
Handle< Schema > m_schema
 optional
bool m_keep_all_keys = false

Detailed Description

Asset representing an input layout loaded from a .tlayout file.

Constructor & Destructor Documentation

◆ InputLayout()

assets::InputLayout::InputLayout ( const toml::table & table,
Handle< Schema > schema = {} )
explicit

Parses the layout from a TOML table, keeping all keys for round-trip serialization.

Parameters
tableParsed contents of the .tlayout file
Here is the caller graph for this function:

Member Function Documentation

◆ entries()

auto assets::InputLayout::entries ( ) const -> const std::vector< Entry > &
nodiscardnoexcept
Returns
The action entries declared by this layout

◆ isActiveForLayer()

auto assets::InputLayout::isActiveForLayer ( const Entry & entry,
std::string_view layer ) -> bool
staticnodiscardnoexcept

Whether an action is active for a given layer under this layout.

Parameters
entryThe action entry to test
layerThe active layer name
Returns
true when the layer passes the entry's included/excluded rules

◆ layers()

auto assets::InputLayout::layers ( ) const -> const std::vector< std::string > &
nodiscardnoexcept
Returns
Every layer in the layout

◆ name()

auto assets::InputLayout::name ( ) const -> std::string_view
nodiscardnoexcept
Returns
The layout's display name

◆ onReloaded()

void assets::InputLayout::onReloaded ( )
overrideprotectedvirtual

Reimplemented from assets::Data.

◆ type()

auto assets::InputLayout::type ( ) const -> std::string_view
inlinenodiscardoverridevirtual

Reimplemented from assets::Data.


The documentation for this class was generated from the following files:
  • engine/src/toast/input/assets/input_layout.hpp
  • engine/src/toast/input/assets/input_assets.cpp