GNU Radio's GSM Package
|
#include <BitVector.h>
Public Member Functions | |
Casts of Vector constructors. | |
BitVector (VectorDataType wData, char *wStart, char *wEnd) | |
BitVector (const BitVector &other) | |
BitVector (size_t len) | |
BitVector () | |
BitVector (const BitVector &other1, const BitVector &other2) | |
BitVector (const char *valString) | |
Casts and overrides of Vector operators. | |
BitVector | segment (size_t start, size_t span) |
const BitVector | cloneSegment (size_t start, size_t span) const |
BitVector | alias () const |
BitVector | head (size_t span) |
BitVector | tail (size_t start) |
void | zero () |
FEC operations. | |
uint64_t | syndrome (Generator &gen) const |
uint64_t | parity (Generator &gen) const |
void | invert () |
Byte-wise operations. | |
void | reverse8 () |
void | LSB8MSB () |
![]() | |
size_t | size () const |
size_t | bytes () const |
void | resize (size_t newElements) |
void | clear () |
void | clone (const VectorBase< char > &other) |
void | vConcat (const VectorBase< char > &other1, const VectorBase< char > &other2) |
~VectorBase () | |
bool | isOwner () |
std::string | inspect () const |
void | copyToSegment (VectorBase< char > &other, size_t start, size_t span) const |
void | copyToSegment (VectorBase< char > &other, size_t start=0) const |
void | copyTo (VectorBase< char > &other) const |
void | segmentCopyTo (VectorBase< char > &other, size_t start, size_t span) const |
void | fill (const char &val) |
void | fill (const char &val, unsigned start, unsigned length) |
void | operator= (const VectorBase< char > &other) |
char & | operator[] (size_t index) |
const char & | operator[] (size_t index) const |
const char * | begin () const |
char * | begin () |
const char * | end () const |
char * | end () |
const char * | getData () const |
Serialization and deserialization. | |
typedef char * | iterator |
typedef const char * | const_iterator |
uint64_t | peekField (size_t readIndex, unsigned length) const |
uint64_t | peekFieldReversed (size_t readIndex, unsigned length) const |
uint64_t | readField (size_t &readIndex, unsigned length) const |
uint64_t | readFieldReversed (size_t &readIndex, unsigned length) const |
void | fillField (size_t writeIndex, uint64_t value, unsigned length) |
void | fillFieldReversed (size_t writeIndex, uint64_t value, unsigned length) |
void | writeField (size_t &writeIndex, uint64_t value, unsigned length) |
void | writeFieldReversed (size_t &writeIndex, uint64_t value, unsigned length) |
void | write0 (size_t &writeIndex) |
void | write1 (size_t &writeIndex) |
unsigned | sum () const |
void | map (const unsigned *map, size_t mapSize, BitVector &dest) const |
void | unmap (const unsigned *map, size_t mapSize, BitVector &dest) const |
void | pack (unsigned char *) const |
void | pack2 (unsigned char *) const |
std::string | packToString () const |
void | unpack (const unsigned char *) |
void | hex (std::ostream &) const |
std::string | hexstr () const |
bool | unhex (const char *) |
void | dup (BitVector other) |
void | dup (BitVector &other) |
bool | operator== (const BitVector &other) const |
void | copyPunctured (BitVector &dst, const unsigned *puncture, const size_t plth) |
bool | bit (size_t index) const |
char & | operator[] (size_t index) |
const char & | operator[] (size_t index) const |
void | settfb (size_t index, int value) |
Additional Inherited Members | |
![]() | |
typedef char * | VectorDataType |
![]() | |
void | vInit (size_t elements) |
void | shiftMem (VectorBase< char > &other) |
void | makeAlias (const VectorBase< char > &other) |
VectorBase () | |
VectorBase (VectorDataType wData, char *wStart, char *wEnd) | |
![]() | |
VectorDataType | mData |
allocated data block. | |
char * | mStart |
start of useful data | |
char * | mEnd |
end of useful data + 1 | |
typedef const char* BitVector::const_iterator |
typedef char* BitVector::iterator |
|
inline |
|
inline |
|
inlineexplicit |
References VectorBase< char >::vInit().
|
inline |
References VectorBase< char >::vInit().
Referenced by segment().
Build a BitVector by concatenation.
References VectorBase< char >::getData(), and VectorBase< char >::vConcat().
BitVector::BitVector | ( | const char * | valString | ) |
Construct from a string of "0" and "1".
|
inline |
References segment(), and VectorBase< char >::size().
|
inline |
Index a single bit.
References VectorBase< char >::begin(), and VectorBase< char >::end().
|
inline |
References VectorBase< T >::clone(), and segment().
void BitVector::copyPunctured | ( | BitVector & | dst, |
const unsigned * | puncture, | ||
const size_t | plth | ||
) |
Copy to dst, not including those indexed in puncture.
|
inline |
References VectorBase< char >::makeAlias(), VectorBase< T >::mStart, and VectorBase< char >::mStart.
|
inline |
void BitVector::fillField | ( | size_t | writeIndex, |
uint64_t | value, | ||
unsigned | length | ||
) |
void BitVector::fillFieldReversed | ( | size_t | writeIndex, |
uint64_t | value, | ||
unsigned | length | ||
) |
void BitVector::hex | ( | std::ostream & | ) | const |
Make a hexdump string.
std::string BitVector::hexstr | ( | ) | const |
void BitVector::invert | ( | ) |
Invert 0<->1.
void BitVector::LSB8MSB | ( | ) |
Reverse groups of 8 within the vector (byte reversal).
void BitVector::map | ( | const unsigned * | map, |
size_t | mapSize, | ||
BitVector & | dest | ||
) | const |
Reorder bits, dest[i] = this[map[i]].
bool BitVector::operator== | ( | const BitVector & | other | ) | const |
|
inline |
References VectorBase< char >::mEnd, and VectorBase< char >::mStart.
|
inline |
References VectorBase< char >::mEnd, and VectorBase< char >::mStart.
void BitVector::pack | ( | unsigned char * | ) | const |
Pack into a char array.
void BitVector::pack2 | ( | unsigned char * | ) | const |
std::string BitVector::packToString | ( | ) | const |
uint64_t BitVector::parity | ( | Generator & | gen | ) | const |
Calculate the parity word for the vector with the given Generator.
uint64_t BitVector::peekField | ( | size_t | readIndex, |
unsigned | length | ||
) | const |
uint64_t BitVector::peekFieldReversed | ( | size_t | readIndex, |
unsigned | length | ||
) | const |
uint64_t BitVector::readField | ( | size_t & | readIndex, |
unsigned | length | ||
) | const |
uint64_t BitVector::readFieldReversed | ( | size_t & | readIndex, |
unsigned | length | ||
) | const |
void BitVector::reverse8 | ( | ) |
Reverse an 8-bit vector.
|
inline |
References VectorBase< char >::begin(), BitVector(), VectorBase< char >::end(), and VectorBase< char >::mData.
Referenced by alias(), cloneSegment(), head(), and tail().
|
inline |
Set a bit
References VectorBase< char >::mEnd, and VectorBase< char >::mStart.
unsigned BitVector::sum | ( | ) | const |
Sum of bits.
uint64_t BitVector::syndrome | ( | Generator & | gen | ) | const |
Calculate the syndrome of the vector with the given Generator.
|
inline |
References segment(), and VectorBase< char >::size().
bool BitVector::unhex | ( | const char * | ) |
Unpack from a hexdump string.
void BitVector::unmap | ( | const unsigned * | map, |
size_t | mapSize, | ||
BitVector & | dest | ||
) | const |
Reorder bits, dest[map[i]] = this[i].
void BitVector::unpack | ( | const unsigned char * | ) |
Unpack from a char array.
|
inline |
References writeField().
|
inline |
References writeField().
void BitVector::writeField | ( | size_t & | writeIndex, |
uint64_t | value, | ||
unsigned | length | ||
) |
void BitVector::writeFieldReversed | ( | size_t & | writeIndex, |
uint64_t | value, | ||
unsigned | length | ||
) |
|
inline |
References VectorBase< char >::fill().