llir-opt  0.0.1
Low-Level Post-Link Optimiser for OCaml and C
Classes | Public Member Functions | List of all members
BitSet< T, N > Class Template Referencefinal

#include <core/adt/bitset.h>

Classes

class  iterator
 Iterator over the bitset items. More...
 
class  reverse_iterator
 Reverse iterator over the bitset items. More...
 

Public Member Functions

 BitSet ()
 Constructs a new bitset.
 
 BitSet (ID< T > id)
 Constructs a singleton bitset.
 
 ~BitSet ()
 Deletes the bitset.
 
iterator begin () const
 Start iterator.
 
iterator end () const
 End iterator.
 
reverse_iterator rbegin () const
 Reverse start iterator.
 
reverse_iterator rend () const
 Reverse end iterator.
 
bool Empty () const
 Checks if the set is empty.
 
void Clear ()
 Clears these set.
 
bool Insert (const ID< T > &item)
 Inserts an item into the bitset.
 
void Erase (const ID< T > &item)
 Erases a bit.
 
bool Contains (const ID< T > &item) const
 Checks if a bit is set.
 
unsigned Union (const BitSet &that)
 
void Subtract (const BitSet &that)
 Subtracts a bitset from another.
 
void Intersect (const BitSet &that)
 Subtracts a bitset from another.
 
size_t Size () const
 Returns the size of the document.
 
bool operator== (const BitSet &that) const
 Checks if two bitsets are equal.
 
bool operator!= (const BitSet &that) const
 Checks if two bitsets are different.
 
BitSet operator- (const BitSet &that) const
 Subtraction.
 
BitSet operator| (const BitSet &that) const
 Bitwise or.
 
BitSetoperator|= (const BitSet &that)
 Bitwise or.
 
BitSet operator& (const BitSet &that) const
 Bitwise and.
 

Detailed Description

template<typename T, unsigned N = 8>
class BitSet< T, N >

Sparse bit set implementation.

Member Function Documentation

◆ Union()

template<typename T , unsigned N = 8>
unsigned BitSet< T, N >::Union ( const BitSet< T, N > &  that)
inline

Computes the union of two bitsets.

Returns
The number of newly set bits.

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