TwiceAsNice  2019-02-18
Classes | Public Member Functions | Friends | List of all members
Nice::BitSet Class Reference

#include <BitSet.h>

Inheritance diagram for Nice::BitSet:
Inheritance graph
Collaboration diagram for Nice::BitSet:
Collaboration graph

Classes

class  reference
 

Public Member Functions

 BitSet ()
 
 BitSet (const Nice::BitSetVar &_bsv)
 
 BitSet (Nice::U32 _depth, const Nice::BitSet &_bs)
 
 BitSet (Nice::U32 _depth, Nice::U32 _value=0)
 
void setValue (Nice::U32 _value=0)
 Takes only as many bits as the BitSet's depth, converts them to long and assigns it to the BitSet's value. More...
 
void setDepth (Nice::U32 _depth)
 
Nice::U32 getDepth () const
 
Nice::U32 getValue ()
 
bool test (size_t _position) const
 
void set (size_t _position, bool _value=true)
 
bool equals (int _depth, const BitSet &_bs) const
 Checks for equality with another BitSet for a given number of bits, starting with the lowest. More...
 
Nice::U32 count ()
 
BitSet operator & (const BitSet &_x)
 
BitSet operator & (Nice::U32 _value)
 
BitSetoperator &= (const BitSet &_bs)
 
BitSetoperator &= (Nice::U32 _value)
 
BitSet operator^ (const BitSet &_x)
 
BitSet operator^ (Nice::U32 _value)
 
BitSetoperator^= (const BitSet &_bs)
 
BitSetoperator^= (Nice::U32 _value)
 
BitSet operator| (const BitSet &_x)
 
BitSet operator| (Nice::U32 _value)
 
BitSetoperator|= (const BitSet &_bs)
 
BitSetoperator|= (Nice::U32 _value)
 
BitSetoperator~ ()
 
BitSetoperator<<= (const size_t _position)
 
BitSetoperator>>= (const size_t _position)
 
reference operator[] (size_t _position)
 
bool operator[] (size_t _position) const
 
BitSetoperator= (const BitSet &_bs)
 
BitSetoperator= (Nice::U32 _value)
 
 BitSet ()
 
 BitSet (const Nice::BitSetVar &_bsv)
 
 BitSet (Nice::U32 _depth, const Nice::BitSet &_bs)
 
 BitSet (Nice::U32 _depth, Nice::U32 _value=0)
 
void setValue (Nice::U32 _value=0)
 Takes only as many bits as the BitSet's depth, converts them to long and assigns it to the BitSet's value. More...
 
void setDepth (Nice::U32 _depth)
 
Nice::U32 getDepth () const
 
Nice::U32 getValue ()
 
bool test (size_t _position) const
 
void set (size_t _position, bool _value=true)
 
bool equals (int _depth, const BitSet &_bs) const
 Checks for equality with another BitSet for a given number of bits, starting with the lowest. More...
 
Nice::U32 count ()
 
BitSet operator & (const BitSet &_x)
 
BitSet operator & (Nice::U32 _value)
 
BitSetoperator &= (const BitSet &_bs)
 
BitSetoperator &= (Nice::U32 _value)
 
BitSet operator^ (const BitSet &_x)
 
BitSet operator^ (Nice::U32 _value)
 
BitSetoperator^= (const BitSet &_bs)
 
BitSetoperator^= (Nice::U32 _value)
 
BitSet operator| (const BitSet &_x)
 
BitSet operator| (Nice::U32 _value)
 
BitSetoperator|= (const BitSet &_bs)
 
BitSetoperator|= (Nice::U32 _value)
 
BitSetoperator~ ()
 
BitSetoperator<<= (const size_t _position)
 
BitSetoperator>>= (const size_t _position)
 
reference operator[] (size_t _position)
 
bool operator[] (size_t _position) const
 
BitSetoperator= (const BitSet &_bs)
 
BitSetoperator= (Nice::U32 _value)
 
- Public Member Functions inherited from Nice::BitSetVar
bool operator== (const BitSetVar &__rhs) const
 
bool operator< (const BitSetVar &__rhs) const
 
bool operator!= (const BitSetVar &__rhs) const
 
bool operator<= (const BitSetVar &__rhs) const
 
bool operator> (const BitSetVar &__rhs) const
 
bool operator>= (const BitSetVar &__rhs) const
 
bool operator== (const BitSetVar &__rhs) const
 
bool operator< (const BitSetVar &__rhs) const
 
bool operator!= (const BitSetVar &__rhs) const
 
bool operator<= (const BitSetVar &__rhs) const
 
bool operator> (const BitSetVar &__rhs) const
 
bool operator>= (const BitSetVar &__rhs) const
 

Friends

class reference
 
bool operator== (BitSet &_bs, Nice::U32 _value)
 
bool operator!= (BitSet &_bs, Nice::U32 _value)
 
bool operator== (BitSet &_bs_01, BitSet &_bs_02)
 
