Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

ustl::bitset< Size > Class Template Reference
[Sequence Containers]

bitset is a fixed-size block of memory with addressable bits. More...

#include <ustl.h>

List of all members.

Public Types

typedef bitset_value_type value_type
typedef value_type * pointer
typedef const value_type * const_pointer
typedef pointer iterator
typedef const_pointer const_iterator
typedef size_t difference_type
typedef size_t size_type

Public Member Functions

 bitset (value_type v=0)
 bitset (const string &buf)
void flip (uoff_t n)
void reset (void)
void clear (void)
void set (void)
bitset operator~ (void) const
size_type size (void) const
size_type capacity (void) const
const bool test (uoff_t n) const
const bool operator[] (uoff_t n) const
const_iterator begin (void) const
iterator begin (void)
const_iterator end (void) const
iterator end (void)
const value_type to_value (void) const
 Returns the value_type with the equivalent bits. If size() > 1, you'll get only the first BitsInType(value_type) bits.
void flip (void)
 Flips all the bits in the set.
void set (uoff_t n, bool val=true)
 Sets or clears bit n.
void set (uoff_t first, uoff_t DebugArg(last), value_type v)
void reset (uoff_t n)
 Clears the bit n.
string to_string (void) const
 Returns a string with bits MSB "001101001..." LSB.
value_type at (uoff_t n) const
value_type at (uoff_t first, uoff_t last) const
 Returns the value in bits first through last.
bool operator== (const bitset< Size > &v) const
const bitset operator & (const bitset< Size > &v)
const bitset operator| (const bitset< Size > &v)
const bitset operator^ (const bitset< Size > &v)
const bitsetoperator &= (const bitset< Size > &v)
const bitsetoperator|= (const bitset< Size > &v)
const bitsetoperator^= (const bitset< Size > &v)


Detailed Description

template<size_t Size>
class ustl::bitset< Size >

bitset is a fixed-size block of memory with addressable bits.

Normally used for state flags; allows setting and unsetting of individual bits as well as bitwise operations on the entire set. The interface is most like that of unsigned integers, and is intended to be used as such. If you were using begin() and end() functions in STL's bitset, you would not be able to do the same thing here, because those functions return host type iterators, not bits.


The documentation for this class was generated from the following file:
Generated on Mon Jan 17 14:35:02 2005 for uSTL by 1.3.9 Doxygen Hosted on SourceForge.net