Rosetta
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
utility::BitVector< B > Class Template Reference

Simple bit vector. More...

#include <BitVector.hh>

Public Types

typedef B Bit
 
typedef std::vector< bool > Bits
 
typedef bool value_type
 
typedef bool & reference
 
typedef bool const & const_reference
 
typedef bool * pointer
 
typedef bool const * const_pointer
 
typedef Bits::iterator iterator
 
typedef Bits::const_iterator const_iterator
 
typedef Bits::size_type size_type
 
typedef bool Value
 
typedef bool & Reference
 
typedef bool const & ConstReference
 
typedef bool * Pointer
 
typedef bool const * ConstPointer
 
typedef Bits::iterator Iterator
 
typedef Bits::const_iterator ConstIterator
 
typedef Bits::size_type Size
 

Public Member Functions

 BitVector ()
 Default constructor. More...
 
 BitVector (Bit const &i)
 Bit constructor (implicit) More...
 
 BitVector (Bit const &i, Bit const &j)
 2 Bit constructor More...
 
 BitVector (Bit const &i, Bit const &j, Bit const &k)
 3 Bit constructor More...
 
 BitVector (Bit const &i, Bit const &j, Bit const &k, Bit const &l)
 4 Bit constructor More...
 
 BitVector (Bit const &i, Bit const &j, Bit const &k, Bit const &l, Bit const &m)
 5 Bit constructor More...
 
 ~BitVector ()
 Destructor. More...
 
BitVectoroperator+= (BitVector const &s)
 += BitVector: Union More...
 
BitVectoroperator|= (BitVector const &s)
 |= BitVector: Union More...
 
BitVectoroperator-= (BitVector const &s)
 -= BitVector: Difference More...
 
BitVectoroperator+= (Bit const &i)
 += Bit More...
 
BitVectoroperator|= (Bit const &i)
 |= Bit More...
 
BitVectoroperator-= (Bit const &i)
 -= Bit More...
 
void shrink ()
 Shrink the bit vector to remove unused capacity. More...
 
void expand (Size const &n)
 Expand the bit vector if necessary to the specified size. More...
 
void expand_tight (Size const &n)
 Expand the bit vector if necessary to the specified size and remove excess capacity. More...
 
void swap (BitVector &s)
 swap( BitVector ) More...
 
Size size () const
 Size. More...
 
bool empty () const
 Empty? More...
 
bool operator[] (Bit const &i) const
 BitVector[ i ] const. More...
 
ConstIterator begin () const
 Begin iterator. More...
 
Iterator begin ()
 Begin iterator. More...
 
ConstIterator end () const
 End iterator. More...
 
Iterator end ()
 End iterator. More...
 

Private Attributes

Bits bits_
 Bit vector. More...
 

Friends

BitVector operator+ (BitVector const &a, BitVector const &b)
 BitVector + BitVector: Union. More...
 
BitVector operator| (BitVector const &a, BitVector const &b)
 BitVector | BitVector: Union. More...
 
BitVector operator- (BitVector const &a, BitVector const &b)
 BitVector - BitVector: Difference. More...
 
template<typename U >
void swap (BitVector< U > &a, BitVector< U > &b)
 swap( BitVector, BitVector ) More...
 
bool operator== (BitVector const &a, BitVector const &b)
 BitVector == BitVector. More...
 
bool operator!= (BitVector const &a, BitVector const &b)
 BitVector != BitVector. More...
 

Detailed Description

template<typename B>
class utility::BitVector< B >

Simple bit vector.

Member Typedef Documentation

◆ Bit

template<typename B >
typedef B utility::BitVector< B >::Bit

◆ Bits

template<typename B >
typedef std::vector< bool > utility::BitVector< B >::Bits

◆ const_iterator

template<typename B >
typedef Bits::const_iterator utility::BitVector< B >::const_iterator

◆ const_pointer

template<typename B >
typedef bool const* utility::BitVector< B >::const_pointer

◆ const_reference

template<typename B >
typedef bool const& utility::BitVector< B >::const_reference

◆ ConstIterator

template<typename B >
typedef Bits::const_iterator utility::BitVector< B >::ConstIterator

◆ ConstPointer

template<typename B >
typedef bool const* utility::BitVector< B >::ConstPointer

◆ ConstReference

template<typename B >
typedef bool const& utility::BitVector< B >::ConstReference

◆ iterator

template<typename B >
typedef Bits::iterator utility::BitVector< B >::iterator

◆ Iterator

template<typename B >
typedef Bits::iterator utility::BitVector< B >::Iterator

◆ pointer

template<typename B >
typedef bool* utility::BitVector< B >::pointer

◆ Pointer

template<typename B >
typedef bool* utility::BitVector< B >::Pointer

◆ reference

template<typename B >
typedef bool& utility::BitVector< B >::reference

◆ Reference

template<typename B >
typedef bool& utility::BitVector< B >::Reference

◆ Size

template<typename B >
typedef Bits::size_type utility::BitVector< B >::Size

◆ size_type

template<typename B >
typedef Bits::size_type utility::BitVector< B >::size_type

◆ Value

