bit_string_t Class Reference

Class for impementation of field of bits. More...

#include <bit_string.hh>

List of all members.

Public Member Functions

void add (const bit_string_t &from)
 Bitwisely adds `from' to (*this).
void alloc_mem (const size_int_t bit_count)
 Allocation/realocation method.
 bit_string_t (const size_int_t bit_count)
 A constructor allocating space for `bit_count' bits.
 bit_string_t ()
 A default constructor.
 bit_string_t (const bit_string_t &bit_str2)
 A copy constructor.
void clear ()
 Sets all bits to 0.
void DBG_print (std::ostream &outs=cerr) const
void disable_bit (const size_int_t i)
 Sets `i'-th bit to 0.
void enable_bit (const size_int_t i)
 Sets `i'-th bit to 1.
size_int_t get_allocated_4bytes_count () const
 Return a count of 4-byte items allocated.
bool get_bit (const size_int_t i) const
 Returns a value of `i'-th bit.
size_int_t get_bit_count () const
 Returns a count of allocated bits.
byte_t * get_mem ()
 Returns a memory containing array of bits.
size_int_t get_mem_size ()
 Returns a size of allocated memory in bytes.
void invert_bit (const size_int_t i)
 Inverts `i'-th bit.
bit_string_toperator= (const bit_string_t &bit_str2)
 Copies a content of right side to the bit_string_t instance on the left side.
void set_bit (const size_int_t i, const bool value)
 Sets `i'-th bit to `value'.
 ~bit_string_t ()
 A destructor.

Friends

bool operator & (const bit_string_t &bs1, const bit_string_t &bs2)
 Returns true iff (`bs1' & `bs2') != 0.
bool operator^ (const bit_string_t &bs1, const bit_string_t &bs2)
 Returns true iff (`bs1' xor `bs2') != 0.
bool operator| (const bit_string_t &bs1, const bit_string_t &bs2)
 Returns true iff (`bs1' | `bs2') != 0.


Detailed Description

Class for impementation of field of bits.

Constructor & Destructor Documentation

bit_string_t ( const size_int_t  bit_count  )  [inline]

A constructor allocating space for `bit_count' bits.

This is a simple contructor, that automaticaly allocates a memory for number of bits given in bit_count

All bits are initially 0.


Member Function Documentation

void alloc_mem ( const size_int_t  bit_count  )  [inline]

Allocation/realocation method.

This method can be used for initial allocation of memory space (given in count of bits to be allocated - parameter bitcount).

All bits are initially 0.

Referenced by por_t::init().

void clear (  )  [inline]

Sets all bits to 0.

Warning:
Do not use this function, if no bits are allocated before!

Referenced by por_t::init().

void DBG_print ( std::ostream &  outs = cerr  )  const [inline]

Prints a sequence of zeros and ones representing a content to output stream `outs'.

Referenced by por_t::init().

size_int_t get_allocated_4bytes_count (  )  const [inline]

Return a count of 4-byte items allocated.

Storage in this class is implemented using allocation of field of 4-byte variables in a memory. This method returns a count of these variables.


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

Reference Manual for Library, 2006 developed in ParaDiSe laboratory, Faculty of Informatics, Masaryk University