Gaia-ECS v0.9.3
A simple and powerful entity component system
Loading...
Searching...
No Matches
gaia::ecs::ComponentRawView Struct Reference

Non-owning read-only view over raw component bytes on an entity. More...

#include <component_cursor.h>

Public Member Functions

GAIA_NODISCARD bool valid () const noexcept
 

Public Attributes

const void * data = nullptr
 Raw component payload bytes. Null for tags and invalid views.
 
uint32_t size = 0
 Payload size in bytes.
 
uint32_t flags = ComponentRawViewFlag_None
 Bitmask of ComponentRawViewFlags values.
 

Detailed Description

Non-owning read-only view over raw component bytes on an entity.

The view intentionally stores only a pointer, byte size, and flags. The component id is omitted because callers already pass it to World::get_raw(...); keeping it out of the view keeps the return value compact. A valid tag is represented by data == nullptr, size == 0, and ComponentRawViewFlag_Valid set.

Note
Treat the view as a short-lived borrow. Structural changes can invalidate data.
Use valid() instead of checking data: tags are valid views with a null pointer.

Member Function Documentation

◆ valid()

GAIA_NODISCARD bool gaia::ecs::ComponentRawView::valid ( ) const
inlinenoexcept
Returns
True if the view resolved to an existing supported component payload or tag.

The documentation for this struct was generated from the following file: