ECSTASY
All in the name
Loading...
Searching...
No Matches
IStorage.hpp
Go to the documentation of this file.
1
11
12#ifndef ECSTASY_STORAGE_ISTORAGE_HPP_
13#define ECSTASY_STORAGE_ISTORAGE_HPP_
14
15#include <span>
16
17#include "ecstasy/config.hpp"
18#include "util/meta/Traits.hpp"
19
20#ifdef ECSTASY_LOCKABLE_STORAGES
22#endif
23
24namespace util
25{
26 class BitSet;
27}
28
29namespace ecstasy
30{
31
32 class Entity;
33
41#ifdef ECSTASY_LOCKABLE_STORAGES
43#endif
44 {
45 public:
46 virtual ~IStorage() = default;
47
59 [[nodiscard]] virtual constexpr const util::BitSet &getMask() const noexcept = 0;
60
69 virtual void erase(std::span<Entity> entities) = 0;
70
81 [[nodiscard]] virtual bool contains(size_t index) const noexcept = 0;
82
91 [[nodiscard]] virtual const std::type_info &getComponentTypeInfos() const noexcept = 0;
92 };
93
94} // namespace ecstasy
95
96#endif /* !ECSTASY_STORAGE_ISTORAGE_HPP_ */
Wrapper for std::shared_mutex allowing recursive locking by the same thread.
Helper types for parameter packs.
Encapsulate an index to an entity.
Definition Entity.hpp:35
Base class of all components storage.
Definition IStorage.hpp:44
virtual constexpr const util::BitSet & getMask() const noexcept=0
Get the Component Mask.
virtual const std::type_info & getComponentTypeInfos() const noexcept=0
Get the Component stored type infos.
virtual void erase(std::span< Entity > entities)=0
Erase the components attached to the given entities.
virtual ~IStorage()=default
virtual bool contains(size_t index) const noexcept=0
Test if the entity index match a Component instance.
Wrapper for std::shared_mutex allowing recursive locking by the same thread.
Mimics the API of std::bitset but with the dynamic properties of std::vector<bool>
Definition BitSet.hpp:35
Namespace containing all symbols specific to ecstasy.
Definition ecstasy.hpp:30
Namespace regrouping helpers used by ecstasy but not specific to ecstasy.
Definition Queryable.hpp:21