Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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< boolBits
 
typedef bool value_type
 
typedef boolreference
 
typedef bool const & const_reference
 
typedef boolpointer
 
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 boolReference
 
typedef bool const & ConstReference
 
typedef boolPointer
 
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 = std::size_t>
class utility::BitVector< B >

Simple bit vector.

Member Typedef Documentation

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

Constructor & Destructor Documentation

template<typename B = std::size_t>
utility::BitVector< B >::BitVector ( )
inline

Default constructor.

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

Bit constructor (implicit)

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

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

Destructor.

Member Function Documentation

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

Begin iterator.

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

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

Begin iterator.

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

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

Empty?

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

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

End iterator.

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

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

End iterator.

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

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

Expand the bit vector if necessary to the specified size.

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

Referenced by utility::BitVector< B >::operator+=(), utility::BitVector< B >::operator-=(), and utility::BitVector< B >::operator|=().

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

Expand the bit vector if necessary to the specified size and remove excess capacity.

References utility::BitVector< B >::bits_, and utility::BitVector< B >::shrink().

Referenced by utility::BitVector< B >::operator+=(), utility::BitVector< B >::operator-=(), and utility::BitVector< B >::operator|=().

template<typename B = std::size_t>
BitVector& utility::BitVector< B >::operator+= ( BitVector< B > const &  s)
inline
template<typename B = std::size_t>
BitVector& utility::BitVector< B >::operator+= ( Bit const &  i)
inline
template<typename B = std::size_t>
BitVector& utility::BitVector< B >::operator-= ( BitVector< B > const &  s)
inline
template<typename B = std::size_t>
BitVector& utility::BitVector< B >::operator-= ( Bit const &  i)
inline
template<typename B = std::size_t>
bool utility::BitVector< B >::operator[] ( Bit const &  i) const
inline

BitVector[ i ] const.

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

template<typename B = std::size_t>
BitVector& utility::BitVector< B >::operator|= ( BitVector< B > const &  s)
inline
template<typename B = std::size_t>
BitVector& utility::BitVector< B >::operator|= ( Bit const &  i)
inline
template<typename B = std::size_t>
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().

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

Size.

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

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

swap( BitVector )

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

Friends And Related Function Documentation

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

BitVector + BitVector: Union.

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

BitVector - BitVector: Difference.

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

BitVector | BitVector: Union.

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

swap( BitVector, BitVector )

Member Data Documentation

template<typename B = std::size_t>
Bits utility::BitVector< B >::bits_
private

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