ECSTASY
All in the name
Loading...
Searching...
No Matches
ecstasy::IStorage Class Referenceabstract

Base class of all components storage. More...

#include <IStorage.hpp>

Inheritance diagram for ecstasy::IStorage:

Public Member Functions

virtual ~IStorage ()=default
 
virtual constexpr const util::BitSetgetMask () const noexcept=0
 Get the Component Mask.
 
virtual void erase (std::span< Entity > entities)=0
 Erase the components attached to the given entities.
 
virtual bool contains (size_t index) const noexcept=0
 Test if the entity index match a Component instance.
 
virtual const std::type_infogetComponentTypeInfos () const noexcept=0
 Get the Component stored type infos.
 

Detailed Description

Base class of all components storage.

Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-10-19)

Definition at line 40 of file IStorage.hpp.

Constructor & Destructor Documentation

◆ ~IStorage()

virtual ecstasy::IStorage::~IStorage ( )
virtualdefault

Member Function Documentation

◆ contains()

virtual bool ecstasy::IStorage::contains ( size_t  index) const
pure virtualnoexcept

Test if the entity index match a Component instance.

Parameters
[in]indexIndex of the entity.
Returns
bool True if the entity has a component, false otherwise.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-10-19)

Implemented in ecstasy::AStorage< C >.

◆ erase()

virtual void ecstasy::IStorage::erase ( std::span< Entity entities)
pure virtual

Erase the components attached to the given entities.

Parameters
[in]entitiesTarget entities.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-10-21)

Implemented in ecstasy::AStorage< C >.

◆ getComponentTypeInfos()

virtual const std::type_info & ecstasy::IStorage::getComponentTypeInfos ( ) const
pure virtualnoexcept

Get the Component stored type infos.

Returns
const std::type_info& Type informations of the component stored in the storage.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2024-06-11)

Implemented in ecstasy::AStorage< C >.

◆ getMask()

virtual constexpr const util::BitSet & ecstasy::IStorage::getMask ( ) const
constexprpure virtualnoexcept

Get the Component Mask.

Note
Each bit set to true mean the entity at the bit index has a component in the storage.
Warning
The mask might be smaller than the entity count.
Returns
const util::BitSet& Component mask.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-10-20)

Implemented in ecstasy::MapStorage< C >, ecstasy::MarkerStorage< C >, and ecstasy::VectorStorage< C >.


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