Gaia-ECS v0.9.3
A simple and powerful entity component system
Loading...
Searching...
No Matches
gaia::cnt::dbitset< Allocator > Class Template Reference

Public Types

using iter = const_iterator< dbitset >
 
using iter_inv = const_iterator_inverse< dbitset >
 
using iter_rev = const_reverse_iterator< dbitset >
 
using iter_rev_inv = const_reverse_inverse_iterator< dbitset >
 

Public Member Functions

 dbitset (uint32_t reserveBits)
 
 dbitset (const dbitset &other)
 
dbitsetoperator= (const dbitset &other)
 
 dbitset (dbitset &&other) noexcept
 
dbitsetoperator= (dbitset &&other) noexcept
 
void reserve (uint32_t bitsWanted)
 
void resize (uint32_t bitsWanted)
 
iter begin () const
 
iter end () const
 
iter_rev rbegin () const
 
iter_rev rend () const
 
iter_inv ibegin () const
 
iter_inv iend () const
 
iter_rev_inv ribegin () const
 
iter_rev_inv riend () const
 
GAIA_NODISCARD bool operator[] (uint32_t pos) const
 
GAIA_NODISCARD bool operator== (const dbitset &other) const
 
GAIA_NODISCARD bool operator!= (const dbitset &other) const
 
void set ()
 Sets all bits.
 
void set (uint32_t pos, bool value=true)
 Sets the bit at the postion.
 
void flip ()
 Flips all bits.
 
void flip (uint32_t pos)
 Flips the bit at the postion.
 
dbitsetflip (uint32_t bitFrom, uint32_t bitTo)
 Flips all bits from.
 
void reset ()
 Unsets all bits.
 
void reset (uint32_t pos)
 Unsets the bit at the postion.
 
GAIA_NODISCARD bool test (uint32_t pos) const
 Returns the value of the bit at the position.
 
GAIA_NODISCARD bool all () const
 Checks if all bits are set.
 
GAIA_NODISCARD bool any () const
 Checks if any bit is set.
 
GAIA_NODISCARD bool none () const
 Checks if all bits are reset.
 
GAIA_NODISCARD uint32_t count () const
 Returns the number of set bits.
 
GAIA_NODISCARD constexpr uint32_t size () const
 Returns the number of bits the dbitset holds.
 
GAIA_NODISCARD constexpr uint32_t capacity () const
 Returns the number of bits the dbitset can hold.
 

Public Attributes

friend iter
 
friend iter_inv
 
friend iter_rev
 
friend iter_rev_inv
 

Member Function Documentation

◆ flip() [1/2]

template<typename Allocator = mem::DefaultAllocatorAdaptor>
dbitset & gaia::cnt::dbitset< Allocator >::flip ( uint32_t  bitFrom,
uint32_t  bitTo 
)
inline

Flips all bits from.

Parameters
bitFromto
bitTo(including)

◆ flip() [2/2]

template<typename Allocator = mem::DefaultAllocatorAdaptor>
void gaia::cnt::dbitset< Allocator >::flip ( uint32_t  pos)
inline

Flips the bit at the postion.

Parameters
pos

◆ reset()

template<typename Allocator = mem::DefaultAllocatorAdaptor>
void gaia::cnt::dbitset< Allocator >::reset ( uint32_t  pos)
inline

Unsets the bit at the postion.

Parameters
pos

◆ set()

template<typename Allocator = mem::DefaultAllocatorAdaptor>
void gaia::cnt::dbitset< Allocator >::set ( uint32_t  pos,
bool  value = true 
)
inline

Sets the bit at the postion.

Parameters
posto value
value

◆ test()

template<typename Allocator = mem::DefaultAllocatorAdaptor>
GAIA_NODISCARD bool gaia::cnt::dbitset< Allocator >::test ( uint32_t  pos) const
inline

Returns the value of the bit at the position.

Parameters
pos

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