#include <BitVector.h>
inet::BitVector::BitVector |
( |
| ) |
|
uint8_t uint8
Definition: Compat.h:34
std::vector< uint8 > bytes
Definition: BitVector.h:30
int size
Definition: BitVector.h:31
inet::BitVector::BitVector |
( |
const char * |
bits | ) |
|
int size
Definition: BitVector.h:31
void stringToBitVector(const char *str)
Definition: BitVector.cc:136
inet::BitVector::BitVector |
( |
unsigned int |
bits | ) |
|
int size
Definition: BitVector.h:31
void appendBit(bool value)
Definition: BitVector.cc:106
inet::BitVector::BitVector |
( |
unsigned int |
bits, |
|
|
unsigned int |
fixedSize |
|
) |
| |
unsigned int getSize() const
Definition: BitVector.h:53
int size
Definition: BitVector.h:31
void appendBit(bool value)
Definition: BitVector.cc:106
inet::BitVector::BitVector |
( |
const BitVector & |
other | ) |
|
|
inline |
void copy(const BitVector &other)
Definition: BitVector.cc:209
void inet::BitVector::appendBit |
( |
bool |
value | ) |
|
Referenced by appendBit(), appendByte(), inet::physicallayer::Ieee80211LayeredOFDMTransmitter::appendPadding(), BitVector(), copy(), inet::physicallayer::Ieee80211LayeredOFDMTransmitter::createBitModel(), inet::physicallayer::Ieee80211LayeredOFDMReceiver::createCompleteBitModel(), inet::physicallayer::Ieee80211LayeredOFDMReceiver::createCompletePacketModel(), inet::physicallayer::Ieee80211LayeredOFDMReceiver::createDataFieldBitModel(), inet::physicallayer::Ieee80211LayeredOFDMTransmitter::createDataFieldPacketModel(), inet::physicallayer::APSKLayeredTransmitter::createPacketModel(), inet::physicallayer::Ieee80211LayeredOFDMReceiver::createSignalFieldBitModel(), inet::physicallayer::Ieee80211LayeredOFDMTransmitter::createSignalFieldPacketModel(), inet::physicallayer::APSKDemodulator::demodulate(), inet::physicallayer::Ieee80211OFDMDemodulator::demodulate(), inet::physicallayer::Ieee80211OFDMDemodulator::demodulateSymbol(), inet::physicallayer::ConvolutionalCoder::depuncturing(), inet::physicallayer::ConvolutionalCoder::encode(), inet::physicallayer::AdditiveScrambler::generateScramblingSequence(), inet::physicallayer::ConvolutionalCoder::getPuncturedIndices(), inet::physicallayer::ConvolutionalCoder::puncturing(), inet::physicallayer::AdditiveScrambler::scramble(), inet::serializer::Ieee80211PhySerializer::serialize(), stringToBitVector(), inet::physicallayer::ConvolutionalCoder::traversePath(), and inet::serializer::Ieee80211PhySerializer::writeToBitVector().
int size
Definition: BitVector.h:31
void setBit(int pos, bool value)
Definition: BitVector.cc:61
void inet::BitVector::appendBit |
( |
bool |
value, |
|
|
int |
n |
|
) |
| |
void appendBit(bool value)
Definition: BitVector.cc:106
void inet::BitVector::appendByte |
( |
uint8_t |
value | ) |
|
int inet::BitVector::computeHammingDistance |
( |
const BitVector & |
u | ) |
const |
178 throw cRuntimeError(
"You can't compute Hamming distance between two vectors with different sizes");
179 int hammingDistance = 0;
180 for (
unsigned int i = 0; i <
getSize(); i++)
181 if (u.getBit(i) !=
getBit(i))
183 return hammingDistance;
unsigned int getSize() const
Definition: BitVector.h:53
bool getBit(int pos) const
Definition: BitVector.cc:82
int inet::BitVector::containerSize |
( |
| ) |
const |
|
inlineprivate |
Referenced by setBit().
34 {
return bytes.size() * 8; }
std::vector< uint8 > bytes
Definition: BitVector.h:30
void inet::BitVector::copy |
( |
const BitVector & |
other | ) |
|
|
private |
Referenced by operator=().
213 for (
unsigned int i = 0; i < other.getSize(); i++)
std::vector< uint8 > bytes
Definition: BitVector.h:30
int size
Definition: BitVector.h:31
void appendBit(bool value)
Definition: BitVector.cc:106
bool inet::BitVector::getBit |
( |
int |
pos | ) |
const |
Referenced by computeHammingDistance(), copy(), inet::physicallayer::Ieee80211LayeredOFDMTransmitter::createBitModel(), inet::physicallayer::Ieee80211LayeredOFDMReceiver::createCompletePacketModel(), inet::physicallayer::Ieee80211LayeredOFDMReceiver::createDataFieldBitModel(), inet::physicallayer::Ieee80211LayeredOFDMTransmitter::createDataFieldPacketModel(), inet::physicallayer::Ieee80211LayeredOFDMReceiver::createSignalFieldBitModel(), inet::physicallayer::Ieee80211LayeredOFDMTransmitter::createSignalFieldPacketModel(), inet::physicallayer::Ieee80211OFDMInterleaver::deinterleave(), inet::physicallayer::Ieee80211OFDMDemodulator::demodulate(), inet::physicallayer::ConvolutionalCoder::depuncturing(), inet::physicallayer::ConvolutionalCoder::encode(), inet::physicallayer::Ieee80211LayeredOFDMReceiver::getRate(), inet::physicallayer::Ieee80211OFDMDecoder::getSignalFieldLength(), inet::physicallayer::Ieee80211LayeredOFDMReceiver::getSignalFieldLength(), inet::physicallayer::Ieee80211OFDMDecoder::getSignalFieldRate(), inet::physicallayer::ConvolutionalCoder::giveNextOutputSymbol(), inet::physicallayer::Ieee80211OFDMInterleaver::interleave(), inet::physicallayer::APSKModulator::modulate(), inet::physicallayer::Ieee80211OFDMModulator::modulate(), inet::operator<<(), operator==(), inet::ieee80211::QoSAckHandler::processReceivedBlockAck(), inet::physicallayer::ConvolutionalCoder::puncturing(), reverseToDecimal(), inet::physicallayer::AdditiveScrambler::scramble(), toDecimal(), toString(), and inet::physicallayer::ConvolutionalCoder::traversePath().
85 throw cRuntimeError(
"Out of range with bit position %d", pos);
uint8_t uint8
Definition: Compat.h:34
std::vector< uint8 > bytes
Definition: BitVector.h:30
int size
Definition: BitVector.h:31
#define UINT8_LENGTH
Definition: BitVector.h:25
const std::vector<uint8>& inet::BitVector::getBytes |
( |
| ) |
const |
|
inline |
unsigned int inet::BitVector::getNumberOfBytes |
( |
| ) |
const |
|
inline |
54 {
return bytes.size(); }
std::vector< uint8 > bytes
Definition: BitVector.h:30
unsigned int inet::BitVector::getSize |
( |
| ) |
const |
|
inline |
Referenced by BitVector(), inet::physicallayer::LayeredErrorModelBase::computeBitModel(), inet::physicallayer::Ieee80211OFDMErrorModel::computeBitModel(), computeHammingDistance(), inet::physicallayer::APSKLayeredTransmitter::computePaddingLength(), copy(), inet::physicallayer::APSKLayeredTransmitter::createBitModel(), inet::physicallayer::Ieee80211LayeredOFDMTransmitter::createBitModel(), inet::physicallayer::Ieee80211LayeredOFDMReceiver::createCompletePacketModel(), inet::physicallayer::Ieee80211LayeredOFDMReceiver::createDataFieldBitModel(), inet::physicallayer::Ieee80211LayeredOFDMTransmitter::createDataFieldPacketModel(), inet::physicallayer::Ieee80211LayeredOFDMTransmitter::createScalarAnalogModel(), inet::physicallayer::ConvolutionalCoder::decode(), inet::physicallayer::Ieee80211OFDMInterleaver::deinterleave(), inet::physicallayer::Ieee80211OFDMDemodulator::demodulate(), inet::physicallayer::ConvolutionalCoder::depuncturing(), inet::physicallayer::APSKEncoder::encode(), inet::physicallayer::ConvolutionalCoder::encode(), inet::physicallayer::ConvolutionalCoder::giveNextOutputSymbol(), inet::physicallayer::Ieee80211OFDMInterleaver::interleave(), inet::physicallayer::APSKModulator::modulate(), inet::physicallayer::Ieee80211OFDMModulator::modulate(), operator==(), inet::physicallayer::ConvolutionalCoder::puncturing(), reverseToDecimal(), inet::physicallayer::AdditiveScrambler::scramble(), toDecimal(), toString(), and inet::physicallayer::ConvolutionalCoder::traversePath().
int size
Definition: BitVector.h:31
bool inet::BitVector::operator!= |
( |
const BitVector & |
rhs | ) |
const |
206 return !(rhs == *
this);
void copy(const BitVector &other)
Definition: BitVector.cc:209
bool inet::BitVector::operator== |
( |
const BitVector & |
rhs | ) |
const |
196 if (rhs.getSize() !=
getSize())
198 for (
unsigned int i = 0; i <
getSize(); i++)
199 if (
getBit(i) != rhs.getBit(i))
unsigned int getSize() const
Definition: BitVector.h:53
bool getBit(int pos) const
Definition: BitVector.cc:82
unsigned int inet::BitVector::reverseToDecimal |
( |
| ) |
const |
164 unsigned int dec = 0;
165 unsigned int powerOfTwo = 1;
166 for (
int i =
getSize() - 1; i >= 0; i--)
unsigned int getSize() const
Definition: BitVector.h:53
bool getBit(int pos) const
Definition: BitVector.cc:82
void inet::BitVector::setBit |
( |
int |
pos, |
|
|
bool |
value |
|
) |
| |
void inet::BitVector::stringToBitVector |
( |
const char * |
str | ) |
|
|
private |
Referenced by BitVector().
138 int strSize = strlen(str);
139 for (
int i = 0; i < strSize; i++)
143 else if (str[i] ==
'0')
146 throw cRuntimeError(
"str must represent a binary number");
void appendBit(bool value)
Definition: BitVector.cc:106
unsigned int inet::BitVector::toDecimal |
( |
| ) |
const |
152 unsigned int dec = 0;
153 unsigned int powerOfTwo = 1;
154 for (
unsigned int i = 0; i <
getSize(); i++)
unsigned int getSize() const
Definition: BitVector.h:53
bool getBit(int pos) const
Definition: BitVector.cc:82
void inet::BitVector::toggleBit |
( |
int |
pos | ) |
|
std::string inet::BitVector::toString |
( |
| ) |
const |
126 for (
unsigned int i = 0; i <
getSize(); i++)
unsigned int getSize() const
Definition: BitVector.h:53
bool getBit(int pos) const
Definition: BitVector.cc:82
std::ostream& operator<< |
( |
std::ostream & |
out, |
|
|
const BitVector & |
bitVector |
|
) |
| |
|
friend |
92 if (bitVector.getBit(0))
96 for (
int i = 1; i < bitVector.size; i++)
98 if (bitVector.getBit(i))
std::vector<uint8> inet::BitVector::bytes |
|
private |
int inet::BitVector::size |
|
private |
The documentation for this class was generated from the following files: