CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::BitView< Container > Class Template Reference

#include <CeresEngine/Foundation/Container/BitView.hpp>

Public Types

using Word = typename std::remove_reference< decltype(std::declval< Container >()[0])>::type
 

Public Member Functions

constexpr BitView (Container &container) noexcept
 
size_t size () const noexcept(noexcept(mContainer.size()))
 Returns the number of bits that fit in the container.
 
void resize (size_t N, const bool v=false) noexcept(noexcept(mContainer.resize(0, 0)))
 Resizes the container to hold at least N bits.
 
constexpr BitReference< Wordoperator[] (size_t i) noexcept(noexcept(mContainer[0]))
 Returns a BitReference to the bit at position i.
 
constexpr BitReference< const Wordoperator[] (size_t i) const noexcept(noexcept(mContainer[0]))
 Returns a BitReference to the bit at position i.
 
constexpr auto begin () noexcept(noexcept(mContainer.begin()))
 
constexpr auto end () noexcept(noexcept(mContainer.begin()))
 
constexpr auto begin () const noexcept(noexcept(mContainer.begin()))
 
constexpr auto end () const noexcept(noexcept(mContainer.begin()))
 
Container & data () noexcept
 Get the underlying data container.
 
const Container & data () const noexcept
 Get the underlying data container.
 

Static Public Attributes

static constexpr auto WORD_SIZE = WordSize<Word>::value
 

Private Attributes

Container & mContainer
 

Member Typedef Documentation

◆ Word

template<class Container >
using CeresEngine::BitView< Container >::Word = typename std::remove_reference<decltype(std::declval<Container>()[0])>::type

Constructor & Destructor Documentation

◆ BitView()

template<class Container >
constexpr CeresEngine::BitView< Container >::BitView ( Container &  container)
inlineconstexprnoexcept

Member Function Documentation

◆ begin() [1/2]

template<class Container >
constexpr auto CeresEngine::BitView< Container >::begin ( ) const
inlineconstexprnoexcept

◆ begin() [2/2]

template<class Container >
constexpr auto CeresEngine::BitView< Container >::begin ( )
inlineconstexprnoexcept

◆ data() [1/2]

template<class Container >
const Container & CeresEngine::BitView< Container >::data ( ) const
inlinenoexcept

Get the underlying data container.

◆ data() [2/2]

template<class Container >
Container & CeresEngine::BitView< Container >::data ( )
inlinenoexcept

Get the underlying data container.

◆ end() [1/2]

template<class Container >
constexpr auto CeresEngine::BitView< Container >::end ( ) const
inlineconstexprnoexcept

◆ end() [2/2]

template<class Container >
constexpr auto CeresEngine::BitView< Container >::end ( )
inlineconstexprnoexcept

◆ operator[]() [1/2]

template<class Container >
constexpr BitReference< const Word > CeresEngine::BitView< Container >::operator[] ( size_t  i) const
inlineconstexprnoexcept

Returns a BitReference to the bit at position i.

◆ operator[]() [2/2]

template<class Container >
constexpr BitReference< Word > CeresEngine::BitView< Container >::operator[] ( size_t  i)
inlineconstexprnoexcept

Returns a BitReference to the bit at position i.

◆ resize()

template<class Container >
void CeresEngine::BitView< Container >::resize ( size_t  N,
const bool  v = false 
)
inlinenoexcept

Resizes the container to hold at least N bits.

Note
The actual size will be a multiple of the bits in a word.

◆ size()

template<class Container >
size_t CeresEngine::BitView< Container >::size ( ) const
inlinenoexcept

Returns the number of bits that fit in the container.

Member Data Documentation

◆ mContainer

template<class Container >
Container& CeresEngine::BitView< Container >::mContainer
private

◆ WORD_SIZE

template<class Container >
constexpr auto CeresEngine::BitView< Container >::WORD_SIZE = WordSize<Word>::value
staticconstexpr

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