bool operator!= (BitSet &_bs_01, BitSet &_bs_02)
 
bool operator== (BitSet &_bs, Nice::U32 _value)
 
bool operator!= (BitSet &_bs, Nice::U32 _value)
 
bool operator== (BitSet &_bs_01, BitSet &_bs_02)
 
bool operator!= (BitSet &_bs_01, BitSet &_bs_02)
 

Additional Inherited Members

- Public Attributes inherited from Nice::BitSetVar
::Ice::Int depth
 
::Ice::Int value
 

Constructor & Destructor Documentation

◆ BitSet() [1/8]

Nice::BitSet::BitSet ( )
inline

◆ BitSet() [2/8]

Nice::BitSet::BitSet ( const Nice::BitSetVar _bsv)
inline

◆ BitSet() [3/8]

Nice::BitSet::BitSet ( Nice::U32  _depth,
const Nice::BitSet _bs 
)
inline

◆ BitSet() [4/8]

Nice::BitSet::BitSet ( Nice::U32  _depth,
Nice::U32  _value = 0 
)
inline

◆ BitSet() [5/8]

Nice::BitSet::BitSet ( )
inline

◆ BitSet() [6/8]

Nice::BitSet::BitSet ( const Nice::BitSetVar _bsv)
inline

◆ BitSet() [7/8]

Nice::BitSet::BitSet ( Nice::U32  _depth,
const Nice::BitSet _bs 
)
inline

◆ BitSet() [8/8]

Nice::BitSet::BitSet ( Nice::U32  _depth,
Nice::U32  _value = 0 
)
inline

Member Function Documentation

◆ count() [1/2]

Nice::U32 Nice::BitSet::count ( )
inline

◆ count() [2/2]

Nice::U32 Nice::BitSet::count ( )
inline

◆ equals() [1/2]

bool Nice::BitSet::equals ( int  _depth,
const BitSet _bs 
) const

Checks for equality with another BitSet for a given number of bits, starting with the lowest.

Parameters
_depthnumber of bits to check, starting at bit 0. Allowed range: 1..32.
_bsthe BitSet to compare with
Returns
true if all _depth bits are the same for both BitSets

◆ equals() [2/2]

bool Nice::BitSet::equals ( int  _depth,
const BitSet _bs 
) const

Checks for equality with another BitSet for a given number of bits, starting with the lowest.

Parameters
_depthnumber of bits to check, starting at bit 0. Allowed range: 1..32.
_bsthe BitSet to compare with
Returns
true if all _depth bits are the same for both BitSets

◆ getDepth() [1/2]

Nice::U32 Nice::BitSet::getDepth ( ) const
inline

◆ getDepth() [2/2]

Nice::U32 Nice::BitSet::getDepth ( ) const
inline

◆ getValue() [1/2]

Nice::U32 Nice::BitSet::getValue ( )
inline

◆ getValue() [2/2]

Nice::U32 Nice::BitSet::getValue ( )
inline

◆ operator &() [1/4]

BitSet Nice::BitSet::operator& ( const BitSet _x)
inline

◆ operator &() [2/4]

BitSet Nice::BitSet::operator& ( const BitSet _x)
inline

◆ operator &() [3/4]

BitSet Nice::BitSet::operator& ( Nice::U32  _value)
inline

◆ operator &() [4/4]

BitSet Nice::BitSet::operator& ( Nice::U32  _value)
inline

◆ operator &=() [1/4]

BitSet& Nice::BitSet::operator&= ( const BitSet _bs)
inline

◆ operator &=() [2/4]

BitSet& Nice::BitSet::operator&= ( const BitSet _bs)
inline

◆ operator &=() [3/4]

BitSet& Nice::BitSet::operator&= ( Nice::U32  _value)
inline

◆ operator &=() [4/4]

BitSet& Nice::BitSet::operator&= ( Nice::U32  _value)
inline

◆ operator<<=() [1/2]

BitSet& Nice::BitSet::operator<<= ( const size_t  _position)
inline

◆ operator<<=() [2/2]

BitSet& Nice::BitSet::operator<<= ( const size_t  _position)
inline

◆ operator=() [1/4]

BitSet& Nice::BitSet::operator= ( const BitSet _bs)
inline

◆ operator=() [2/4]

BitSet& Nice::BitSet::operator= ( const BitSet _bs)
inline

◆ operator=() [3/4]

BitSet& Nice::BitSet::operator= ( Nice::U32  _value)
inline

◆ operator=() [4/4]

BitSet& Nice::BitSet::operator= ( Nice::U32  _value)
inline

◆ operator>>=() [1/2]

BitSet& Nice::BitSet::operator>>= ( const size_t  _position)
inline

◆ operator>>=() [2/2]

BitSet& Nice::BitSet::operator>>= ( const size_t  _position)
inline

◆ operator[]() [1/4]

reference Nice::BitSet::operator[] ( size_t  _position)
inline

◆ operator[]() [2/4]

reference Nice::BitSet::operator[] ( size_t  _position)
inline

