BALL::Bit Class Reference

#include <BALL/DATATYPE/bitVector.h>

List of all members.

Classes

class  IllegalOperation

Public Member Functions

Constructors and Destructors
 Bit ()
 Bit (const Bit &bit)
 Bit (BitVector *bitvector, Index index=0) throw (Exception::NullPointer)
 Bit (const BitVector *const bitvector, Index index=0) throw (Exception::NullPointer, Exception::IndexUnderflow, Exception::IndexOverflow)
virtual ~Bit ()
Converters
 operator bool () const throw (Exception::NullPointer)
Bitoperator= (const Bit &bit)
Bitoperator= (const bool bit) throw (Exception::NullPointer, IllegalOperation)
virtual void clear ()
Predicates
bool operator== (const Bit &bit) const
bool operator== (bool bit) const throw (Exception::NullPointer)
bool operator!= (const Bit &bit) const
bool operator!= (bool bit) const throw (Exception::NullPointer)

Private Attributes

BitVectorbitvector_
Index index_
bool bitvector_muteable_

Detailed Description

Bit Class. This class represents a bit within a BitVector.

See also:
BitVector.

Constructor & Destructor Documentation

BALL::Bit::Bit ( )

Default constructor

BALL::Bit::Bit ( const Bit bit)

Copy constructor

BALL::Bit::Bit ( BitVector bitvector,
Index  index = 0 
) throw (Exception::NullPointer)

Detailed constructor. For use with nonconst bitvector. The bitvector can be resized by accessing bits out of the bitvectors range.

Exceptions:
NullPointerif bitvector is equal to 0
BALL::Bit::Bit ( const BitVector *const  bitvector,
Index  index = 0 
) throw (Exception::NullPointer, Exception::IndexUnderflow, Exception::IndexOverflow)

Detailed constructor. For use with const bitvector.

Exceptions:
NullPointerif bitvector is equal to 0
IndexUnderflowif index is too small
IndexOverflowif index is greater than the size of bitvector
virtual BALL::Bit::~Bit ( ) [virtual]

Destructor


Member Function Documentation

virtual void BALL::Bit::clear ( ) [virtual]

Clear method

BALL::Bit::operator bool ( ) const throw (Exception::NullPointer)

Casting operator from Bit to bool.

bool BALL::Bit::operator!= ( bool  bit) const throw (Exception::NullPointer)

Inequality operator. Test if this instance has not the given bool value

bool BALL::Bit::operator!= ( const Bit bit) const

Inequality operator. Test if two instances point to different positions.

Bit& BALL::Bit::operator= ( const bool  bit) throw (Exception::NullPointer, IllegalOperation)

Assignment operator. Assign a bool value to this instance. The bit in the bitvector is set to the given value.

Exceptions:
IllegalOperationif instance points to a const bitvector
Bit& BALL::Bit::operator= ( const Bit bit)

Assignment Assignment operator. Assign the position from a Bit to this instance

bool BALL::Bit::operator== ( bool  bit) const throw (Exception::NullPointer)

Equality operator. Test if this instance has the given bool value

bool BALL::Bit::operator== ( const Bit bit) const

Equality operator. Test if two instances have the same position in a bitvector


Member Data Documentation