Skip to content

Engine → ECS

view.h

Typed views.

Structs

File Description
detail::view_arg_traits
detail::view_arg_traits<maybe<ComponentType>>
maybe Marks an optional component in a view pack. The callback receives T * (null when absent).
view_access The component sets a view reads and writes, derived from its pack.

Classes

File Description
view

Type Aliases

detail::view_arg_traits::callback_type

using callback_type = PackType &;

detail::view_arg_traits::component_type

using component_type = std::remove_cv_t<PackType>;

detail::view_arg_traits::span_type

using span_type = std::span<PackType>;

detail::view_arg_traits<maybe<ComponentType>>::callback_type

using callback_type = ComponentType *;

detail::view_arg_traits<maybe<ComponentType>>::component_type

using component_type = std::remove_cv_t<ComponentType>;

detail::view_arg_traits<maybe<ComponentType>>::span_type

using span_type = std::span<ComponentType>;

Forward Declarations

command_buffer

class command_buffer;

system_context

class system_context;

world

class world;

Constants

Name Type Value Description
detail::HAS_COLUMN template <typename PackType> inline constexpr bool !std::is_empty_v<typename view_arg_traits<PackType>::component_type> False for a tag (an empty type, plain or in maybe<>): it has no column a view could hand to the callback, so it is required with view::with<Tag>() instead.

Functions

Public

detail::fetch_column

template <typename PackType> [[nodiscard]] typename view_arg_traits<PackType>::span_type fetch_column(chunk_view &view) noexcept;

detail::row_argument

template <typename PackType> [[nodiscard]] typename view_arg_traits<PackType>::callback_type row_argument( typename view_arg_traits<PackType>::span_type column, u32 row ) noexcept;