From 2d5193f0183345a7390705c886978fa5f8dcf033 Mon Sep 17 00:00:00 2001 From: Levente Meszaros Date: Fri, 15 Nov 2024 10:52:34 +0100 Subject: [PATCH] all: Added missing unit qualifiers to get() calls. --- src/inet/common/FingerprintCalculator.cc | 4 ++-- src/inet/common/ResultFilters.cc | 4 ++-- src/inet/common/packet/Packet.cc | 4 ++-- .../packet/serializer/StreamBufferChunkSerializer.cc | 2 +- src/inet/common/packet/tag/SharingRegionTagSet.cc | 4 ++-- src/inet/linklayer/ieee80211/mac/Ieee80211Mac.cc | 2 +- .../ieee80211/mac/coordinationfunction/Dcf.cc | 4 ++-- .../ieee80211/mac/coordinationfunction/Hcf.cc | 4 ++-- .../ieee80211/mac/originator/TxopProcedure.cc | 2 +- .../linklayer/ieee80211/mgmt/Ieee80211MgmtSta.cc | 2 +- src/inet/mobility/single/GaussMarkovMobility.cc | 2 +- .../configurator/base/L3NetworkConfiguratorBase.cc | 2 +- src/inet/networklayer/ipv6/Ipv6Header.cc | 2 +- .../wireless/common/medium/RadioMedium.cc | 4 ++-- .../common/neighborcache/GridNeighborCache.cc | 6 +++--- .../neighborcache/NeighborListNeighborCache.cc | 6 +++--- .../common/neighborcache/QuadTreeNeighborCache.cc | 6 +++--- .../wireless/common/pathloss/FreeSpacePathLoss.cc | 2 +- .../wireless/common/signal/PowerFunctions.h | 4 ++-- .../bitlevel/errormodel/Ieee80211OfdmErrorModel.cc | 4 ++-- .../wireless/ieee80211/mode/Ieee80211DsssMode.cc | 2 +- .../wireless/ieee80211/mode/Ieee80211DsssMode.h | 4 ++-- .../wireless/ieee80211/mode/Ieee80211FhssMode.h | 6 +++--- .../wireless/ieee80211/mode/Ieee80211HrDsssMode.h | 4 ++-- .../wireless/ieee80211/mode/Ieee80211HtMode.cc | 2 +- .../wireless/ieee80211/mode/Ieee80211IrMode.h | 4 ++-- .../wireless/ieee80211/mode/Ieee80211OfdmMode.cc | 2 +- .../wireless/ieee80211/mode/Ieee80211OfdmMode.h | 2 +- .../wireless/ieee80211/mode/Ieee80211VhtMode.cc | 2 +- .../ieee802154/bitlevel/Ieee802154UwbIrReceiver.cc | 6 +++--- .../transceiver/DestreamingReceiver.cc | 2 +- .../transceiver/StreamThroughReceiver.cc | 2 +- src/inet/queueing/server/TokenBasedServer.cc | 2 +- .../tokengenerator/PacketBasedTokenGenerator.cc | 2 +- src/inet/routing/ospfv2/Ospfv2PacketSerializer.cc | 12 ++++++------ src/inet/routing/ospfv2/router/Ospfv2Area.cc | 2 +- src/inet/routing/ospfv3/process/Ospfv3Area.cc | 4 ++-- src/inet/routing/pim/PimPacketSerializer.cc | 2 +- src/inet/transportlayer/rtp/RtcpPacket.cc | 2 +- .../visualizer/base/EnergyStorageVisualizerBase.cc | 8 ++++---- src/inet/visualizer/base/MediumVisualizerBase.cc | 2 +- .../canvas/mobility/MobilityCanvasVisualizer.cc | 4 ++-- .../canvas/physicallayer/MediumCanvasVisualizer.cc | 12 ++++++------ .../canvas/scene/NetworkNodeCanvasVisualizer.cc | 2 +- .../osg/physicallayer/MediumOsgVisualizer.cc | 8 ++++---- 45 files changed, 85 insertions(+), 85 deletions(-) diff --git a/src/inet/common/FingerprintCalculator.cc b/src/inet/common/FingerprintCalculator.cc index 1c83da92fe7..9252aa42977 100644 --- a/src/inet/common/FingerprintCalculator.cc +++ b/src/inet/common/FingerprintCalculator.cc @@ -63,8 +63,8 @@ bool FingerprintCalculator::addEventIngredient(cEvent *event, cSingleFingerprint auto packet = dynamic_cast(cpacket); if (packet == nullptr) packet = dynamic_cast(cpacket->getEncapsulatedPacket()); - if (packet != nullptr && packet->getTotalLength().get() > 0) { - if (packet->getTotalLength().get() % 8 == 0) { + if (packet != nullptr && packet->getTotalLength().get() > 0) { + if (packet->getTotalLength().get() % 8 == 0) { const auto& content = packet->peekAllAsBytes(); for (auto byte : content->getBytes()) hasher_ << byte; diff --git a/src/inet/common/ResultFilters.cc b/src/inet/common/ResultFilters.cc index 52d016fc608..6f496956a58 100644 --- a/src/inet/common/ResultFilters.cc +++ b/src/inet/common/ResultFilters.cc @@ -131,7 +131,7 @@ void DataAgeFilter::receiveSignal(cResultFilter *prev, simtime_t_cref t, cObject { if (auto packet = dynamic_cast(object)) { for (auto& region : packet->peekData()->getAllTags()) { - WeightedHistogramRecorder::cWeight weight(region.getLength().get()); + WeightedHistogramRecorder::cWeight weight(region.getLength().get()); fire(this, t, t - region.getTag()->getCreationTime(), &weight); } } @@ -245,7 +245,7 @@ Register_ResultFilter("packetLength", PacketLengthFilter); void PacketLengthFilter::receiveSignal(cResultFilter *prev, simtime_t_cref t, cObject *object, cObject *details) { auto packet = check_and_cast(object); - fire(this, t, packet->getDataLength().get(), details); + fire(this, t, packet->getDataLength().get(), details); } Register_ResultFilter("flowPacketLength", FlowPacketLengthFilter); diff --git a/src/inet/common/packet/Packet.cc b/src/inet/common/packet/Packet.cc index 6bf21ded17a..23763044f83 100644 --- a/src/inet/common/packet/Packet.cc +++ b/src/inet/common/packet/Packet.cc @@ -136,9 +136,9 @@ void Packet::parsimPack(cCommBuffer *buffer) const cPacket::parsimPack(buffer); buffer->packObject(const_cast(content.get())); buffer->pack(frontIterator.getIndex()); - buffer->pack(frontIterator.getPosition().get()); + buffer->pack(frontIterator.getPosition().get()); buffer->pack(backIterator.getIndex()); - buffer->pack(backIterator.getPosition().get()); + buffer->pack(backIterator.getPosition().get()); tags.parsimPack(buffer); regionTags.parsimPack(buffer); } diff --git a/src/inet/common/packet/serializer/StreamBufferChunkSerializer.cc b/src/inet/common/packet/serializer/StreamBufferChunkSerializer.cc index f1973ddfd43..ad70d97b7f7 100644 --- a/src/inet/common/packet/serializer/StreamBufferChunkSerializer.cc +++ b/src/inet/common/packet/serializer/StreamBufferChunkSerializer.cc @@ -17,7 +17,7 @@ Register_Serializer(StreamBufferChunk, StreamBufferChunkSerializer); void StreamBufferChunkSerializer::serialize(MemoryOutputStream& stream, const Ptr& chunk, b offset, b length) const { const auto& streamBufferChunk = staticPtrCast(chunk); - b currentStreamPosition = b((simTime() - streamBufferChunk->getStartTime()).dbl() * streamBufferChunk->getDatarate().get()); + b currentStreamPosition = b((simTime() - streamBufferChunk->getStartTime()).dbl() * streamBufferChunk->getDatarate().get()); if (length == b(-1)) length = streamBufferChunk->getChunkLength() - offset; b copyLength = std::max(b(0), std::min(length, currentStreamPosition - offset)); diff --git a/src/inet/common/packet/tag/SharingRegionTagSet.cc b/src/inet/common/packet/tag/SharingRegionTagSet.cc index cf5ceafbd49..9a4b832ebcc 100644 --- a/src/inet/common/packet/tag/SharingRegionTagSet.cc +++ b/src/inet/common/packet/tag/SharingRegionTagSet.cc @@ -43,8 +43,8 @@ void SharingRegionTagSet::parsimPack(cCommBuffer *buffer) const buffer->pack(getNumTags()); if (regionTags != nullptr) { for (auto regionTag : *regionTags) { - buffer->pack(regionTag.getOffset().get()); - buffer->pack(regionTag.getLength().get()); + buffer->pack(regionTag.getOffset().get()); + buffer->pack(regionTag.getLength().get()); buffer->packObject(const_cast(regionTag.getTag().get())); } } diff --git a/src/inet/linklayer/ieee80211/mac/Ieee80211Mac.cc b/src/inet/linklayer/ieee80211/mac/Ieee80211Mac.cc index 895f97ec65a..27a7f62dda4 100644 --- a/src/inet/linklayer/ieee80211/mac/Ieee80211Mac.cc +++ b/src/inet/linklayer/ieee80211/mac/Ieee80211Mac.cc @@ -204,7 +204,7 @@ void Ieee80211Mac::handleUpperCommand(cMessage *msg) Ieee80211ConfigureRadioCommand *newConfigureCommand = check_and_cast(msg->getControlInfo()); if (newConfigureCommand->getChannelNumber() == -1 && oldConfigureCommand->getChannelNumber() != -1) newConfigureCommand->setChannelNumber(oldConfigureCommand->getChannelNumber()); - if (std::isnan(newConfigureCommand->getBitrate().get()) && !std::isnan(oldConfigureCommand->getBitrate().get())) + if (std::isnan(newConfigureCommand->getBitrate().get()) && !std::isnan(oldConfigureCommand->getBitrate().get())) newConfigureCommand->setBitrate(oldConfigureCommand->getBitrate()); delete pendingRadioConfigMsg; pendingRadioConfigMsg = nullptr; diff --git a/src/inet/linklayer/ieee80211/mac/coordinationfunction/Dcf.cc b/src/inet/linklayer/ieee80211/mac/coordinationfunction/Dcf.cc index ee758f85d61..6e4a4d56a00 100644 --- a/src/inet/linklayer/ieee80211/mac/coordinationfunction/Dcf.cc +++ b/src/inet/linklayer/ieee80211/mac/coordinationfunction/Dcf.cc @@ -113,7 +113,7 @@ void Dcf::transmitControlResponseFrame(Packet *responsePacket, const PtrgetDataMode()->getNetBitrate().get(), responsePacket); + emit(IRateSelection::datarateSelectedSignal, responseMode->getDataMode()->getNetBitrate().get(), responsePacket); EV_DEBUG << "Datarate for " << responsePacket->getName() << " is set to " << responseMode->getDataMode()->getNetBitrate() << ".\n"; tx->transmitFrame(responsePacket, responseHeader, modeSet->getSifsTime(), this); delete responsePacket; @@ -178,7 +178,7 @@ void Dcf::transmitFrame(Packet *packet, simtime_t ifs) const auto& header = packet->peekAtFront(); auto mode = rateSelection->computeMode(packet, header); RateSelection::setFrameMode(packet, header, mode); - emit(IRateSelection::datarateSelectedSignal, mode->getDataMode()->getNetBitrate().get(), packet); + emit(IRateSelection::datarateSelectedSignal, mode->getDataMode()->getNetBitrate().get(), packet); EV_DEBUG << "Datarate for " << packet->getName() << " is set to " << mode->getDataMode()->getNetBitrate() << ".\n"; auto pendingPacket = channelAccess->getInProgressFrames()->getPendingFrameFor(packet); auto duration = originatorProtectionMechanism->computeDurationField(packet, header, pendingPacket, pendingPacket == nullptr ? nullptr : pendingPacket->peekAtFront()); diff --git a/src/inet/linklayer/ieee80211/mac/coordinationfunction/Hcf.cc b/src/inet/linklayer/ieee80211/mac/coordinationfunction/Hcf.cc index 915f67e5a17..0a3e34c5a1c 100644 --- a/src/inet/linklayer/ieee80211/mac/coordinationfunction/Hcf.cc +++ b/src/inet/linklayer/ieee80211/mac/coordinationfunction/Hcf.cc @@ -660,7 +660,7 @@ void Hcf::transmitFrame(Packet *packet, simtime_t ifs) } auto mode = rateSelection->computeMode(packet, header, txop); setFrameMode(packet, header, mode); - emit(IRateSelection::datarateSelectedSignal, mode->getDataMode()->getNetBitrate().get(), packet); + emit(IRateSelection::datarateSelectedSignal, mode->getDataMode()->getNetBitrate().get(), packet); EV_DEBUG << "Datarate for " << packet->getName() << " is set to " << mode->getDataMode()->getNetBitrate() << ".\n"; if (txop->getProtectionMechanism() == TxopProcedure::ProtectionMechanism::SINGLE_PROTECTION) { auto pendingPacket = channelOwner->getInProgressFrames()->getPendingFrameFor(packet); @@ -695,7 +695,7 @@ void Hcf::transmitControlResponseFrame(Packet *responsePacket, const PtrgetDataMode()->getNetBitrate().get(), responsePacket); + emit(IRateSelection::datarateSelectedSignal, responseMode->getDataMode()->getNetBitrate().get(), responsePacket); EV_DEBUG << "Datarate for " << responsePacket->getName() << " is set to " << responseMode->getDataMode()->getNetBitrate() << ".\n"; tx->transmitFrame(responsePacket, responseHeader, modeSet->getSifsTime(), this); delete responsePacket; diff --git a/src/inet/linklayer/ieee80211/mac/originator/TxopProcedure.cc b/src/inet/linklayer/ieee80211/mac/originator/TxopProcedure.cc index a2421df3dc3..0ec6898bd00 100644 --- a/src/inet/linklayer/ieee80211/mac/originator/TxopProcedure.cc +++ b/src/inet/linklayer/ieee80211/mac/originator/TxopProcedure.cc @@ -72,7 +72,7 @@ void TxopProcedure::startTxop(AccessCategory ac) throw cRuntimeError("Txop is already running"); if (limit == -1) { auto referenceMode = modeSet->getSlowestMandatoryMode(); - limit = getTxopLimit(referenceMode, ac).get(); + limit = getTxopLimit(referenceMode, ac).get(); } // The STA selects between single and multiple protection when it transmits the first frame of a TXOP. // All subsequent frames transmitted by the STA in the same TXOP use the same class of duration settings. diff --git a/src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtSta.cc b/src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtSta.cc index 04a38aa6ce1..0be84d9b4fb 100644 --- a/src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtSta.cc +++ b/src/inet/linklayer/ieee80211/mgmt/Ieee80211MgmtSta.cc @@ -749,7 +749,7 @@ void Ieee80211MgmtSta::storeAPInfo(Packet *packet, const PtrbeaconInterval = body->getBeaconInterval(); auto signalPowerInd = packet->getTag(); if (signalPowerInd != nullptr) { - ap->rxPower = signalPowerInd->getPower().get(); + ap->rxPower = signalPowerInd->getPower().get(); if (ap->address == assocAP.address) assocAP.rxPower = ap->rxPower; } diff --git a/src/inet/mobility/single/GaussMarkovMobility.cc b/src/inet/mobility/single/GaussMarkovMobility.cc index 313215d3a34..94513f0f9d9 100644 --- a/src/inet/mobility/single/GaussMarkovMobility.cc +++ b/src/inet/mobility/single/GaussMarkovMobility.cc @@ -25,7 +25,7 @@ void GaussMarkovMobility::initialize(int stage) if (stage == INITSTAGE_LOCAL) { speedMean = par("speed"); speedStdDev = par("speedStdDev"); - angleMean = deg(fmod(deg(par("angle")).get(), 360.0)); + angleMean = deg(fmod(deg(par("angle")).get(), 360.0)); angleStdDev = deg(par("angleStdDev")); alpha = par("alpha"); if (alpha < 0.0 || alpha > 1.0) diff --git a/src/inet/networklayer/configurator/base/L3NetworkConfiguratorBase.cc b/src/inet/networklayer/configurator/base/L3NetworkConfiguratorBase.cc index b0d8ee75a92..b56072e31b4 100644 --- a/src/inet/networklayer/configurator/base/L3NetworkConfiguratorBase.cc +++ b/src/inet/networklayer/configurator/base/L3NetworkConfiguratorBase.cc @@ -404,7 +404,7 @@ double L3NetworkConfiguratorBase::computeWirelessLinkWeight(Link *link, const ch cModule *transmitterInterfaceModule = link->sourceInterfaceInfo->networkInterface; IRadio *transmitterRadio = check_and_cast(transmitterInterfaceModule->getSubmodule("radio")); const FlatTransmitterBase *transmitter = dynamic_cast(transmitterRadio->getTransmitter()); - double dataRate = transmitter ? transmitter->getBitrate().get() : 0; + double dataRate = transmitter ? transmitter->getBitrate().get() : 0; return dataRate != 0 ? 1 / dataRate : minLinkWeight; } else if (!strcmp(metric, "errorRate")) { diff --git a/src/inet/networklayer/ipv6/Ipv6Header.cc b/src/inet/networklayer/ipv6/Ipv6Header.cc index 0c39ac20c9f..b97f69634b3 100644 --- a/src/inet/networklayer/ipv6/Ipv6Header.cc +++ b/src/inet/networklayer/ipv6/Ipv6Header.cc @@ -36,7 +36,7 @@ const Ipv6ExtensionHeader *Ipv6Header::findExtensionHeaderByType(IpProtocolId ex void Ipv6Header::addExtensionHeader(Ipv6ExtensionHeader *eh) { - ASSERT((eh->getByteLength() >= B(1)) && (eh->getByteLength().get() % 8 == 0)); + ASSERT((eh->getByteLength() >= B(1)) && (eh->getByteLength().get() % 8 == 0)); int thisOrder = eh->getOrder(); size_t i; for (i = 0; i < extensionHeader_arraysize; i++) { diff --git a/src/inet/physicallayer/wireless/common/medium/RadioMedium.cc b/src/inet/physicallayer/wireless/common/medium/RadioMedium.cc index aad2e6a9919..2cb95ab0817 100644 --- a/src/inet/physicallayer/wireless/common/medium/RadioMedium.cc +++ b/src/inet/physicallayer/wireless/common/medium/RadioMedium.cc @@ -532,9 +532,9 @@ void RadioMedium::sendToAffectedRadios(IRadio *radio, const IWirelessSignal *tra if (neighborCache && rangeFilter != RANGE_FILTER_ANYWHERE) { double range; if (rangeFilter == RANGE_FILTER_COMMUNICATION_RANGE) - range = mediumLimitCache->getMaxCommunicationRange(radio).get(); + range = mediumLimitCache->getMaxCommunicationRange(radio).get(); else if (rangeFilter == RANGE_FILTER_INTERFERENCE_RANGE) - range = mediumLimitCache->getMaxInterferenceRange(radio).get(); + range = mediumLimitCache->getMaxInterferenceRange(radio).get(); else throw cRuntimeError("Unknown range filter %d", rangeFilter); if (std::isnan(range)) { diff --git a/src/inet/physicallayer/wireless/common/neighborcache/GridNeighborCache.cc b/src/inet/physicallayer/wireless/common/neighborcache/GridNeighborCache.cc index a385e2dfc69..fdf99e33eb0 100644 --- a/src/inet/physicallayer/wireless/common/neighborcache/GridNeighborCache.cc +++ b/src/inet/physicallayer/wireless/common/neighborcache/GridNeighborCache.cc @@ -39,7 +39,7 @@ void GridNeighborCache::initialize(int stage) else if (stage == INITSTAGE_PHYSICAL_LAYER_NEIGHBOR_CACHE) { constraintAreaMin = radioMedium->getMediumLimitCache()->getMinConstraintArea(); constraintAreaMax = radioMedium->getMediumLimitCache()->getMaxConstraintArea(); - maxSpeed = radioMedium->getMediumLimitCache()->getMaxSpeed().get(); + maxSpeed = radioMedium->getMediumLimitCache()->getMaxSpeed().get(); const Coord constraintAreaSize = constraintAreaMax - constraintAreaMin; if (std::isnan(cellSize.x)) cellSize.x = constraintAreaSize.x / par("cellCountX").intValue(); @@ -86,7 +86,7 @@ void GridNeighborCache::addRadio(const IRadio *radio) { radios.push_back(radio); Coord radioPos = radio->getAntenna()->getMobility()->getCurrentPosition(); - maxSpeed = radioMedium->getMediumLimitCache()->getMaxSpeed().get(); + maxSpeed = radioMedium->getMediumLimitCache()->getMaxSpeed().get(); if (maxSpeed != 0 && !refillCellsTimer->isScheduled() && initialized()) scheduleAfter(refillPeriod, refillCellsTimer); Coord newConstraintAreaMin = radioMedium->getMediumLimitCache()->getMinConstraintArea(); @@ -113,7 +113,7 @@ void GridNeighborCache::removeRadio(const IRadio *radio) constraintAreaMin = newConstraintAreaMin; constraintAreaMax = newConstraintAreaMax; } - maxSpeed = radioMedium->getMediumLimitCache()->getMaxSpeed().get(); + maxSpeed = radioMedium->getMediumLimitCache()->getMaxSpeed().get(); fillCubeVector(); if (maxSpeed == 0 && initialized()) cancelEvent(refillCellsTimer); diff --git a/src/inet/physicallayer/wireless/common/neighborcache/NeighborListNeighborCache.cc b/src/inet/physicallayer/wireless/common/neighborcache/NeighborListNeighborCache.cc index f3254a229d1..fac357c5f4e 100644 --- a/src/inet/physicallayer/wireless/common/neighborcache/NeighborListNeighborCache.cc +++ b/src/inet/physicallayer/wireless/common/neighborcache/NeighborListNeighborCache.cc @@ -32,7 +32,7 @@ void NeighborListNeighborCache::initialize(int stage) updateNeighborListsTimer = new cMessage("updateNeighborListsTimer"); } else if (stage == INITSTAGE_PHYSICAL_LAYER_NEIGHBOR_CACHE) { - maxSpeed = radioMedium->getMediumLimitCache()->getMaxSpeed().get(); + maxSpeed = radioMedium->getMediumLimitCache()->getMaxSpeed().get(); updateNeighborLists(); scheduleAfter(refillPeriod, updateNeighborListsTimer); } @@ -97,7 +97,7 @@ void NeighborListNeighborCache::addRadio(const IRadio *radio) radios.push_back(newEntry); radioToEntry[radio] = newEntry; updateNeighborLists(); - maxSpeed = radioMedium->getMediumLimitCache()->getMaxSpeed().get(); + maxSpeed = radioMedium->getMediumLimitCache()->getMaxSpeed().get(); if (maxSpeed != 0 && !updateNeighborListsTimer->isScheduled() && initialized()) scheduleAfter(refillPeriod, updateNeighborListsTimer); } @@ -108,7 +108,7 @@ void NeighborListNeighborCache::removeRadio(const IRadio *radio) if (it != radios.end()) { removeRadioFromNeighborLists(radio); radios.erase(it); - maxSpeed = radioMedium->getMediumLimitCache()->getMaxSpeed().get(); + maxSpeed = radioMedium->getMediumLimitCache()->getMaxSpeed().get(); if (maxSpeed == 0 && initialized()) cancelEvent(updateNeighborListsTimer); } diff --git a/src/inet/physicallayer/wireless/common/neighborcache/QuadTreeNeighborCache.cc b/src/inet/physicallayer/wireless/common/neighborcache/QuadTreeNeighborCache.cc index 46a5f5248f8..6a5af13cebb 100644 --- a/src/inet/physicallayer/wireless/common/neighborcache/QuadTreeNeighborCache.cc +++ b/src/inet/physicallayer/wireless/common/neighborcache/QuadTreeNeighborCache.cc @@ -38,7 +38,7 @@ void QuadTreeNeighborCache::initialize(int stage) constraintAreaMin = radioMedium->getMediumLimitCache()->getMinConstraintArea(); constraintAreaMax = radioMedium->getMediumLimitCache()->getMaxConstraintArea(); quadTree = new QuadTree(constraintAreaMin, constraintAreaMax, maxNumOfPointsPerQuadrant, nullptr); - maxSpeed = radioMedium->getMediumLimitCache()->getMaxSpeed().get(); + maxSpeed = radioMedium->getMediumLimitCache()->getMaxSpeed().get(); rebuildQuadTree(); scheduleAfter(refillPeriod, rebuildQuadTreeTimer); } @@ -66,7 +66,7 @@ void QuadTreeNeighborCache::addRadio(const IRadio *radio) { radios.push_back(radio); Coord radioPos = radio->getAntenna()->getMobility()->getCurrentPosition(); - maxSpeed = radioMedium->getMediumLimitCache()->getMaxSpeed().get(); + maxSpeed = radioMedium->getMediumLimitCache()->getMaxSpeed().get(); if (maxSpeed != 0 && !rebuildQuadTreeTimer->isScheduled() && initialized()) scheduleAfter(refillPeriod, rebuildQuadTreeTimer); Coord newConstraintAreaMin = radioMedium->getMediumLimitCache()->getMinConstraintArea(); @@ -97,7 +97,7 @@ void QuadTreeNeighborCache::removeRadio(const IRadio *radio) } else if (initialized()) quadTree->remove(check_and_cast(radio)); - maxSpeed = radioMedium->getMediumLimitCache()->getMaxSpeed().get(); + maxSpeed = radioMedium->getMediumLimitCache()->getMaxSpeed().get(); if (maxSpeed == 0 && initialized()) cancelEvent(rebuildQuadTreeTimer); } diff --git a/src/inet/physicallayer/wireless/common/pathloss/FreeSpacePathLoss.cc b/src/inet/physicallayer/wireless/common/pathloss/FreeSpacePathLoss.cc index a5ccf9a2def..c1e12d7bd3f 100644 --- a/src/inet/physicallayer/wireless/common/pathloss/FreeSpacePathLoss.cc +++ b/src/inet/physicallayer/wireless/common/pathloss/FreeSpacePathLoss.cc @@ -46,7 +46,7 @@ std::ostream& FreeSpacePathLoss::printToStream(std::ostream& stream, int level, double FreeSpacePathLoss::computeFreeSpacePathLoss(m waveLength, m distance, double alpha, double systemLoss) const { // factor = waveLength ^ 2 / (16 * PI ^ 2 * systemLoss * distance ^ alpha) - return distance.get() == 0.0 ? 1.0 : (waveLength * waveLength).get() / (16 * M_PI * M_PI * systemLoss * pow(distance.get(), alpha)); + return distance.get() == 0.0 ? 1.0 : (waveLength * waveLength).get() / (16 * M_PI * M_PI * systemLoss * pow(distance.get(), alpha)); } double FreeSpacePathLoss::computePathLoss(mps propagationSpeed, Hz frequency, m distance) const diff --git a/src/inet/physicallayer/wireless/common/signal/PowerFunctions.h b/src/inet/physicallayer/wireless/common/signal/PowerFunctions.h index 58fbf94d39d..6bc65812fe2 100644 --- a/src/inet/physicallayer/wireless/common/signal/PowerFunctions.h +++ b/src/inet/physicallayer/wireless/common/signal/PowerFunctions.h @@ -401,8 +401,8 @@ class INET_API ObstacleLossFunction : public FunctionBase& p) const override { - Coord transmissionPosition(std::get<0>(p).get(), std::get<1>(p).get(), std::get<2>(p).get()); - Coord receptionPosition(std::get<3>(p).get(), std::get<4>(p).get(), std::get<5>(p).get()); + Coord transmissionPosition(std::get<0>(p).get(), std::get<1>(p).get(), std::get<2>(p).get()); + Coord receptionPosition(std::get<3>(p).get(), std::get<4>(p).get(), std::get<5>(p).get()); Hz frequency = std::get<6>(p); return obstacleLoss->computeObstacleLoss(frequency, transmissionPosition, receptionPosition); } diff --git a/src/inet/physicallayer/wireless/ieee80211/bitlevel/errormodel/Ieee80211OfdmErrorModel.cc b/src/inet/physicallayer/wireless/ieee80211/bitlevel/errormodel/Ieee80211OfdmErrorModel.cc index 35d6165dd19..f948c414a34 100644 --- a/src/inet/physicallayer/wireless/ieee80211/bitlevel/errormodel/Ieee80211OfdmErrorModel.cc +++ b/src/inet/physicallayer/wireless/ieee80211/bitlevel/errormodel/Ieee80211OfdmErrorModel.cc @@ -151,8 +151,8 @@ const IReceptionSymbolModel *Ieee80211OfdmErrorModel::computeSymbolModel(const I snirFunction->partition(interval, [&] (const math::Interval& i1, const math::IFunction> *f1) { - auto intervalStartTime = std::get<0>(i1.getLower()).get(); - auto intervalEndTime = std::get<0>(i1.getUpper()).get(); + auto intervalStartTime = std::get<0>(i1.getLower()).get(); + auto intervalEndTime = std::get<0>(i1.getUpper()).get(); // sum SNIR int startTimeSlot = (int)std::floor((intervalStartTime - reception->getHeaderStartTime()) / SimTime(4, SIMTIME_US)); diff --git a/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211DsssMode.cc b/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211DsssMode.cc index e1977a3a916..efc2e7fa4dc 100644 --- a/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211DsssMode.cc +++ b/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211DsssMode.cc @@ -18,7 +18,7 @@ Ieee80211DsssDataMode::Ieee80211DsssDataMode(const DpskModulationBase *modulatio const simtime_t Ieee80211DsssDataMode::getDuration(b length) const { - return (simtime_t)(lrint(ceil((double)length.get() / getGrossBitrate().get() * 1E+6))) / 1E+6; + return (simtime_t)(lrint(ceil((double)length.get() / getGrossBitrate().get() * 1E+6))) / 1E+6; } Ieee80211DsssMode::Ieee80211DsssMode(const char *name, const Ieee80211DsssPreambleMode *preambleMode, const Ieee80211DsssHeaderMode *headerMode, const Ieee80211DsssDataMode *dataMode) : diff --git a/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211DsssMode.h b/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211DsssMode.h index 92a63291218..e967f19a76c 100644 --- a/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211DsssMode.h +++ b/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211DsssMode.h @@ -30,7 +30,7 @@ class INET_API Ieee80211DsssPreambleMode : public Ieee80211DsssChunkMode, public virtual bps getNetBitrate() const { return Mbps(1); } virtual bps getGrossBitrate() const { return getNetBitrate(); } - virtual const simtime_t getDuration() const override { return (double)getLength().get() / getNetBitrate().get(); } + virtual const simtime_t getDuration() const override { return (double)getLength().get() / getNetBitrate().get(); } virtual const DbpskModulation *getModulation() const { return &DbpskModulation::singleton; } virtual Ptr createPreamble() const override { return makeShared(); } @@ -49,7 +49,7 @@ class INET_API Ieee80211DsssHeaderMode : public Ieee80211DsssChunkMode, public I virtual b getLength() const override { return getSignalFieldLength() + getServiceFieldLength() + getLengthFieldLength() + getCrcFieldLength(); } virtual bps getNetBitrate() const override { return Mbps(1); } virtual bps getGrossBitrate() const override { return getNetBitrate(); } - virtual const simtime_t getDuration() const override { return (double)getLength().get() / getNetBitrate().get(); } + virtual const simtime_t getDuration() const override { return (double)getLength().get() / getNetBitrate().get(); } virtual const simtime_t getSymbolInterval() const override { return -1; } virtual const DbpskModulation *getModulation() const override { return &DbpskModulation::singleton; } diff --git a/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211FhssMode.h b/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211FhssMode.h index 86cc9a712c1..39295cf2bd5 100644 --- a/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211FhssMode.h +++ b/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211FhssMode.h @@ -26,7 +26,7 @@ class INET_API Ieee80211FhssPreambleMode : public IIeee80211PreambleMode virtual bps getNetBitrate() const { return Mbps(1); } virtual bps getGrossBitrate() const { return getNetBitrate(); } - virtual const simtime_t getDuration() const override { return (double)getLength().get() / getNetBitrate().get(); } + virtual const simtime_t getDuration() const override { return (double)getLength().get() / getNetBitrate().get(); } virtual Ptr createPreamble() const override { return makeShared(); } }; @@ -43,7 +43,7 @@ class INET_API Ieee80211FhssHeaderMode : public IIeee80211HeaderMode virtual b getLength() const override { return getPlwFieldLength() + getPsfFieldLength() + getHecFieldLength(); } virtual bps getNetBitrate() const override { return Mbps(1); } virtual bps getGrossBitrate() const override { return getNetBitrate(); } - virtual const simtime_t getDuration() const override { return (double)getLength().get() / getNetBitrate().get(); } + virtual const simtime_t getDuration() const override { return (double)getLength().get() / getNetBitrate().get(); } virtual const simtime_t getSymbolInterval() const override { return -1; } virtual const GfskModulationBase *getModulation() const override { return nullptr; } @@ -63,7 +63,7 @@ class INET_API Ieee80211FhssDataMode : public IIeee80211DataMode virtual bps getGrossBitrate() const override { return getNetBitrate(); } virtual b getPaddingLength(b dataLength) const override { return b(0); } virtual b getCompleteLength(b dataLength) const override { return dataLength; } - virtual const simtime_t getDuration(b length) const override { return (double)length.get() / getNetBitrate().get(); } + virtual const simtime_t getDuration(b length) const override { return (double)length.get() / getNetBitrate().get(); } virtual const simtime_t getSymbolInterval() const override { return -1; } virtual const GfskModulationBase *getModulation() const override { return modulation; } virtual int getNumberOfSpatialStreams() const override { return 1; } diff --git a/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211HrDsssMode.h b/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211HrDsssMode.h index 99e3d3341bb..c66e7e8fa7e 100644 --- a/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211HrDsssMode.h +++ b/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211HrDsssMode.h @@ -37,7 +37,7 @@ class INET_API Ieee80211HrDsssPreambleMode : public IIeee80211PreambleMode virtual bps getNetBitrate() const { return Mbps(1); } virtual bps getGrossBitrate() const { return getNetBitrate(); } - virtual const simtime_t getDuration() const override { return (double)getBitLength().get() / getNetBitrate().get(); } + virtual const simtime_t getDuration() const override { return (double)getBitLength().get() / getNetBitrate().get(); } virtual const DbpskModulation *getModulation() const { return &DbpskModulation::singleton; } virtual Ptr createPreamble() const override { return makeShared(); } @@ -59,7 +59,7 @@ class INET_API Ieee80211HrDsssHeaderMode : public IIeee80211HeaderMode virtual b getLength() const override { return getSignalFieldLength() + getServiceFieldLength() + getLengthFieldLength() + getCrcFieldLength(); } virtual bps getNetBitrate() const override { return preambleType == IEEE80211_HRDSSS_PREAMBLE_TYPE_SHORT ? Mbps(2) : Mbps(1); } virtual bps getGrossBitrate() const override { return getNetBitrate(); } - virtual const simtime_t getDuration() const override { return (double)getLength().get() / getNetBitrate().get(); } + virtual const simtime_t getDuration() const override { return (double)getLength().get() / getNetBitrate().get(); } virtual const simtime_t getSymbolInterval() const override { return -1; } virtual const DpskModulationBase *getModulation() const override { return preambleType == IEEE80211_HRDSSS_PREAMBLE_TYPE_SHORT ? static_cast(&DqpskModulation::singleton) : static_cast(&DbpskModulation::singleton); } diff --git a/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211HtMode.cc b/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211HtMode.cc index f1840b18c76..28b4b1f768c 100644 --- a/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211HtMode.cc +++ b/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211HtMode.cc @@ -281,7 +281,7 @@ const simtime_t Ieee80211HtDataMode::getDuration(b dataLength) const unsigned int numberOfCodedBitsPerSymbol = numberOfCodedBitsPerSubcarrierSum * getNumberOfDataSubcarriers(); const IForwardErrorCorrection *forwardErrorCorrection = getCode() ? getCode()->getForwardErrorCorrection() : nullptr; unsigned int dataBitsPerSymbol = forwardErrorCorrection ? forwardErrorCorrection->getDecodedLength(numberOfCodedBitsPerSymbol) : numberOfCodedBitsPerSymbol; - int numberOfSymbols = lrint(ceil((double)getCompleteLength(dataLength).get() / dataBitsPerSymbol)); // TODO getBitLength(dataLength) should be divisible by dataBitsPerSymbol + int numberOfSymbols = lrint(ceil((double)getCompleteLength(dataLength).get() / dataBitsPerSymbol)); // TODO getBitLength(dataLength) should be divisible by dataBitsPerSymbol return numberOfSymbols * getSymbolInterval(); } diff --git a/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211IrMode.h b/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211IrMode.h index 4e2b5d73ca2..2d0aa834026 100644 --- a/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211IrMode.h +++ b/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211IrMode.h @@ -51,7 +51,7 @@ class INET_API Ieee80211IrHeaderMode : public IIeee80211HeaderMode virtual b getLength() const override { return getLengthFieldLength() + getCrcFieldLength(); } virtual bps getNetBitrate() const override { return Mbps(1); } virtual bps getGrossBitrate() const override { return getNetBitrate(); } - virtual const simtime_t getDuration() const override { return (double)getLength().get() / getNetBitrate().get() + getSlotLength() * getSlotDuration(); } + virtual const simtime_t getDuration() const override { return (double)getLength().get() / getNetBitrate().get() + getSlotLength() * getSlotDuration(); } virtual const simtime_t getSymbolInterval() const override { return -1; } virtual const PpmModulationBase *getModulation() const override { return modulation; } @@ -71,7 +71,7 @@ class INET_API Ieee80211IrDataMode : public IIeee80211DataMode virtual bps getGrossBitrate() const override { return getNetBitrate(); } virtual b getPaddingLength(b dataLength) const override { return b(0); } virtual b getCompleteLength(b dataLength) const override { return dataLength; } - virtual const simtime_t getDuration(b length) const override { return (double)length.get() / getGrossBitrate().get(); } + virtual const simtime_t getDuration(b length) const override { return (double)length.get() / getGrossBitrate().get(); } virtual const simtime_t getSymbolInterval() const override { return -1; } virtual const PpmModulationBase *getModulation() const override { return modulation; } virtual int getNumberOfSpatialStreams() const override { return 1; } diff --git a/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211OfdmMode.cc b/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211OfdmMode.cc index 868db5a22f3..37a4e5f0a82 100644 --- a/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211OfdmMode.cc +++ b/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211OfdmMode.cc @@ -223,7 +223,7 @@ const simtime_t Ieee80211OfdmDataMode::getDuration(b dataLength) const const ConvolutionalCode *convolutionalCode = code ? code->getConvolutionalCode() : nullptr; unsigned int dataBitsPerOFDMSymbol = convolutionalCode ? convolutionalCode->getDecodedLength(codedBitsPerOFDMSymbol) : codedBitsPerOFDMSymbol; // IEEE Std 802.11-2007, section 17.3.5.3, equation (17-11) - unsigned int numberOfSymbols = lrint(ceil((double)(getServiceFieldLength() + getCompleteLength(dataLength)).get() / dataBitsPerOFDMSymbol)); + unsigned int numberOfSymbols = lrint(ceil((double)(getServiceFieldLength() + getCompleteLength(dataLength)).get() / dataBitsPerOFDMSymbol)); // Add signal extension for ERP PHY return numberOfSymbols * getSymbolInterval(); } diff --git a/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211OfdmMode.h b/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211OfdmMode.h index b0b3d13d3db..6ca84f780f3 100644 --- a/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211OfdmMode.h +++ b/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211OfdmMode.h @@ -24,7 +24,7 @@ class INET_API Ieee80211OfdmTimingRelatedParametersBase Ieee80211OfdmTimingRelatedParametersBase(Hz channelSpacing) : channelSpacing(channelSpacing) {} Hz getSubcarrierFrequencySpacing() const { return channelSpacing / 64; } - const simtime_t getFFTTransformPeriod() const { return simtime_t(1 / getSubcarrierFrequencySpacing().get()); } + const simtime_t getFFTTransformPeriod() const { return simtime_t(1 / getSubcarrierFrequencySpacing().get()); } const simtime_t getGIDuration() const { return getFFTTransformPeriod() / 4; } const simtime_t getSymbolInterval() const { return getGIDuration() + getFFTTransformPeriod(); } diff --git a/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211VhtMode.cc b/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211VhtMode.cc index 30d69fe2e51..df3541ac3e8 100644 --- a/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211VhtMode.cc +++ b/src/inet/physicallayer/wireless/ieee80211/mode/Ieee80211VhtMode.cc @@ -635,7 +635,7 @@ const simtime_t Ieee80211VhtDataMode::getDuration(b dataLength) const unsigned int numberOfCodedBitsPerSymbol = numberOfCodedBitsPerSubcarrierSum * getNumberOfDataSubcarriers(); const IForwardErrorCorrection *forwardErrorCorrection = getCode() ? getCode()->getForwardErrorCorrection() : nullptr; unsigned int dataBitsPerSymbol = forwardErrorCorrection ? forwardErrorCorrection->getDecodedLength(numberOfCodedBitsPerSymbol) : numberOfCodedBitsPerSymbol; - int numberOfSymbols = lrint(ceil((double)getCompleteLength(dataLength).get() / dataBitsPerSymbol)); // TODO getBitLength(dataBitLength) should be divisible by dataBitsPerSymbol + int numberOfSymbols = lrint(ceil((double)getCompleteLength(dataLength).get() / dataBitsPerSymbol)); // TODO getBitLength(dataBitLength) should be divisible by dataBitsPerSymbol return numberOfSymbols * getSymbolInterval(); } diff --git a/src/inet/physicallayer/wireless/ieee802154/bitlevel/Ieee802154UwbIrReceiver.cc b/src/inet/physicallayer/wireless/ieee802154/bitlevel/Ieee802154UwbIrReceiver.cc index ef323079d0d..305abc22f55 100644 --- a/src/inet/physicallayer/wireless/ieee802154/bitlevel/Ieee802154UwbIrReceiver.cc +++ b/src/inet/physicallayer/wireless/ieee802154/bitlevel/Ieee802154UwbIrReceiver.cc @@ -135,14 +135,14 @@ std::pair Ieee802154UwbIrReceiver::integrateWindow(simtime_t_cre auto dimensionalSignalReception = check_and_cast(reception->getAnalogModel()); const Ptr>>& signalPower = dimensionalSignalReception->getPower(); Interval interval(Point(simsec(now), Hz(3.1)), Point(simsec(now), Hz(10.6)), 0b10, 0b10, 0b10); - double measure = signalPower->getMean(interval).get() * peakPulsePower; // TODO de-normalize (peakPulsePower should be in AirFrame or in Signal, to be set at run-time) + double measure = signalPower->getMean(interval).get() * peakPulsePower; // TODO de-normalize (peakPulsePower should be in AirFrame or in Signal, to be set at run-time) signalValue = measure * 0.5; // we capture half of the maximum possible pulse energy to account for self interference resPower = resPower + signalValue; // consider all interferers at this point in time for (const auto& interferingReception : *interferingReceptions) { auto dimensionalInterferingReception = check_and_cast(interferingReception->getAnalogModel()); const Ptr>>& interferingPower = dimensionalInterferingReception->getPower(); - double measure = interferingPower->getMean(interval).get() * peakPulsePower; // TODO de-normalize (peakPulsePower should be in AirFrame or in Signal, to be set at run-time) + double measure = interferingPower->getMean(interval).get() * peakPulsePower; // TODO de-normalize (peakPulsePower should be in AirFrame or in Signal, to be set at run-time) // measure = measure * uniform(0, +1); // random point of Efield at sampling (due to pulse waveform and self interference) // take a random point within pulse envelope for interferer resPower = resPower + measure * uniform(-1, +1); @@ -151,7 +151,7 @@ std::pair Ieee802154UwbIrReceiver::integrateWindow(simtime_t_cre vEfield = sqrt(50 * resPower); // P=V²/R // add thermal noise realization const DimensionalNoise *dimensionalBackgroundNoise = check_and_cast(backgroundNoise); - vThermalNoise = dimensionalBackgroundNoise->getPower()->getMean(interval).get(); + vThermalNoise = dimensionalBackgroundNoise->getPower()->getMean(interval).get(); vmeasured = vEfield + vThermalNoise; vmeasured_square = pow(vmeasured, 2); // signal + interference + noise diff --git a/src/inet/protocolelement/transceiver/DestreamingReceiver.cc b/src/inet/protocolelement/transceiver/DestreamingReceiver.cc index c4d44a21d2f..1f79f4bc03b 100644 --- a/src/inet/protocolelement/transceiver/DestreamingReceiver.cc +++ b/src/inet/protocolelement/transceiver/DestreamingReceiver.cc @@ -31,7 +31,7 @@ void DestreamingReceiver::handleMessageWhenUp(cMessage *message) else { auto packet = check_and_cast(signal->getEncapsulatedPacket()); simtime_t timePosition = signal->getDuration() - signal->getRemainingDuration(); - b position(std::floor(packet->getDataLength().get() * timePosition.dbl() / signal->getDuration().dbl())); + b position(std::floor(packet->getDataLength().get() * timePosition.dbl() / signal->getDuration().dbl())); receivePacketProgress(signal, inputGate, rxDatarate, position, timePosition, b(0), 0); } } diff --git a/src/inet/protocolelement/transceiver/StreamThroughReceiver.cc b/src/inet/protocolelement/transceiver/StreamThroughReceiver.cc index 5f28a741212..23d68d88a55 100644 --- a/src/inet/protocolelement/transceiver/StreamThroughReceiver.cc +++ b/src/inet/protocolelement/transceiver/StreamThroughReceiver.cc @@ -31,7 +31,7 @@ void StreamThroughReceiver::handleMessageWhenUp(cMessage *message) else { auto packet = check_and_cast(signal->getEncapsulatedPacket()); simtime_t timePosition = signal->getDuration() - signal->getRemainingDuration(); - b position(std::floor(packet->getDataLength().get() * timePosition.dbl() / signal->getDuration().dbl())); + b position(std::floor(packet->getDataLength().get() * timePosition.dbl() / signal->getDuration().dbl())); receivePacketProgress(signal, inputGate, rxDatarate, position, timePosition, b(0), 0); } } diff --git a/src/inet/queueing/server/TokenBasedServer.cc b/src/inet/queueing/server/TokenBasedServer.cc index 0b57e2469c1..6b94421e772 100644 --- a/src/inet/queueing/server/TokenBasedServer.cc +++ b/src/inet/queueing/server/TokenBasedServer.cc @@ -39,7 +39,7 @@ void TokenBasedServer::processPackets() else { auto tokenConsumptionPerPacket = tokenConsumptionPerPacketParameter->doubleValue(); auto tokenConsumptionPerBit = tokenConsumptionPerBitParameter->doubleValue(); - int numRequiredTokens = tokenConsumptionPerPacket + tokenConsumptionPerBit * packet->getDataLength().get(); + int numRequiredTokens = tokenConsumptionPerPacket + tokenConsumptionPerBit * packet->getDataLength().get(); if (numTokens >= numRequiredTokens) { packet = provider.pullPacket(); take(packet); diff --git a/src/inet/queueing/tokengenerator/PacketBasedTokenGenerator.cc b/src/inet/queueing/tokengenerator/PacketBasedTokenGenerator.cc index 7969c42fd9b..1c830d37c11 100644 --- a/src/inet/queueing/tokengenerator/PacketBasedTokenGenerator.cc +++ b/src/inet/queueing/tokengenerator/PacketBasedTokenGenerator.cc @@ -38,7 +38,7 @@ void PacketBasedTokenGenerator::pushPacket(Packet *packet, const cGate *gate) { Enter_Method("pushPacket"); take(packet); - auto numTokens = numTokensPerPacketParameter->doubleValue() + numTokensPerBitParameter->doubleValue() * packet->getDataLength().get(); + auto numTokens = numTokensPerPacketParameter->doubleValue() + numTokensPerBitParameter->doubleValue() * packet->getDataLength().get(); numTokensGenerated += numTokens; emit(TokenGeneratorBase::tokensCreatedSignal, numTokens); storage->addTokens(numTokens); diff --git a/src/inet/routing/ospfv2/Ospfv2PacketSerializer.cc b/src/inet/routing/ospfv2/Ospfv2PacketSerializer.cc index cc2edc9b738..8a428bd7971 100644 --- a/src/inet/routing/ospfv2/Ospfv2PacketSerializer.cc +++ b/src/inet/routing/ospfv2/Ospfv2PacketSerializer.cc @@ -102,7 +102,7 @@ const Ptr Ospfv2PacketSerializer::deserialize(MemoryInputStream& stream) helloPacket->setRouterDeadInterval(stream.readUint32Be()); helloPacket->setDesignatedRouter(stream.readIpv4Address()); helloPacket->setBackupDesignatedRouter(stream.readIpv4Address()); - int numNeighbors = (B(packetLength) - OSPFv2_HEADER_LENGTH - OSPFv2_HELLO_HEADER_LENGTH).get() / 4; + int numNeighbors = (B(packetLength) - OSPFv2_HEADER_LENGTH - OSPFv2_HELLO_HEADER_LENGTH).get() / 4; if (numNeighbors < 0) helloPacket->markIncorrect(); helloPacket->setNeighborArraySize(numNeighbors); @@ -122,7 +122,7 @@ const Ptr Ospfv2PacketSerializer::deserialize(MemoryInputStream& stream) ddOptions.M_More = stream.readBit(); ddOptions.MS_MasterSlave = stream.readBit(); ddPacket->setDdSequenceNumber(stream.readUint32Be()); - int numLsaHeaders = ((B(packetLength) - OSPFv2_HEADER_LENGTH - OSPFv2_DD_HEADER_LENGTH) / OSPFv2_LSA_HEADER_LENGTH).get(); + int numLsaHeaders = ((B(packetLength) - OSPFv2_HEADER_LENGTH - OSPFv2_DD_HEADER_LENGTH) / OSPFv2_LSA_HEADER_LENGTH).get(); if (numLsaHeaders < 0) ddPacket->markIncorrect(); ddPacket->setLsaHeadersArraySize(numLsaHeaders); @@ -136,7 +136,7 @@ const Ptr Ospfv2PacketSerializer::deserialize(MemoryInputStream& stream) case LINKSTATE_REQUEST_PACKET: { auto requestPacket = makeShared(); copyHeaderFields(ospfPacket, requestPacket); - int numReq = (B(packetLength) - OSPFv2_HEADER_LENGTH).get() / OSPFv2_REQUEST_LENGTH.get(); + int numReq = (B(packetLength) - OSPFv2_HEADER_LENGTH).get() / OSPFv2_REQUEST_LENGTH.get(); if (numReq < 0) requestPacket->markIncorrect(); requestPacket->setRequestsArraySize(numReq); @@ -162,7 +162,7 @@ const Ptr Ospfv2PacketSerializer::deserialize(MemoryInputStream& stream) case LINKSTATE_ACKNOWLEDGEMENT_PACKET: { auto ackPacket = makeShared(); copyHeaderFields(ospfPacket, ackPacket); - int numHeaders = (B(packetLength) - OSPFv2_HEADER_LENGTH).get() / OSPFv2_LSA_HEADER_LENGTH.get(); + int numHeaders = (B(packetLength) - OSPFv2_HEADER_LENGTH).get() / OSPFv2_LSA_HEADER_LENGTH.get(); if (numHeaders < 0) ackPacket->markIncorrect(); ackPacket->setLsaHeadersArraySize(numHeaders); @@ -319,7 +319,7 @@ void Ospfv2PacketSerializer::deserializeNetworkLsa(MemoryInputStream& stream, co { networkLsa.setNetworkMask(stream.readIpv4Address()); int numAttachedRouters = (B(networkLsa.getHeader().getLsaLength()) - - OSPFv2_LSA_HEADER_LENGTH - OSPFv2_NETWORKLSA_MASK_LENGTH).get() / OSPFv2_NETWORKLSA_ADDRESS_LENGTH.get(); + OSPFv2_LSA_HEADER_LENGTH - OSPFv2_NETWORKLSA_MASK_LENGTH).get() / OSPFv2_NETWORKLSA_ADDRESS_LENGTH.get(); if (numAttachedRouters < 0) updatePacket->markIncorrect(); else @@ -382,7 +382,7 @@ void Ospfv2PacketSerializer::deserializeAsExternalLsa(MemoryInputStream& stream, contents.setNetworkMask(stream.readIpv4Address()); int numExternalTos = (B(asExternalLsa.getHeader().getLsaLength()) - - OSPFv2_LSA_HEADER_LENGTH - OSPFv2_ASEXTERNALLSA_HEADER_LENGTH).get() / OSPFv2_ASEXTERNALLSA_TOS_INFO_LENGTH.get(); + OSPFv2_LSA_HEADER_LENGTH - OSPFv2_ASEXTERNALLSA_HEADER_LENGTH).get() / OSPFv2_ASEXTERNALLSA_TOS_INFO_LENGTH.get(); if (numExternalTos < 0) updatePacket->markIncorrect(); else diff --git a/src/inet/routing/ospfv2/router/Ospfv2Area.cc b/src/inet/routing/ospfv2/router/Ospfv2Area.cc index a85f3ec3454..688d3608c15 100644 --- a/src/inet/routing/ospfv2/router/Ospfv2Area.cc +++ b/src/inet/routing/ospfv2/router/Ospfv2Area.cc @@ -937,7 +937,7 @@ RouterLsa *Ospfv2Area::originateRouterLSA() } // update the length field in the LSA header - lsaHeader.setLsaLength(calculateLSASize(routerLSA).get()); + lsaHeader.setLsaLength(calculateLSASize(routerLSA).get()); routerLSA->setSource(LsaTrackingInfo::ORIGINATED); diff --git a/src/inet/routing/ospfv3/process/Ospfv3Area.cc b/src/inet/routing/ospfv3/process/Ospfv3Area.cc index bf27a7cff87..18de25ce4b0 100644 --- a/src/inet/routing/ospfv3/process/Ospfv3Area.cc +++ b/src/inet/routing/ospfv3/process/Ospfv3Area.cc @@ -1237,7 +1237,7 @@ void Ospfv3Area::originateInterAreaPrefixLSA(const Ospfv3Lsa *prefLsa, Ospfv3Are newLsa->setPrefix(lsa->getPrefix()); newLsa->setMetric(lsa->getMetric()); - newHeader2.setLsaLength(calculateLSASize(newLsa).get()); + newHeader2.setLsaLength(calculateLSASize(newLsa).get()); if (area->installInterAreaPrefixLSA(newLsa)) area->floodLSA(newLsa); @@ -1279,7 +1279,7 @@ void Ospfv3Area::originateDefaultInterAreaPrefixLSA(Ospfv3Area *toArea) newPrefix.addressPrefix = defaultPref; packetLength += B(4 * ((0 + 31) / 32)) + OSPFV3_LSA_PREFIX_HEADER_LENGTH; } - newHeader.setLsaLength(calculateLSASize(newLsa).get()); + newHeader.setLsaLength(calculateLSASize(newLsa).get()); toArea->installInterAreaPrefixLSA(newLsa); delete newLsa; } diff --git a/src/inet/routing/pim/PimPacketSerializer.cc b/src/inet/routing/pim/PimPacketSerializer.cc index 9ae180e15f4..34a259cc7cf 100644 --- a/src/inet/routing/pim/PimPacketSerializer.cc +++ b/src/inet/routing/pim/PimPacketSerializer.cc @@ -235,7 +235,7 @@ const Ptr PimPacketSerializer::deserialize(MemoryInputStream& stream) con pimHello->setCrcMode(pimPacket->getCrcMode()); PimHelloOptionType type; size_t i = 0; - while (stream.getRemainingLength().get() > 0) { + while (stream.getRemainingLength().get() > 0) { type = static_cast(stream.readUint16Be()); switch (type) { case Holdtime: { diff --git a/src/inet/transportlayer/rtp/RtcpPacket.cc b/src/inet/transportlayer/rtp/RtcpPacket.cc index 761087c0515..8111bfbba64 100644 --- a/src/inet/transportlayer/rtp/RtcpPacket.cc +++ b/src/inet/transportlayer/rtp/RtcpPacket.cc @@ -17,7 +17,7 @@ namespace rtp { void RtcpPacket::paddingAndSetLength() { handleChange(); - int64_t chunkBits = getChunkLength().get(); + int64_t chunkBits = getChunkLength().get(); rtcpLength = (chunkBits + 31) / 32 - 1; setChunkLength(b((rtcpLength + 1) * 32)); } diff --git a/src/inet/visualizer/base/EnergyStorageVisualizerBase.cc b/src/inet/visualizer/base/EnergyStorageVisualizerBase.cc index c5ae8242305..b5605e3e67e 100644 --- a/src/inet/visualizer/base/EnergyStorageVisualizerBase.cc +++ b/src/inet/visualizer/base/EnergyStorageVisualizerBase.cc @@ -64,9 +64,9 @@ void EnergyStorageVisualizerBase::refreshDisplay() const double EnergyStorageVisualizerBase::getNominalCapacity(const IEnergyStorage *energyStorage) const { if (auto epEnergyStorage = dynamic_cast(energyStorage)) - return epEnergyStorage->getNominalEnergyCapacity().get(); + return epEnergyStorage->getNominalEnergyCapacity().get(); else if (auto ccEnergyStorage = dynamic_cast(energyStorage)) - return ccEnergyStorage->getNominalChargeCapacity().get(); + return ccEnergyStorage->getNominalChargeCapacity().get(); else throw cRuntimeError("Unknown energy storage"); } @@ -74,9 +74,9 @@ double EnergyStorageVisualizerBase::getNominalCapacity(const IEnergyStorage *ene double EnergyStorageVisualizerBase::getResidualCapacity(const IEnergyStorage *energyStorage) const { if (auto epEnergyStorage = dynamic_cast(energyStorage)) - return epEnergyStorage->getResidualEnergyCapacity().get(); + return epEnergyStorage->getResidualEnergyCapacity().get(); else if (auto ccEnergyStorage = dynamic_cast(energyStorage)) - return ccEnergyStorage->getResidualChargeCapacity().get(); + return ccEnergyStorage->getResidualChargeCapacity().get(); else throw cRuntimeError("Unknown energy storage"); } diff --git a/src/inet/visualizer/base/MediumVisualizerBase.cc b/src/inet/visualizer/base/MediumVisualizerBase.cc index 2f5e11480fa..705090781f6 100644 --- a/src/inet/visualizer/base/MediumVisualizerBase.cc +++ b/src/inet/visualizer/base/MediumVisualizerBase.cc @@ -167,7 +167,7 @@ void MediumVisualizerBase::initialize(int stage) } else if (stage == INITSTAGE_LAST) { if (std::isnan(signalPropagationAnimationSpeed) && radioMedium != nullptr) { - double maxPropagationDuration = radioMedium->getMediumLimitCache()->getMaxConstraintArea().distance(radioMedium->getMediumLimitCache()->getMinConstraintArea()) / mps(radioMedium->getPropagation()->getPropagationSpeed()).get(); + double maxPropagationDuration = radioMedium->getMediumLimitCache()->getMaxConstraintArea().distance(radioMedium->getMediumLimitCache()->getMinConstraintArea()) / mps(radioMedium->getPropagation()->getPropagationSpeed()).get(); defaultSignalPropagationAnimationSpeed = maxPropagationDuration / signalPropagationAnimationTime; } } diff --git a/src/inet/visualizer/canvas/mobility/MobilityCanvasVisualizer.cc b/src/inet/visualizer/canvas/mobility/MobilityCanvasVisualizer.cc index 5ec60024f40..9339d9de4c6 100644 --- a/src/inet/visualizer/canvas/mobility/MobilityCanvasVisualizer.cc +++ b/src/inet/visualizer/canvas/mobility/MobilityCanvasVisualizer.cc @@ -58,8 +58,8 @@ void MobilityCanvasVisualizer::refreshDisplay() const if (displayOrientations) { // NOTE: this negation cancels out the (incorrect) CCW angle handling of cPieSliceFigure (see bug https://dev.omnetpp.org/bugs/view.php?id=1030) auto angle = -orientation.toEulerAngles().alpha; - mobilityVisualization->orientationFigure->setStartAngle(rad(angle - rad(M_PI) * orientationPieSize).get()); - mobilityVisualization->orientationFigure->setEndAngle(rad(angle + rad(M_PI) * orientationPieSize).get()); + mobilityVisualization->orientationFigure->setStartAngle((angle - rad(M_PI) * orientationPieSize).get()); + mobilityVisualization->orientationFigure->setEndAngle((angle + rad(M_PI) * orientationPieSize).get()); double radius = orientationPieRadius / getEnvir()->getZoomLevel(visualizationTargetModule); mobilityVisualization->orientationFigure->setBounds(cFigure::Rectangle(position.x - radius, position.y - radius, 2 * radius, 2 * radius)); } diff --git a/src/inet/visualizer/canvas/physicallayer/MediumCanvasVisualizer.cc b/src/inet/visualizer/canvas/physicallayer/MediumCanvasVisualizer.cc index 3f30572593e..7a577e10322 100644 --- a/src/inet/visualizer/canvas/physicallayer/MediumCanvasVisualizer.cc +++ b/src/inet/visualizer/canvas/physicallayer/MediumCanvasVisualizer.cc @@ -443,7 +443,7 @@ void MediumCanvasVisualizer::refreshSpectrumFigurePowerFunction(const Ptr(upper) != std::get<4>(lower)) - std::get<4>(upper) = Hz(std::nextafter(std::get<4>(upper).get(), std::get<4>(lower).get())); + std::get<4>(upper) = Hz(std::nextafter(std::get<4>(upper).get(), std::get<4>(lower).get())); WpHz power1; WpHz power2; std::tie(power1, power2) = computePowerForPartitionBounds(powerFunction, lower, upper, partitonPowerFunction, antenna, position); @@ -497,9 +497,9 @@ std::pair MediumCanvasVisualizer::computePowerForDirectionalAntenna( if (auto rf = dynamicPtrCast>>(powerFunction)) { if (auto tf = dynamicPtrCast(rf->getF1())) { const Point& startPosition = tf->getStartPosition(); - double dx = std::get<0>(startPosition).get() - position.x; - double dy = std::get<1>(startPosition).get() - position.y; - double dz = std::get<2>(startPosition).get() - position.z; + double dx = std::get<0>(startPosition).get() - position.x; + double dy = std::get<1>(startPosition).get() - position.y; + double dz = std::get<2>(startPosition).get() - position.z; double gain = 1; if (dx != 0 || dy != 0 || dz != 0) { const Quaternion& startOrientation = antenna->getMobility()->getCurrentAngularPosition(); @@ -862,8 +862,8 @@ void MediumCanvasVisualizer::refreshSignalFigure(const ITransmission *transmissi { const IPropagation *propagation = radioMedium->getPropagation(); cFigure *groupFigure = getSignalFigure(transmission); - double startRadius = propagation->getPropagationSpeed().get() * (simTime() - transmission->getStartTime()).dbl(); - double endRadius = std::max(0.0, propagation->getPropagationSpeed().get() * (simTime() - transmission->getEndTime()).dbl()); + double startRadius = propagation->getPropagationSpeed().get() * (simTime() - transmission->getStartTime()).dbl(); + double endRadius = std::max(0.0, propagation->getPropagationSpeed().get() * (simTime() - transmission->getEndTime()).dbl()); if (groupFigure) { SignalFigure *signalFigure = static_cast(groupFigure->getFigure(0)); cLabelFigure *labelFigure = static_cast(groupFigure->getFigure(1)); diff --git a/src/inet/visualizer/canvas/scene/NetworkNodeCanvasVisualizer.cc b/src/inet/visualizer/canvas/scene/NetworkNodeCanvasVisualizer.cc index fd5e2e7b01b..693e132c59a 100644 --- a/src/inet/visualizer/canvas/scene/NetworkNodeCanvasVisualizer.cc +++ b/src/inet/visualizer/canvas/scene/NetworkNodeCanvasVisualizer.cc @@ -52,7 +52,7 @@ void NetworkNodeCanvasVisualizer::refreshDisplay() const auto imageFigure = visualization->getImageFigure(); if (imageFigure != nullptr) { auto orientation = getOrientation(networkNode); - imageFigure->setTransform(cFigure::Transform().rotate(orientation.toEulerAngles().getAlpha().get())); + imageFigure->setTransform(cFigure::Transform().rotate(orientation.toEulerAngles().getAlpha().get())); } visualization->refreshDisplay(); } diff --git a/src/inet/visualizer/osg/physicallayer/MediumOsgVisualizer.cc b/src/inet/visualizer/osg/physicallayer/MediumOsgVisualizer.cc index 1e82af627bf..99f5939b89e 100644 --- a/src/inet/visualizer/osg/physicallayer/MediumOsgVisualizer.cc +++ b/src/inet/visualizer/osg/physicallayer/MediumOsgVisualizer.cc @@ -287,8 +287,8 @@ void MediumOsgVisualizer::refreshRingTransmissionNode(const ITransmission *trans { auto propagation = radioMedium->getPropagation(); // TODO auto transmissionStart = transmission->getStartPosition(); - double startRadius = propagation->getPropagationSpeed().get() * (simTime() - transmission->getStartTime()).dbl(); - double endRadius = std::max(0.0, propagation->getPropagationSpeed().get() * (simTime() - transmission->getEndTime()).dbl()); + double startRadius = propagation->getPropagationSpeed().get() * (simTime() - transmission->getStartTime()).dbl(); + double endRadius = std::max(0.0, propagation->getPropagationSpeed().get() * (simTime() - transmission->getEndTime()).dbl()); auto positionAttitudeTransform = static_cast(node); auto annulusAutoTransform = static_cast(positionAttitudeTransform->getChild(0)); auto annulus = static_cast(static_cast(annulusAutoTransform->getChild(0))->getDrawable(0)); @@ -309,8 +309,8 @@ void MediumOsgVisualizer::refreshSphereTransmissionNode(const ITransmission *tra { auto propagation = radioMedium->getPropagation(); // TODO auto transmissionStart = transmission->getStartPosition(); - double startRadius = propagation->getPropagationSpeed().get() * (simTime() - transmission->getStartTime()).dbl(); - double endRadius = std::max(0.0, propagation->getPropagationSpeed().get() * (simTime() - transmission->getEndTime()).dbl()); + double startRadius = propagation->getPropagationSpeed().get() * (simTime() - transmission->getStartTime()).dbl(); + double endRadius = std::max(0.0, propagation->getPropagationSpeed().get() * (simTime() - transmission->getEndTime()).dbl()); auto group = static_cast(node); auto startGeode = static_cast(group->getChild(0)); startGeode->setNodeMask(startRadius != 0);