template<typename B >
typedef bool utility::BitVector< B >::Value

◆ value_type

template<typename B >
typedef bool utility::BitVector< B >::value_type

Constructor & Destructor Documentation

◆ BitVector() [1/6]

template<typename B >
utility::BitVector< B >::BitVector ( )
inline

Default constructor.

◆ BitVector() [2/6]

template<typename B >
utility::BitVector< B >::BitVector ( Bit const &  i)
inline

Bit constructor (implicit)

References utility::BitVector< B >::bits_, and create_a3b_hbs::i.

◆ BitVector() [3/6]

template<typename B >
utility::BitVector< B >::BitVector ( Bit const &  i,
Bit const &  j 
)
inline

◆ BitVector() [4/6]

template<typename B >
utility::BitVector< B >::BitVector ( Bit const &  i,
Bit const &  j,
Bit const &  k 
)
inline

◆ BitVector() [5/6]

template<typename B >
utility::BitVector< B >::BitVector ( Bit const &  i,
Bit const &  j,
Bit const &  k,
Bit const &  l 
)
inline

◆ BitVector() [6/6]

template<typename B >
utility::BitVector< B >::BitVector ( Bit const &  i,
Bit const &  j,
Bit const &  k,
Bit const &  l,
Bit const &  m 
)
inline

◆ ~BitVector()

template<typename B >
utility::BitVector< B >::~BitVector ( )
inline

Destructor.

Member Function Documentation

◆ begin() [1/2]

template<typename B >
Iterator utility::BitVector< B >::begin ( )
inline

Begin iterator.

References utility::BitVector< B >::bits_.

◆ begin() [2/2]

template<typename B >
ConstIterator utility::BitVector< B >::begin ( ) const
inline

Begin iterator.

References utility::BitVector< B >::bits_.

◆ empty()

template<typename B >
bool utility::BitVector< B >::empty ( ) const
inline

Empty?

References utility::BitVector< B >::bits_.

◆ end() [1/2]

template<typename B >
Iterator utility::BitVector< B >::end ( )
inline

End iterator.

References utility::BitVector< B >::bits_.

◆ end() [2/2]

template<typename B >
ConstIterator utility::BitVector< B >::end ( ) const
inline

End iterator.

References utility::BitVector< B >::bits_.

◆ expand()

template<typename B >
void utility::BitVector< B >::expand ( Size const &  n)
inline

◆ expand_tight()

template<typename B >
void utility::BitVector< B >::expand_tight ( Size const &  n)
inline

◆ operator+=() [1/2]

template<typename B >
BitVector& utility::BitVector< B >::operator+= ( Bit const &  i)
inline

◆ operator+=() [2/2]

template<typename B >
BitVector& utility::BitVector< B >::operator+= ( BitVector< B > const &  s)
inline

◆ operator-=() [1/2]

template<typename B >
BitVector& utility::BitVector< B >::operator-= ( Bit const &  i)
inline

◆ operator-=() [2/2]

template<typename B >
BitVector& utility::BitVector< B >::operator-= ( BitVector< B > const &  s)
inline

◆ operator[]()

template<typename B >
bool utility::BitVector< B >::operator[] ( Bit const &  i) const
inline

◆ operator|=() [1/2]

template<typename B >
BitVector& utility::BitVector< B >::operator|= ( Bit const &  i)
inline

◆ operator|=() [2/2]

template<typename B >
BitVector& utility::BitVector< B >::operator|= ( BitVector< B > const &  s)
inline

◆ shrink()

template<typename B >
void utility::BitVector< B >::shrink ( )
inline

Shrink the bit vector to remove unused capacity.

References utility::BitVector< B >::bits_.

Referenced by utility::BitVector< B >::expand_tight().

◆ size()

template<typename B >
Size utility::BitVector< B >::size ( ) const
inline

Size.

References utility::BitVector< B >::bits_.

◆ swap()

template<typename B >
void utility::BitVector< B >::swap ( BitVector< B > &  s)
inline

swap( BitVector )

References utility::BitVector< B >::bits_, and docking::s.

Friends And Related Function Documentation

◆ operator!=

template<typename B >
bool operator!= ( BitVector< B > const &  a,
BitVector< B > const &  b 
)
friend

◆ operator+

template<typename B >
BitVector operator+ ( BitVector< B > const &  a,
BitVector< B > const &  b 
)
friend

BitVector + BitVector: Union.

◆ operator-

template<typename B >
BitVector operator- ( BitVector< B > const &  a,
BitVector< B > const &  b 
)
friend

BitVector - BitVector: Difference.

◆ operator==

template<typename B >
bool operator== ( BitVector< B > const &  a,
BitVector< B > const &  b 
)
friend

◆ operator|

template<typename B >
BitVector operator| ( BitVector< B > const &  a,
BitVector< B > const &  b 
)
friend

BitVector | BitVector: Union.

◆ swap

template<typename B >
template<typename U >
void swap ( BitVector< U > &  a,
BitVector< U > &  b 
)
friend

swap( BitVector, BitVector )

Member Data Documentation

◆ bits_

template<typename B >
Bits utility::BitVector< B >::bits_
private

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