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

Public Member Functions

 QueryImplStorage (QueryImplStorage &&other)
 
QueryImplStorageoperator= (QueryImplStorage &&other)
 
 QueryImplStorage (const QueryImplStorage &other)
 
QueryImplStorageoperator= (const QueryImplStorage &other)
 
GAIA_NODISCARD Worldworld ()
 Returns the world associated with this query storage.
 
GAIA_NODISCARD QuerySerBufferser_buffer ()
 Returns the serialized command buffer for this query.
 
void ser_buffer_reset ()
 Releases the serialized command buffer for this query.
 
void init (World *world, QueryCache *queryCache)
 Initializes storage against a world and query cache.
 
void reset ()
 Releases any data allocated by the query.
 
void allow_to_destroy_again ()
 Allows this storage object to destroy cache-backed state again after a move/copy handoff.
 
GAIA_NODISCARD bool try_del_from_cache ()
 Tries to delete the query from the query cache.
 
void invalidate ()
 Invalidates the query handle.
 
GAIA_NODISCARD QueryInfotry_query_info_fast () const
 Returns the cached QueryInfo pointer when the fast-path cache is still valid.
 
void cache_query_info (QueryInfo &queryInfo)
 Caches the hot QueryInfo pointer locally.
 
GAIA_NODISCARD bool has_owned_query_info () const
 Returns whether storage owns a local QueryInfo instance.
 
GAIA_NODISCARD QueryInfoowned_query_info ()
 Returns the locally-owned QueryInfo.
 
void init_owned_query_info (QueryInfo &&queryInfo)
 Stores a locally-owned QueryInfo, replacing the old one if present.
 
GAIA_NODISCARD bool is_cached () const
 Returns whether the query is found in the query cache.
 
GAIA_NODISCARD bool is_initialized () const
 Returns whether the query is ready to be used.
 

Public Attributes

Worldm_world = nullptr
 
QueryCachem_pCache = nullptr
 QueryImpl cache (stable pointer to parent world's query cache)
 
QueryInfom_pInfo = nullptr
 Hot cached query pointer. Validated against m_identity.handle before use.
 
QueryInfom_pOwnedInfo = nullptr
 Locally-owned query plan used when the query does not use cache-backed storage.
 
QueryIdentity m_identity {}
 Query identity.
 
bool m_destroyed = false
 

Member Function Documentation

◆ cache_query_info()

void gaia::ecs::detail::QueryImplStorage::cache_query_info ( QueryInfo queryInfo)
inline

Caches the hot QueryInfo pointer locally.

Parameters
queryInfoQuery info

◆ has_owned_query_info()

GAIA_NODISCARD bool gaia::ecs::detail::QueryImplStorage::has_owned_query_info ( ) const
inline

Returns whether storage owns a local QueryInfo instance.

Returns
True if a local QueryInfo exists. False otherwise.

◆ init()

void gaia::ecs::detail::QueryImplStorage::init ( World world,
QueryCache queryCache 
)
inline

Initializes storage against a world and query cache.

Parameters
worldWorld owning the query.
queryCacheQuery cache owned by the world.

◆ init_owned_query_info()

void gaia::ecs::detail::QueryImplStorage::init_owned_query_info ( QueryInfo &&  queryInfo)
inline

Stores a locally-owned QueryInfo, replacing the old one if present.

Parameters
queryInfoQuery info to store.

◆ is_cached()

GAIA_NODISCARD bool gaia::ecs::detail::QueryImplStorage::is_cached ( ) const
inline

Returns whether the query is found in the query cache.

Returns
True if the query is found in the query cache. False otherwise.

◆ is_initialized()

GAIA_NODISCARD bool gaia::ecs::detail::QueryImplStorage::is_initialized ( ) const
inline

Returns whether the query is ready to be used.

Returns
True if the query is ready to be used. False otherwise.

◆ owned_query_info()

GAIA_NODISCARD QueryInfo & gaia::ecs::detail::QueryImplStorage::owned_query_info ( )
inline

Returns the locally-owned QueryInfo.

Returns
Locally-owned QueryInfo.

◆ ser_buffer()

GAIA_NODISCARD QuerySerBuffer & gaia::ecs::detail::QueryImplStorage::ser_buffer ( )
inline

Returns the serialized command buffer for this query.

Returns
Serialized command buffer.

◆ try_del_from_cache()

GAIA_NODISCARD bool gaia::ecs::detail::QueryImplStorage::try_del_from_cache ( )
inline

Tries to delete the query from the query cache.

Returns
False.

◆ try_query_info_fast()

GAIA_NODISCARD QueryInfo * gaia::ecs::detail::QueryImplStorage::try_query_info_fast ( ) const
inline

Returns the cached QueryInfo pointer when the fast-path cache is still valid.

Returns
Cached QueryInfo pointer or nullptr.

◆ world()

GAIA_NODISCARD World * gaia::ecs::detail::QueryImplStorage::world ( )
inline

Returns the world associated with this query storage.

Returns
World associated with this query storage.

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