Loading...
Searching...
No Matches
BALL::Bit Class Reference
Foundation Classes » General datastructures » Miscellaneous

`#include <BALL/DATATYPE/bitVector.h>`

## Classes

class | IllegalOperation

## Public Member Functions

Constructors and Destructors
| Bit ()
| Bit (const Bit &bit)
| Bit (BitVector *bitvector, Index index=0)
| Bit (const BitVector *const bitvector, Index index=0)
virtual | ~Bit ()
Converters
| operator bool () const
Bit & | operator= (const Bit &bit)
Bit & | operator= (const bool bit)
virtual void | clear ()

## Predicates

bool | operator== (const Bit &bit) const
bool | operator== (bool bit) const
bool | operator!= (const Bit &bit) const
bool | operator!= (bool bit) const

## Detailed Description

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

See also
  BitVector.

Definition at line 42 of file bitVector.h.

## Constructor & Destructor Documentation

## Bit() [1/4]

BALL::Bit::Bit | ( |  | ) |

Default constructor

## Bit() [2/4]

BALL::Bit::Bit | ( | const Bit & | bit | ) |

Copy constructor

## Bit() [3/4]

BALL::Bit::Bit | ( | BitVector * | bitvector,
|  | Index | index = 0 )

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

Exceptions

  NullPointer | if bitvector is equal to 0

## Bit() [4/4]

BALL::Bit::Bit | ( | const BitVector *const | bitvector,
|  | Index | index = 0 )

Detailed constructor. For use with const bitvector.

Exceptions

  NullPointer | if bitvector is equal to 0
  IndexUnderflow | if index is too small
  IndexOverflow | if index is greater than the size of bitvector

## ~Bit()

virtual BALL::Bit::~Bit | ( |  | ) |

virtual

Destructor

## Member Function Documentation

## clear()

virtual void BALL::Bit::clear | ( |  | ) |

virtual

Clear method

## operator bool()

BALL::Bit::operator bool | ( |  | ) | const

Casting operator from Bit to bool.

Exceptions

  NullPointer |

## operator!=() [1/2]

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

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

Exceptions

  Exception::NullPointer | if this bitvector is not correctly initialized

## operator!=() [2/2]

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

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

## operator=() [1/2]

Bit & BALL::Bit::operator= | ( | const Bit & | bit | ) |

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

## operator=() [2/2]

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

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

Exceptions

  Exception::IllegalOperation | if instance points to a const bitvector
  Exception::NullPointer |

## operator==() [1/2]

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

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

Exceptions

  Exception::NullPointer | if this bitvector is not correctly initialized

## operator==() [2/2]

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

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