Nugget
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
eastl::bitvector< Allocator, Element, Container > Class Template Reference

#include <bitvector.h>

Collaboration diagram for eastl::bitvector< Allocator, Element, Container >:
Collaboration graph
[legend]

Public Types

enum  { kBitCount = 8 * sizeof(Element) }
 -1 is reserved for 'npos'. It also happens to be slightly beneficial that kMaxSize is a value less than -1, as it helps us deal with potential integer wraparound issues.
 
typedef bitvector< Allocator, Element > this_type
 
typedef bool value_type
 
typedef bitvector_reference< Element > reference
 
typedef bool const_reference
 
typedef bitvector_iterator< Element > iterator
 
typedef bitvector_const_iterator< Element > const_iterator
 
typedef eastl::reverse_iterator< iteratorreverse_iterator
 
typedef eastl::reverse_iterator< const_iteratorconst_reverse_iterator
 
typedef Allocator allocator_type
 
typedef Element element_type
 
typedef Container container_type
 
typedef eastl_size_t size_type
 
typedef ptrdiff_t difference_type
 

Public Member Functions

 bitvector (const allocator_type &allocator)
 
 bitvector (size_type n, const allocator_type &allocator=EASTL_BITVECTOR_DEFAULT_ALLOCATOR)
 
 bitvector (size_type n, value_type value, const allocator_type &allocator=EASTL_BITVECTOR_DEFAULT_ALLOCATOR)
 
 bitvector (const bitvector &copy)
 
template<typename InputIterator >
 bitvector (InputIterator first, InputIterator last)
 
bitvectoroperator= (const bitvector &x)
 
void swap (this_type &x)
 
template<typename InputIterator >
void assign (InputIterator first, InputIterator last)
 
iterator begin () EA_NOEXCEPT
 
const_iterator begin () const EA_NOEXCEPT
 
const_iterator cbegin () const EA_NOEXCEPT
 
iterator end () EA_NOEXCEPT
 
const_iterator end () const EA_NOEXCEPT
 
const_iterator cend () const EA_NOEXCEPT
 
reverse_iterator rbegin () EA_NOEXCEPT
 
const_reverse_iterator rbegin () const EA_NOEXCEPT
 
const_reverse_iterator crbegin () const EA_NOEXCEPT
 
reverse_iterator rend () EA_NOEXCEPT
 
const_reverse_iterator rend () const EA_NOEXCEPT
 
const_reverse_iterator crend () const EA_NOEXCEPT
 
bool empty () const EA_NOEXCEPT
 
size_type size () const EA_NOEXCEPT
 
size_type capacity () const EA_NOEXCEPT
 
void resize (size_type n, value_type value)
 
void resize (size_type n)
 
void reserve (size_type n)
 
void set_capacity (size_type n=npos)
 
void push_back ()
 
void push_back (value_type value)
 
void pop_back ()
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
bool test (size_type n, bool defaultValue) const
 
void set (size_type n, bool value)
 
reference at (size_type n)
 
const_reference at (size_type n) const
 
reference operator[] (size_type n)
 
const_reference operator[] (size_type n) const
 
element_type * data () EA_NOEXCEPT
 
const element_type * data () const EA_NOEXCEPT
 
iterator insert (const_iterator position, value_type value)
 
void insert (const_iterator position, size_type n, value_type value)
 
iterator erase (const_iterator position)
 
iterator erase (const_iterator first, const_iterator last)
 
reverse_iterator erase (const_reverse_iterator position)
 
reverse_iterator erase (const_reverse_iterator first, const_reverse_iterator last)
 
void clear ()
 
void reset_lose_memory ()
 
container_type & get_container ()
 
const container_type & get_container () const
 
bool validate () const
 
int validate_iterator (const_iterator i) const
 

Static Public Attributes

static const size_type npos = container_type::npos
 
static const size_type kMaxSize = container_type::kMaxSize
 'npos' means non-valid position or simply non-position.
 

Protected Attributes

container_type mContainer
 
size_type mFreeBitCount
 

Detailed Description

template<typename Allocator = EASTLAllocatorType, typename Element = BitvectorWordType, typename Container = eastl::vector<Element, Allocator>>
class eastl::bitvector< Allocator, Element, Container >

bitvector

Implements an array of bits treated as boolean values. bitvector is similar to vector<bool> but uses bits instead of bytes and allows the user to use other containers such as deque instead of vector. bitvector is different from bitset in that bitset is less flexible but uses less memory and has higher performance.

To consider: Rename the Element template parameter to WordType, for consistency with bitset.


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