◆ operator[]() [3/4]

bool Nice::BitSet::operator[] ( size_t  _position) const
inline

◆ operator[]() [4/4]

bool Nice::BitSet::operator[] ( size_t  _position) const
inline

◆ operator^() [1/4]

BitSet Nice::BitSet::operator^ ( const BitSet _x)
inline

◆ operator^() [2/4]

BitSet Nice::BitSet::operator^ ( const BitSet _x)
inline

◆ operator^() [3/4]

BitSet Nice::BitSet::operator^ ( Nice::U32  _value)
inline

◆ operator^() [4/4]

BitSet Nice::BitSet::operator^ ( Nice::U32  _value)
inline

◆ operator^=() [1/4]

BitSet& Nice::BitSet::operator^= ( const BitSet _bs)
inline

◆ operator^=() [2/4]

BitSet& Nice::BitSet::operator^= ( const BitSet _bs)
inline

◆ operator^=() [3/4]

BitSet& Nice::BitSet::operator^= ( Nice::U32  _value)
inline

◆ operator^=() [4/4]

BitSet& Nice::BitSet::operator^= ( Nice::U32  _value)
inline

◆ operator|() [1/4]

BitSet Nice::BitSet::operator| ( const BitSet _x)
inline

◆ operator|() [2/4]

BitSet Nice::BitSet::operator| ( const BitSet _x)
inline

◆ operator|() [3/4]

BitSet Nice::BitSet::operator| ( Nice::U32  _value)
inline

◆ operator|() [4/4]

BitSet Nice::BitSet::operator| ( Nice::U32  _value)
inline

◆ operator|=() [1/4]

BitSet& Nice::BitSet::operator|= ( const BitSet _bs)
inline

◆ operator|=() [2/4]

BitSet& Nice::BitSet::operator|= ( const BitSet _bs)
inline

◆ operator|=() [3/4]

BitSet& Nice::BitSet::operator|= ( Nice::U32  _value)
inline

◆ operator|=() [4/4]

BitSet& Nice::BitSet::operator|= ( Nice::U32  _value)
inline

◆ operator~() [1/2]

BitSet& Nice::BitSet::operator~ ( )
inline

◆ operator~() [2/2]

BitSet& Nice::BitSet::operator~ ( )
inline

◆ set() [1/2]

void Nice::BitSet::set ( size_t  _position,
bool  _value = true 
)
inline

◆ set() [2/2]

void Nice::BitSet::set ( size_t  _position,
bool  _value = true 
)
inline

◆ setDepth() [1/2]

void Nice::BitSet::setDepth ( Nice::U32  _depth)
inline

◆ setDepth() [2/2]

void Nice::BitSet::setDepth ( Nice::U32  _depth)
inline

◆ setValue() [1/2]

void Nice::BitSet::setValue ( Nice::U32  _value = 0)

Takes only as many bits as the BitSet's depth, converts them to long and assigns it to the BitSet's value.

Parameters
_valuevalue which should be set

Example: _value is 0xCF7 (3319)[110011110111], BitSet depth is 8 This results in a new value of: 0xF7 (247) [11110111]. If _value would be 256 [100000000] and BitSet depth 8 the result would be 0!!

◆ setValue() [2/2]

void Nice::BitSet::setValue ( Nice::U32  _value = 0)

Takes only as many bits as the BitSet's depth, converts them to long and assigns it to the BitSet's value.

Parameters
_valuevalue which should be set

Example: _value is 0xCF7 (3319)[110011110111], BitSet depth is 8 This results in a new value of: 0xF7 (247) [11110111]. If _value would be 256 [100000000] and BitSet depth 8 the result would be 0!!

◆ test() [1/2]

bool Nice::BitSet::test ( size_t  _position) const
inline

◆ test() [2/2]

bool Nice::BitSet::test ( size_t  _position) const
inline

Friends And Related Function Documentation

◆ operator!= [1/4]

bool operator!= ( Nice::BitSet _bs,
Nice::U32  _value 
)
friend

◆ operator!= [2/4]

bool operator!= ( Nice::BitSet _bs,
Nice::U32  _value 
)
friend

◆ operator!= [3/4]

bool operator!= ( Nice::BitSet _bs_01,
Nice::BitSet _bs_02 
)
friend

◆ operator!= [4/4]

bool operator!= ( Nice::BitSet _bs_01,
Nice::BitSet _bs_02 
)
friend

◆ operator== [1/4]

bool operator== ( Nice::BitSet _bs,
Nice::U32  _value 
)
friend

◆ operator== [2/4]

bool operator== ( Nice::BitSet _bs,
Nice::U32  _value 
)
friend

◆ operator== [3/4]

bool operator== ( Nice::BitSet _bs_01,
Nice::BitSet _bs_02 
)
friend

◆ operator== [4/4]

bool operator== ( Nice::BitSet _bs_01,
Nice::BitSet _bs_02 
)
friend

◆ reference

reference
friend

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