UWBIRMacPkt.cc

00001 
00002 #include "UWBIRMacPkt.h"
00003 #include <cassert>
00004 
00005 Register_Class(UWBIRMacPkt);
00006 
00007 UWBIRMacPkt& UWBIRMacPkt::operator=(const UWBIRMacPkt& other) {
00008   if (this==&other) return *this;
00009   UWBIRMacPkt_Base::operator=(other);
00010   bitValues.clear();
00011     list<bool>::const_iterator citer = other.bitValues.begin();
00012     while(citer != other.bitValues.end()) {
00013       bitValues.push_back(*citer);
00014       citer++;
00015     }
00016   return *this;
00017 }
00018 
00019 void UWBIRMacPkt::setBitValuesArraySize(unsigned int size) {
00020   // do nothing, dynamic array
00021 }
00022 
00023 unsigned int UWBIRMacPkt::getBitValuesArraySize() const {
00024   return bitValues.size();
00025 }
00026 
00027 bool UWBIRMacPkt::getBitValues(unsigned int k) const {
00028   assert(k <= bitValues.size());
00029   return bitValues.front();   // do not use -- implemented because omnet wants it
00030 }
00031 
00032 void UWBIRMacPkt::setBitValues(unsigned int k, bool bitValue) { }
00033 
00034 void UWBIRMacPkt::pushBitvalue(bool bitValue) {
00035   bitValues.push_back(bitValue);
00036 }
00037 
00038 bool UWBIRMacPkt::popBitValue() {
00039   bool bitValue = bitValues.front();
00040   bitValues.pop_front();
00041   return bitValue;
00042 }
00043 
00044 bool UWBIRMacPkt::isEmpty() {
00045   return bitValues.size() == 0;
00046 }
00047