Gaia-ECS v1.0.0
A simple and powerful entity component system
Loading...
Searching...
No Matches
gaia::ecs::QueryHandleLookupKey Struct Reference

Hashmap lookup structure used for Entity. More...

#include <query_common.h>

Public Types

using LookupHash = core::direct_hash_key< uint64_t >
 Direct hash value cached for the packed query handle.
 

Public Member Functions

 QueryHandleLookupKey (QueryHandle handle)
 Constructs a lookup key and precomputes its hash.
 
 QueryHandleLookupKey (const QueryHandleLookupKey &)=default
 
 QueryHandleLookupKey (QueryHandleLookupKey &&)=default
 
QueryHandleLookupKeyoperator= (const QueryHandleLookupKey &)=default
 
QueryHandleLookupKeyoperator= (QueryHandleLookupKey &&)=default
 
QueryHandle handle () const
 Returns the represented query handle.
 
size_t hash () const
 Returns the precomputed container hash.
 
bool operator== (const QueryHandleLookupKey &other) const
 Compares lookup keys using their cached hashes and handles.
 
bool operator!= (const QueryHandleLookupKey &other) const
 Compares lookup keys for inequality.
 

Static Public Attributes

static constexpr bool IsDirectHashKey = true
 Indicates that Gaia containers may consume hash() without rehashing the key.
 

Detailed Description

Hashmap lookup structure used for Entity.

Constructor & Destructor Documentation

◆ QueryHandleLookupKey()

gaia::ecs::QueryHandleLookupKey::QueryHandleLookupKey ( QueryHandle  handle)
inlineexplicit

Constructs a lookup key and precomputes its hash.

Parameters
handleQuery handle represented by the key.

Member Function Documentation

◆ handle()

QueryHandle gaia::ecs::QueryHandleLookupKey::handle ( ) const
inline

Returns the represented query handle.

Returns
Query handle stored by the lookup key.

◆ hash()

size_t gaia::ecs::QueryHandleLookupKey::hash ( ) const
inline

Returns the precomputed container hash.

Returns
Hash of the packed query handle.

◆ operator!=()

bool gaia::ecs::QueryHandleLookupKey::operator!= ( const QueryHandleLookupKey other) const
inline

Compares lookup keys for inequality.

Parameters
otherLookup key to compare.
Returns
True when the represented handles differ.

◆ operator==()

bool gaia::ecs::QueryHandleLookupKey::operator== ( const QueryHandleLookupKey other) const
inline

Compares lookup keys using their cached hashes and handles.

Parameters
otherLookup key to compare.
Returns
True when both keys represent the same query handle.

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