From e3b8bc49b5926960561cf12f435153fba33f671e Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Wed, 7 Dec 2022 18:22:56 +0000 Subject: [PATCH] Fix casing of classes, structs and enums to start with an uppercase letter --- src/core/model/hash-fnv.h | 2 +- src/core/model/hash-murmur3.h | 2 +- src/core/model/simple-ref-count.h | 6 +-- src/internet/model/tcp-option.cc | 6 +-- src/lr-wpan/model/lr-wpan-fields.h | 4 +- src/lte/model/lte-rrc-sap.h | 30 +++++++------- .../model/dot11s/ie-dot11s-configuration.cc | 14 +++---- .../model/dot11s/ie-dot11s-configuration.h | 24 +++++------ .../examples/colors-link-description.cc | 6 +-- src/netanim/examples/resources-counters.cc | 6 +-- .../test/queue-disc-traces-test-suite.cc | 20 +++++----- src/wimax/model/bvec.h | 2 +- src/wimax/model/ipcs-classifier-record.cc | 16 ++++---- src/wimax/model/ipcs-classifier-record.h | 8 ++-- src/wimax/model/mac-messages.h | 2 - src/wimax/model/simple-ofdm-send-param.cc | 40 +++++++++---------- src/wimax/model/simple-ofdm-send-param.h | 18 ++++----- src/wimax/model/simple-ofdm-wimax-channel.cc | 6 +-- src/wimax/model/simple-ofdm-wimax-channel.h | 4 +- src/wimax/model/simple-ofdm-wimax-phy.cc | 36 ++++++++--------- src/wimax/model/simple-ofdm-wimax-phy.h | 12 +++--- src/wimax/model/wimax-tlv.cc | 13 +++--- src/wimax/model/wimax-tlv.h | 12 +++--- 23 files changed, 142 insertions(+), 147 deletions(-) diff --git a/src/core/model/hash-fnv.h b/src/core/model/hash-fnv.h index 72a945d39..21e9aa6bc 100644 --- a/src/core/model/hash-fnv.h +++ b/src/core/model/hash-fnv.h @@ -98,7 +98,7 @@ class Fnv1a : public Implementation /** * Seed value */ - enum seed + enum Seed { SEED = 0x8BADF00D /**< Ate bad food */ }; diff --git a/src/core/model/hash-murmur3.h b/src/core/model/hash-murmur3.h index 6e06ca8df..5ba8fee3e 100644 --- a/src/core/model/hash-murmur3.h +++ b/src/core/model/hash-murmur3.h @@ -101,7 +101,7 @@ class Murmur3 : public Implementation * This has to be a constant for all MPI ranks to generate * the same hash from the same string. */ - enum seed + enum Seed { SEED = 0x8BADF00D // Ate bad food }; diff --git a/src/core/model/simple-ref-count.h b/src/core/model/simple-ref-count.h index 75f075e50..d71aff47d 100644 --- a/src/core/model/simple-ref-count.h +++ b/src/core/model/simple-ref-count.h @@ -40,7 +40,7 @@ namespace ns3 * \ingroup ptr * \brief Empty class, used as a default parent class for SimpleRefCount */ -class empty +class Empty { }; @@ -66,7 +66,7 @@ class empty * common C++ template pattern whose name is CRTP (Curiously * Recursive Template Pattern) * \tparam PARENT \explicit The typename of the parent of this template. - * By default, this typename is "'ns3::empty'" which is an empty + * By default, this typename is "'ns3::Empty'" which is an empty * class: compilers which implement the EBCO optimization (empty * base class optimization) will make this a no-op * \tparam DELETER \explicit The typename of a class which implements @@ -76,7 +76,7 @@ class empty * * Interesting users of this class include ns3::Object as well as ns3::Packet. */ -template > +template > class SimpleRefCount : public PARENT { public: diff --git a/src/internet/model/tcp-option.cc b/src/internet/model/tcp-option.cc index 34de03628..22ef1293f 100644 --- a/src/internet/model/tcp-option.cc +++ b/src/internet/model/tcp-option.cc @@ -61,14 +61,14 @@ TcpOption::GetInstanceTypeId() const Ptr TcpOption::CreateOption(uint8_t kind) { - struct kindToTid + struct KindToTid { TcpOption::Kind kind; TypeId tid; }; static ObjectFactory objectFactory; - static kindToTid toTid[] = { + static KindToTid toTid[] = { {TcpOption::END, TcpOptionEnd::GetTypeId()}, {TcpOption::MSS, TcpOptionMSS::GetTypeId()}, {TcpOption::NOP, TcpOptionNOP::GetTypeId()}, @@ -79,7 +79,7 @@ TcpOption::CreateOption(uint8_t kind) {TcpOption::UNKNOWN, TcpOptionUnknown::GetTypeId()}, }; - for (unsigned int i = 0; i < sizeof(toTid) / sizeof(kindToTid); ++i) + for (unsigned int i = 0; i < sizeof(toTid) / sizeof(KindToTid); ++i) { if (toTid[i].kind == kind) { diff --git a/src/lr-wpan/model/lr-wpan-fields.h b/src/lr-wpan/model/lr-wpan-fields.h index bafaf54aa..b322d717a 100644 --- a/src/lr-wpan/model/lr-wpan-fields.h +++ b/src/lr-wpan/model/lr-wpan-fields.h @@ -224,7 +224,7 @@ class GtsFields /** * GTS Descriptor */ - struct gtsDescriptor + struct GtsDescriptor { Mac16Address m_gtsDescDevShortAddr; //!< GTS Descriptor Device Short Address (Bit 0-15) uint8_t m_gtsDescStartSlot; //!< GTS Descriptor GTS Starting Slot(Bit 16-19) @@ -239,7 +239,7 @@ class GtsFields uint8_t m_gtsDirMask; //!< GTS Direction field Directions Mask (Bit 0-6) // GTS Direction field Reserved (Not Necessary) (Bit 7) // GTS List - gtsDescriptor m_gtsList[7]; //!< GTS List field (maximum descriptors stored == 7) + GtsDescriptor m_gtsList[7]; //!< GTS List field (maximum descriptors stored == 7) }; /** diff --git a/src/lte/model/lte-rrc-sap.h b/src/lte/model/lte-rrc-sap.h index 03678db90..2d141ad67 100644 --- a/src/lte/model/lte-rrc-sap.h +++ b/src/lte/model/lte-rrc-sap.h @@ -93,7 +93,7 @@ class LteRrcSap struct RlcConfig { /// the direction choice - enum direction + enum Direction { AM, UM_BI_DIRECTIONAL, @@ -101,7 +101,7 @@ class LteRrcSap UM_UNI_DIRECTIONAL_DL }; - direction choice; ///< direction choice + Direction choice; ///< direction choice }; /// LogicalChannelConfig structure @@ -117,13 +117,13 @@ class LteRrcSap struct SoundingRsUlConfigCommon { /// the config action - enum action + enum Action { SETUP, RESET }; - action type; ///< action type + Action type; ///< action type uint16_t srsBandwidthConfig; ///< SRS bandwidth config uint8_t srsSubframeConfig; ///< SRS subframe config @@ -133,13 +133,13 @@ class LteRrcSap struct SoundingRsUlConfigDedicated { /// the config action - enum action + enum Action { SETUP, RESET }; - action type; ///< action type + Action type; ///< action type uint16_t srsBandwidth; ///< SRS bandwidth uint16_t srsConfigIndex; ///< SRS config index @@ -165,7 +165,7 @@ class LteRrcSap * P_A values, TS 36.331 6.3.2 PDSCH-Config * ENUMERATED { dB-6, dB-4dot77, dB-3, dB-1dot77, dB0, dB1, dB2, dB3 } */ - enum db + enum Db { dB_6, dB_4dot77, @@ -411,13 +411,13 @@ class LteRrcSap uint16_t timeToTrigger; /// the report purpose - enum report + enum Report { REPORT_STRONGEST_CELLS, REPORT_CGI }; - report purpose; ///< purpose + Report purpose; ///< purpose /// Trigger type enumeration enum @@ -495,22 +495,22 @@ class LteRrcSap struct MeasGapConfig { /// the action type - enum action + enum Action { SETUP, RESET }; - action type; ///< action type + Action type; ///< action type /// the gap offset - enum gap + enum Gap { GP0, GP1 }; - gap gapOffsetChoice; ///< gap offset + Gap gapOffsetChoice; ///< gap offset uint8_t gapOffsetValue; ///< gap offset value }; @@ -536,13 +536,13 @@ class LteRrcSap struct SpeedStatePars { /// the action type - enum action + enum Action { SETUP, RESET }; - action type; ///< action type + Action type; ///< action type MobilityStateParameters mobilityStateParameters; ///< mobility state parameters SpeedStateScaleFactors timeToTriggerSf; ///< time to trigger scale factors diff --git a/src/mesh/model/dot11s/ie-dot11s-configuration.cc b/src/mesh/model/dot11s/ie-dot11s-configuration.cc index 39d1ea77f..08e5a26e5 100644 --- a/src/mesh/model/dot11s/ie-dot11s-configuration.cc +++ b/src/mesh/model/dot11s/ie-dot11s-configuration.cc @@ -161,13 +161,13 @@ IeConfiguration::DeserializeInformationField(Buffer::Iterator i, uint16_t length { Buffer::Iterator start = i; // Active Path Selection Protocol ID: - m_APSPId = (dot11sPathSelectionProtocol)i.ReadU8(); + m_APSPId = (Dot11sPathSelectionProtocol)i.ReadU8(); // Active Path Metric ID: - m_APSMId = (dot11sPathSelectionMetric)i.ReadU8(); + m_APSMId = (Dot11sPathSelectionMetric)i.ReadU8(); // Congestion Control Mode ID: - m_CCMId = (dot11sCongestionControlMode)i.ReadU8(); - m_SPId = (dot11sSynchronizationProtocolIdentifier)i.ReadU8(); - m_APId = (dot11sAuthenticationProtocol)i.ReadU8(); + m_CCMId = (Dot11sCongestionControlMode)i.ReadU8(); + m_SPId = (Dot11sSynchronizationProtocolIdentifier)i.ReadU8(); + m_APId = (Dot11sAuthenticationProtocol)i.ReadU8(); m_neighbors = (i.ReadU8() >> 1) & 0xF; i = m_meshCap.Deserialize(i); return i.GetDistanceFrom(start); @@ -187,13 +187,13 @@ IeConfiguration::Print(std::ostream& os) const } void -IeConfiguration::SetRouting(dot11sPathSelectionProtocol routingId) +IeConfiguration::SetRouting(Dot11sPathSelectionProtocol routingId) { m_APSPId = routingId; } void -IeConfiguration::SetMetric(dot11sPathSelectionMetric metricId) +IeConfiguration::SetMetric(Dot11sPathSelectionMetric metricId) { m_APSMId = metricId; } diff --git a/src/mesh/model/dot11s/ie-dot11s-configuration.h b/src/mesh/model/dot11s/ie-dot11s-configuration.h index 2a3dd2d57..65047ceaf 100644 --- a/src/mesh/model/dot11s/ie-dot11s-configuration.h +++ b/src/mesh/model/dot11s/ie-dot11s-configuration.h @@ -31,33 +31,33 @@ namespace dot11s // according to IEEE 802.11 - 2012 // in 7.3.2.98.2 Active Path Selection Protocol Identifier - 802.11s-2011 -enum dot11sPathSelectionProtocol +enum Dot11sPathSelectionProtocol { PROTOCOL_HWMP = 0x01, }; // in 7.3.2.98.3 Active Path Selection Metric Identifier - 802.11s-2011 -enum dot11sPathSelectionMetric +enum Dot11sPathSelectionMetric { METRIC_AIRTIME = 0x01, }; // in 7.3.2.98.4 Congestion Control Mode Identifier - 802.11s-2011 -enum dot11sCongestionControlMode +enum Dot11sCongestionControlMode { CONGESTION_SIGNALING = 0x01, CONGESTION_NULL = 0x00, }; // in 7.3.2.98.5 Synchronization Method Identifier - 802.11s-2011 -enum dot11sSynchronizationProtocolIdentifier +enum Dot11sSynchronizationProtocolIdentifier { SYNC_NEIGHBOUR_OFFSET = 0x01, // Neighbor offset synchronization method SYNC_NULL = 0x00, // Reserved }; // in 7.3.2.98.6 Authentication Protocol Identifier - 802.11s-2011 -enum dot11sAuthenticationProtocol +enum Dot11sAuthenticationProtocol { AUTH_NULL = 0x00, // No authentication method is required to establish mesh peerings within the MBSS @@ -134,12 +134,12 @@ class IeConfiguration : public WifiInformationElement * Set routing value * \param routingId the routing ID */ - void SetRouting(dot11sPathSelectionProtocol routingId); + void SetRouting(Dot11sPathSelectionProtocol routingId); /** * Set metric value * \param metricId the path selection metric */ - void SetMetric(dot11sPathSelectionMetric metricId); + void SetMetric(Dot11sPathSelectionMetric metricId); /** * Is HWMP function * \returns true if Active Path Selection Protocol Identifier field set @@ -177,15 +177,15 @@ class IeConfiguration : public WifiInformationElement private: /** Active Path Selection Protocol ID */ - dot11sPathSelectionProtocol m_APSPId; + Dot11sPathSelectionProtocol m_APSPId; /** Active Path Metric ID */ - dot11sPathSelectionMetric m_APSMId; + Dot11sPathSelectionMetric m_APSMId; /** Congestion Control Mode ID */ - dot11sCongestionControlMode m_CCMId; + Dot11sCongestionControlMode m_CCMId; /** Sync protocol ID */ - dot11sSynchronizationProtocolIdentifier m_SPId; + Dot11sSynchronizationProtocolIdentifier m_SPId; /** Auth protocol ID */ - dot11sAuthenticationProtocol m_APId; + Dot11sAuthenticationProtocol m_APId; /** Mesh capability */ Dot11sMeshCapability m_meshCap; uint8_t m_neighbors; ///< neighbors diff --git a/src/netanim/examples/colors-link-description.cc b/src/netanim/examples/colors-link-description.cc index e07018771..431813f83 100644 --- a/src/netanim/examples/colors-link-description.cc +++ b/src/netanim/examples/colors-link-description.cc @@ -30,14 +30,14 @@ using namespace ns3; AnimationInterface* pAnim = nullptr; /// RGB structure -struct rgb +struct Rgb { uint8_t r; ///< red uint8_t g; ///< green uint8_t b; ///< blue }; -rgb colors[] = { +Rgb colors[] = { {255, 0, 0}, // Red {0, 255, 0}, // Blue {0, 0, 255}, // Green @@ -72,7 +72,7 @@ modify() { index = 0; } - rgb color = colors[index]; + Rgb color = colors[index]; for (uint32_t nodeId = 4; nodeId < 12; ++nodeId) { pAnim->UpdateNodeColor(nodeId, color.r, color.g, color.b); diff --git a/src/netanim/examples/resources-counters.cc b/src/netanim/examples/resources-counters.cc index 02c7a8cf9..8d0224a68 100644 --- a/src/netanim/examples/resources-counters.cc +++ b/src/netanim/examples/resources-counters.cc @@ -30,14 +30,14 @@ using namespace ns3; AnimationInterface* pAnim = nullptr; /// RGB struture -struct rgb +struct Rgb { uint8_t r; ///< red uint8_t g; ///< green uint8_t b; ///< blue }; -rgb colors[] = { +Rgb colors[] = { {255, 0, 0}, // Red {0, 255, 0}, // Blue {0, 0, 255}, // Green @@ -96,7 +96,7 @@ modify() { index = 0; } - rgb color = colors[index]; + Rgb color = colors[index]; for (uint32_t nodeId = 4; nodeId < 12; ++nodeId) { pAnim->UpdateNodeColor(nodeId, color.r, color.g, color.b); diff --git a/src/traffic-control/test/queue-disc-traces-test-suite.cc b/src/traffic-control/test/queue-disc-traces-test-suite.cc index b79e77eff..b1018e8cb 100644 --- a/src/traffic-control/test/queue-disc-traces-test-suite.cc +++ b/src/traffic-control/test/queue-disc-traces-test-suite.cc @@ -34,7 +34,7 @@ using namespace ns3; * * \brief Queue Disc Test Item */ -class qdTestItem : public QueueDiscItem +class QdTestItem : public QueueDiscItem { public: /** @@ -43,28 +43,28 @@ class qdTestItem : public QueueDiscItem * \param p the packet * \param addr the address */ - qdTestItem(Ptr p, const Address& addr); - ~qdTestItem() override; + QdTestItem(Ptr p, const Address& addr); + ~QdTestItem() override; void AddHeader() override; bool Mark() override; }; -qdTestItem::qdTestItem(Ptr p, const Address& addr) +QdTestItem::QdTestItem(Ptr p, const Address& addr) : QueueDiscItem(p, addr, 0) { } -qdTestItem::~qdTestItem() +QdTestItem::~QdTestItem() { } void -qdTestItem::AddHeader() +QdTestItem::AddHeader() { } bool -qdTestItem::Mark() +QdTestItem::Mark() { return false; } @@ -450,7 +450,7 @@ QueueDiscTracesTestCase::DoRun() // Enqueue 4 packets. They must all be enqueued for (uint16_t i = 1; i <= 4; i++) { - root->Enqueue(Create(Create(pktSizeUnit * i), dest)); + root->Enqueue(Create(Create(pktSizeUnit * i), dest)); CheckQueued(root, i, pktSizeUnit * i * (i + 1) / 2); CheckDroppedBeforeEnqueue(root, 0, 0); @@ -463,7 +463,7 @@ QueueDiscTracesTestCase::DoRun() // The fifth packet is dropped before enqueue by the child queue disc. // The packet drop is notified to the root queue disc. - root->Enqueue(Create(Create(pktSizeUnit * 5), dest)); + root->Enqueue(Create(Create(pktSizeUnit * 5), dest)); CheckQueued(root, 4, pktSizeUnit * 10); CheckDroppedBeforeEnqueue(root, 1, pktSizeUnit * 5); @@ -559,7 +559,7 @@ QueueDiscTracesTestCase::DoRun() CheckDroppedAfterDequeue(child, 2, pktSizeUnit * 3); // Enqueue one packet. - root->Enqueue(Create(Create(pktSizeUnit), dest)); + root->Enqueue(Create(Create(pktSizeUnit), dest)); CheckQueued(root, 1, pktSizeUnit); CheckDroppedBeforeEnqueue(root, 1, pktSizeUnit * 5); diff --git a/src/wimax/model/bvec.h b/src/wimax/model/bvec.h index 8caf6cf73..0be692aae 100644 --- a/src/wimax/model/bvec.h +++ b/src/wimax/model/bvec.h @@ -26,7 +26,7 @@ namespace ns3 { /// boolean vector typedef -typedef std::vector bvec; +typedef std::vector Bvec; } // namespace ns3 #endif /* BVEC_H */ diff --git a/src/wimax/model/ipcs-classifier-record.cc b/src/wimax/model/ipcs-classifier-record.cc index 4c1d540a3..c57883f9b 100644 --- a/src/wimax/model/ipcs-classifier-record.cc +++ b/src/wimax/model/ipcs-classifier-record.cc @@ -85,7 +85,7 @@ IpcsClassifierRecord::IpcsClassifierRecord(Tlv tlv) } case ClassificationRuleVectorTlvValue::IP_src: { Ipv4AddressTlvValue* list = (Ipv4AddressTlvValue*)(*iter)->PeekValue(); - for (std::vector::const_iterator iter2 = list->Begin(); + for (std::vector::const_iterator iter2 = list->Begin(); iter2 != list->End(); ++iter2) { @@ -95,7 +95,7 @@ IpcsClassifierRecord::IpcsClassifierRecord(Tlv tlv) } case ClassificationRuleVectorTlvValue::IP_dst: { Ipv4AddressTlvValue* list = (Ipv4AddressTlvValue*)(*iter)->PeekValue(); - for (std::vector::const_iterator iter2 = list->Begin(); + for (std::vector::const_iterator iter2 = list->Begin(); iter2 != list->End(); ++iter2) { @@ -158,7 +158,7 @@ IpcsClassifierRecord::IpcsClassifierRecord(Ipv4Address SrcAddress, void IpcsClassifierRecord::AddSrcAddr(Ipv4Address srcAddress, Ipv4Mask srcMask) { - ipv4Addr tmp; + Ipv4Addr tmp; tmp.Address = srcAddress; tmp.Mask = srcMask; m_srcAddr.push_back(tmp); @@ -167,7 +167,7 @@ IpcsClassifierRecord::AddSrcAddr(Ipv4Address srcAddress, Ipv4Mask srcMask) void IpcsClassifierRecord::AddDstAddr(Ipv4Address dstAddress, Ipv4Mask dstMask) { - ipv4Addr tmp; + Ipv4Addr tmp; tmp.Address = dstAddress; tmp.Mask = dstMask; m_dstAddr.push_back(tmp); @@ -236,7 +236,7 @@ IpcsClassifierRecord::GetPriority() const bool IpcsClassifierRecord::CheckMatchSrcAddr(Ipv4Address srcAddress) const { - for (std::vector::const_iterator iter = m_srcAddr.begin(); iter != m_srcAddr.end(); + for (std::vector::const_iterator iter = m_srcAddr.begin(); iter != m_srcAddr.end(); ++iter) { NS_LOG_INFO("src addr check match: pkt=" << srcAddress << " cls=" << (*iter).Address << "/" @@ -253,7 +253,7 @@ IpcsClassifierRecord::CheckMatchSrcAddr(Ipv4Address srcAddress) const bool IpcsClassifierRecord::CheckMatchDstAddr(Ipv4Address dstAddress) const { - for (std::vector::const_iterator iter = m_dstAddr.begin(); iter != m_dstAddr.end(); + for (std::vector::const_iterator iter = m_dstAddr.begin(); iter != m_dstAddr.end(); ++iter) { NS_LOG_INFO("dst addr check match: pkt=" << dstAddress << " cls=" << (*iter).Address << "/" @@ -334,14 +334,14 @@ Tlv IpcsClassifierRecord::ToTlv() const { Ipv4AddressTlvValue ipv4AddrValSrc; - for (std::vector::const_iterator iter = m_srcAddr.begin(); iter != m_srcAddr.end(); + for (std::vector::const_iterator iter = m_srcAddr.begin(); iter != m_srcAddr.end(); ++iter) { ipv4AddrValSrc.Add((*iter).Address, (*iter).Mask); } Ipv4AddressTlvValue ipv4AddrValDst; - for (std::vector::const_iterator iter = m_dstAddr.begin(); iter != m_dstAddr.end(); + for (std::vector::const_iterator iter = m_dstAddr.begin(); iter != m_dstAddr.end(); ++iter) { ipv4AddrValDst.Add((*iter).Address, (*iter).Mask); diff --git a/src/wimax/model/ipcs-classifier-record.h b/src/wimax/model/ipcs-classifier-record.h index 9f44d49bc..8e17de4cf 100644 --- a/src/wimax/model/ipcs-classifier-record.h +++ b/src/wimax/model/ipcs-classifier-record.h @@ -183,8 +183,8 @@ class IpcsClassifierRecord uint16_t PortHigh; ///< port high }; - /// ipv4Addr structure - struct ipv4Addr + /// Ipv4Addr structure + struct Ipv4Addr { Ipv4Address Address; ///< IP address Ipv4Mask Mask; ///< net mask @@ -196,8 +196,8 @@ class IpcsClassifierRecord uint8_t m_tosHigh; ///< TOS high uint8_t m_tosMask; ///< TOS mask std::vector m_protocol; ///< protocol - std::vector m_srcAddr; ///< source address - std::vector m_dstAddr; ///< destination address + std::vector m_srcAddr; ///< source address + std::vector m_dstAddr; ///< destination address std::vector m_srcPortRange; ///< source port range std::vector m_dstPortRange; ///< destination port range diff --git a/src/wimax/model/mac-messages.h b/src/wimax/model/mac-messages.h index 29c59ed22..21dfee8f1 100644 --- a/src/wimax/model/mac-messages.h +++ b/src/wimax/model/mac-messages.h @@ -376,8 +376,6 @@ class RngRsp : public Header namespace ns3 { -class serviceFlow; - /** * \ingroup wimax * This class implements the DSA-REQ message described by "IEEE Standard for diff --git a/src/wimax/model/simple-ofdm-send-param.cc b/src/wimax/model/simple-ofdm-send-param.cc index da7e19d2a..0d6060a19 100644 --- a/src/wimax/model/simple-ofdm-send-param.cc +++ b/src/wimax/model/simple-ofdm-send-param.cc @@ -25,7 +25,7 @@ namespace ns3 { -simpleOfdmSendParam::simpleOfdmSendParam() +SimpleOfdmSendParam::SimpleOfdmSendParam() { // m_fecBlock = 0; m_burstSize = 0; @@ -36,7 +36,7 @@ simpleOfdmSendParam::simpleOfdmSendParam() m_rxPowerDbm = 0; } -simpleOfdmSendParam::simpleOfdmSendParam(const bvec& fecBlock, +SimpleOfdmSendParam::SimpleOfdmSendParam(const Bvec& fecBlock, uint32_t burstSize, bool isFirstBlock, uint64_t Frequency, @@ -53,7 +53,7 @@ simpleOfdmSendParam::simpleOfdmSendParam(const bvec& fecBlock, m_rxPowerDbm = rxPowerDbm; } -simpleOfdmSendParam::simpleOfdmSendParam(uint32_t burstSize, +SimpleOfdmSendParam::SimpleOfdmSendParam(uint32_t burstSize, bool isFirstBlock, uint64_t Frequency, WimaxPhy::ModulationType modulationType, @@ -70,96 +70,96 @@ simpleOfdmSendParam::simpleOfdmSendParam(uint32_t burstSize, m_burst = burst; } -simpleOfdmSendParam::~simpleOfdmSendParam() +SimpleOfdmSendParam::~SimpleOfdmSendParam() { } void -simpleOfdmSendParam::SetFecBlock(const bvec& fecBlock) +SimpleOfdmSendParam::SetFecBlock(const Bvec& fecBlock) { m_fecBlock = fecBlock; } void -simpleOfdmSendParam::SetBurstSize(uint32_t burstSize) +SimpleOfdmSendParam::SetBurstSize(uint32_t burstSize) { m_burstSize = burstSize; } void -simpleOfdmSendParam::SetIsFirstBlock(bool isFirstBlock) +SimpleOfdmSendParam::SetIsFirstBlock(bool isFirstBlock) { m_isFirstBlock = isFirstBlock; } void -simpleOfdmSendParam::SetFrequency(uint64_t Frequency) +SimpleOfdmSendParam::SetFrequency(uint64_t Frequency) { m_frequency = Frequency; } void -simpleOfdmSendParam::SetModulationType(WimaxPhy::ModulationType modulationType) +SimpleOfdmSendParam::SetModulationType(WimaxPhy::ModulationType modulationType) { m_modulationType = modulationType; } void -simpleOfdmSendParam::SetDirection(uint8_t direction) +SimpleOfdmSendParam::SetDirection(uint8_t direction) { m_direction = direction; } void -simpleOfdmSendParam::SetRxPowerDbm(double rxPowerDbm) +SimpleOfdmSendParam::SetRxPowerDbm(double rxPowerDbm) { m_rxPowerDbm = rxPowerDbm; } -bvec -simpleOfdmSendParam::GetFecBlock() +Bvec +SimpleOfdmSendParam::GetFecBlock() { return m_fecBlock; } uint32_t -simpleOfdmSendParam::GetBurstSize() +SimpleOfdmSendParam::GetBurstSize() { return m_burstSize; } bool -simpleOfdmSendParam::GetIsFirstBlock() +SimpleOfdmSendParam::GetIsFirstBlock() { return m_isFirstBlock; } uint64_t -simpleOfdmSendParam::GetFrequency() +SimpleOfdmSendParam::GetFrequency() { return m_frequency; } WimaxPhy::ModulationType -simpleOfdmSendParam::GetModulationType() +SimpleOfdmSendParam::GetModulationType() { return m_modulationType; } uint8_t -simpleOfdmSendParam::GetDirection() +SimpleOfdmSendParam::GetDirection() { return m_direction; } double -simpleOfdmSendParam::GetRxPowerDbm() +SimpleOfdmSendParam::GetRxPowerDbm() { return m_rxPowerDbm; } Ptr -simpleOfdmSendParam::GetBurst() +SimpleOfdmSendParam::GetBurst() { return m_burst; } diff --git a/src/wimax/model/simple-ofdm-send-param.h b/src/wimax/model/simple-ofdm-send-param.h index 93c8e1253..9ae8618c2 100644 --- a/src/wimax/model/simple-ofdm-send-param.h +++ b/src/wimax/model/simple-ofdm-send-param.h @@ -34,12 +34,12 @@ namespace ns3 /** * \ingroup wimax - * simpleOfdmSendParam class + * SimpleOfdmSendParam class */ -class simpleOfdmSendParam +class SimpleOfdmSendParam { public: - simpleOfdmSendParam(); + SimpleOfdmSendParam(); /** * Constructor * @@ -51,7 +51,7 @@ class simpleOfdmSendParam * \param direction the direction * \param rxPowerDbm receive power */ - simpleOfdmSendParam(const bvec& fecBlock, + SimpleOfdmSendParam(const Bvec& fecBlock, uint32_t burstSize, bool isFirstBlock, uint64_t Frequency, @@ -69,19 +69,19 @@ class simpleOfdmSendParam * \param rxPowerDbm receive power * \param burst packet burst object */ - simpleOfdmSendParam(uint32_t burstSize, + SimpleOfdmSendParam(uint32_t burstSize, bool isFirstBlock, uint64_t Frequency, WimaxPhy::ModulationType modulationType, uint8_t direction, double rxPowerDbm, Ptr burst); - ~simpleOfdmSendParam(); + ~SimpleOfdmSendParam(); /** * \brief sent the fec block to send * \param fecBlock the fec block to send */ - void SetFecBlock(const bvec& fecBlock); + void SetFecBlock(const Bvec& fecBlock); /** * \brief set the burst size * \param burstSize the burst size in bytes @@ -111,7 +111,7 @@ class simpleOfdmSendParam /** * \return the fec block */ - bvec GetFecBlock(); + Bvec GetFecBlock(); /** * \return the burst size */ @@ -142,7 +142,7 @@ class simpleOfdmSendParam Ptr GetBurst(); private: - bvec m_fecBlock; ///< FEC block + Bvec m_fecBlock; ///< FEC block uint32_t m_burstSize; ///< burst size bool m_isFirstBlock; ///< is first block uint64_t m_frequency; ///< frequency diff --git a/src/wimax/model/simple-ofdm-wimax-channel.cc b/src/wimax/model/simple-ofdm-wimax-channel.cc index bf00070ff..c5cc0405f 100644 --- a/src/wimax/model/simple-ofdm-wimax-channel.cc +++ b/src/wimax/model/simple-ofdm-wimax-channel.cc @@ -159,7 +159,7 @@ SimpleOfdmWimaxChannel::Send(Time BlockTime, Ptr senderMobility = nullptr; Ptr receiverMobility = nullptr; senderMobility = phy->GetDevice()->GetNode()->GetObject(); - simpleOfdmSendParam* param; + SimpleOfdmSendParam* param; for (std::list>::iterator iter = m_phyList.begin(); iter != m_phyList.end(); ++iter) @@ -176,7 +176,7 @@ SimpleOfdmWimaxChannel::Send(Time BlockTime, rxPowerDbm = m_loss->CalcRxPower(txPowerDbm, senderMobility, receiverMobility); } - param = new simpleOfdmSendParam(burstSize, + param = new SimpleOfdmSendParam(burstSize, isFirstBlock, frequency, modulationType, @@ -204,7 +204,7 @@ SimpleOfdmWimaxChannel::Send(Time BlockTime, } void -SimpleOfdmWimaxChannel::EndSendDummyBlock(Ptr rxphy, simpleOfdmSendParam* param) +SimpleOfdmWimaxChannel::EndSendDummyBlock(Ptr rxphy, SimpleOfdmSendParam* param) { rxphy->StartReceive(param->GetBurstSize(), param->GetIsFirstBlock(), diff --git a/src/wimax/model/simple-ofdm-wimax-channel.h b/src/wimax/model/simple-ofdm-wimax-channel.h index 56347cab5..ab9c7e3f7 100644 --- a/src/wimax/model/simple-ofdm-wimax-channel.h +++ b/src/wimax/model/simple-ofdm-wimax-channel.h @@ -122,9 +122,9 @@ class SimpleOfdmWimaxChannel : public WimaxChannel /** * End send dummy block function * \param rxphy the Ptr - * \param param the simpleOfdmSendParam * + * \param param the SimpleOfdmSendParam * */ - void EndSendDummyBlock(Ptr rxphy, simpleOfdmSendParam* param); + void EndSendDummyBlock(Ptr rxphy, SimpleOfdmSendParam* param); /** * Get device function * \param i the device index diff --git a/src/wimax/model/simple-ofdm-wimax-phy.cc b/src/wimax/model/simple-ofdm-wimax-phy.cc index 1678f7d69..ad78fa200 100644 --- a/src/wimax/model/simple-ofdm-wimax-phy.cc +++ b/src/wimax/model/simple-ofdm-wimax-phy.cc @@ -173,8 +173,8 @@ SimpleOfdmWimaxPhy::InitSimpleOfdmWimaxPhy() m_nfft = 256; m_g = 1.0 / 4; SetNrCarriers(192); - m_fecBlocks = new std::list; - m_receivedFecBlocks = new std::list; + m_fecBlocks = new std::list; + m_receivedFecBlocks = new std::list; m_currentBurstSize = 0; m_noiseFigure = 5; // dB m_txPower = 30; // dBm @@ -500,10 +500,10 @@ SimpleOfdmWimaxPhy::EndReceive(Ptr burst) m_traceRx(burst); } -bvec +Bvec SimpleOfdmWimaxPhy::ConvertBurstToBits(Ptr burst) { - bvec buffer(burst->GetSize() * 8, 0); + Bvec buffer(burst->GetSize() * 8, 0); std::list> packets = burst->GetPackets(); @@ -514,7 +514,7 @@ SimpleOfdmWimaxPhy::ConvertBurstToBits(Ptr burst) uint8_t* pstart = (uint8_t*)std::malloc(packet->GetSize()); std::memset(pstart, 0, packet->GetSize()); packet->CopyData(pstart, packet->GetSize()); - bvec temp(8); + Bvec temp(8); temp.resize(0, 0); temp.resize(8, 0); for (uint32_t i = 0; i < packet->GetSize(); i++) @@ -533,21 +533,21 @@ SimpleOfdmWimaxPhy::ConvertBurstToBits(Ptr burst) } /* - Converts back the bit buffer (bvec) to the actual burst. - Actually creates byte buffer from the bvec and resets the buffer - of each packet in the copy of the orifinal burst stored before transmitting. + Converts back the bit buffer (Bvec) to the actual burst. + Actually creates byte buffer from the Bvec and resets the buffer + of each packet in the copy of the original burst stored before transmitting. By doing this it preserves the metadata and tags in the packet. Function could also be named DeserializeBurst because actually it copying to the burst's byte buffer. */ Ptr -SimpleOfdmWimaxPhy::ConvertBitsToBurst(bvec buffer) +SimpleOfdmWimaxPhy::ConvertBitsToBurst(Bvec buffer) { uint8_t init[buffer.size() / 8]; uint8_t* pstart = init; uint8_t temp; int32_t j = 0; - // recreating byte buffer from bit buffer (bvec) + // recreating byte buffer from bit buffer (Bvec) for (uint32_t i = 0; i < buffer.size(); i += 8) { temp = 0; @@ -592,34 +592,34 @@ SimpleOfdmWimaxPhy::ConvertBitsToBurst(bvec buffer) } void -SimpleOfdmWimaxPhy::CreateFecBlocks(const bvec& buffer, WimaxPhy::ModulationType modulationType) +SimpleOfdmWimaxPhy::CreateFecBlocks(const Bvec& buffer, WimaxPhy::ModulationType modulationType) { - bvec fecBlock(m_blockSize); + Bvec fecBlock(m_blockSize); for (uint32_t i = 0, j = m_nrBlocks; j > 0; i += m_blockSize, j--) { if (j == 1 && m_paddingBits > 0) // last block can be smaller than block size { - fecBlock = bvec(buffer.begin() + i, buffer.end()); + fecBlock = Bvec(buffer.begin() + i, buffer.end()); fecBlock.resize(m_blockSize, 0); } else { - fecBlock = bvec(buffer.begin() + i, buffer.begin() + i + m_blockSize); + fecBlock = Bvec(buffer.begin() + i, buffer.begin() + i + m_blockSize); } m_fecBlocks->push_back(fecBlock); } } -bvec +Bvec SimpleOfdmWimaxPhy::RecreateBuffer() { - bvec buffer(m_blockSize * (unsigned long)m_nrBlocks); - bvec block(m_blockSize); + Bvec buffer(m_blockSize * (unsigned long)m_nrBlocks); + Bvec block(m_blockSize); uint32_t i = 0; for (uint32_t j = 0; j < m_nrBlocks; j++) { - bvec tmpRecFecBloc = m_receivedFecBlocks->front(); + Bvec tmpRecFecBloc = m_receivedFecBlocks->front(); buffer.insert(buffer.begin() + i, tmpRecFecBloc.begin(), tmpRecFecBloc.end()); m_receivedFecBlocks->pop_front(); i += m_blockSize; diff --git a/src/wimax/model/simple-ofdm-wimax-phy.h b/src/wimax/model/simple-ofdm-wimax-phy.h index e1dffd6cb..3aba1dcca 100644 --- a/src/wimax/model/simple-ofdm-wimax-phy.h +++ b/src/wimax/model/simple-ofdm-wimax-phy.h @@ -241,24 +241,24 @@ class SimpleOfdmWimaxPhy : public WimaxPhy * \param burst the packet burst * \returns the BVEC */ - bvec ConvertBurstToBits(Ptr burst); + Bvec ConvertBurstToBits(Ptr burst); /** * Convert bits to burst * \param buffer the BVEC * \returns the packet burst */ - Ptr ConvertBitsToBurst(bvec buffer); + Ptr ConvertBitsToBurst(Bvec buffer); /** * Create FEC blocks * \param buffer the BVEC * \param modulationType the modulation type */ - void CreateFecBlocks(const bvec& buffer, WimaxPhy::ModulationType modulationType); + void CreateFecBlocks(const Bvec& buffer, WimaxPhy::ModulationType modulationType); /** * Recreate buffer * \returns BVEC */ - bvec RecreateBuffer(); + Bvec RecreateBuffer(); /** * Get FEC block size * \param type the modulation type @@ -442,10 +442,10 @@ class SimpleOfdmWimaxPhy : public WimaxPhy uint16_t m_fecBlockSize; ///< in bits, size of FEC block transmitted after PHY operations uint32_t m_currentBurstSize; ///< current burst size - std::list* m_receivedFecBlocks; ///< a list of received FEC blocks until they are combined + std::list* m_receivedFecBlocks; ///< a list of received FEC blocks until they are combined ///< to recreate the full burst buffer uint32_t m_nrFecBlocksSent; ///< counting the number of FEC blocks sent (within a burst) - std::list* m_fecBlocks; ///< the FEC blocks + std::list* m_fecBlocks; ///< the FEC blocks Time m_blockTime; ///< block time TracedCallback> m_traceRx; ///< trace receive callback diff --git a/src/wimax/model/wimax-tlv.cc b/src/wimax/model/wimax-tlv.cc index ac7bc2be5..aae0b3f4e 100644 --- a/src/wimax/model/wimax-tlv.cc +++ b/src/wimax/model/wimax-tlv.cc @@ -1024,7 +1024,7 @@ ProtocolTlvValue::Copy() const Ipv4AddressTlvValue::Ipv4AddressTlvValue() { - m_ipv4Addr = new std::vector; + m_ipv4Addr = new std::vector; } Ipv4AddressTlvValue::~Ipv4AddressTlvValue() @@ -1046,7 +1046,7 @@ Ipv4AddressTlvValue::GetSerializedSize() const void Ipv4AddressTlvValue::Serialize(Buffer::Iterator i) const { - for (std::vector::const_iterator iter = m_ipv4Addr->begin(); + for (std::vector::const_iterator iter = m_ipv4Addr->begin(); iter != m_ipv4Addr->end(); ++iter) { @@ -1070,12 +1070,9 @@ Ipv4AddressTlvValue::Deserialize(Buffer::Iterator i, uint64_t valueLength) } void -Ipv4AddressTlvValue::Add(Ipv4Address address, Ipv4Mask Mask) +Ipv4AddressTlvValue::Add(Ipv4Address address, Ipv4Mask mask) { - ipv4Addr tmp; - tmp.Address = address; - tmp.Mask = Mask; - m_ipv4Addr->push_back(tmp); + m_ipv4Addr->push_back({address, mask}); } Ipv4AddressTlvValue::Iterator @@ -1094,7 +1091,7 @@ Ipv4AddressTlvValue* Ipv4AddressTlvValue::Copy() const { Ipv4AddressTlvValue* tmp = new Ipv4AddressTlvValue(); - for (std::vector::const_iterator iter = m_ipv4Addr->begin(); + for (std::vector::const_iterator iter = m_ipv4Addr->begin(); iter != m_ipv4Addr->end(); ++iter) { diff --git a/src/wimax/model/wimax-tlv.h b/src/wimax/model/wimax-tlv.h index aca060e24..efcc288ab 100644 --- a/src/wimax/model/wimax-tlv.h +++ b/src/wimax/model/wimax-tlv.h @@ -571,15 +571,15 @@ class ProtocolTlvValue : public TlvValue class Ipv4AddressTlvValue : public TlvValue { public: - /// ipv4Addr structure - struct ipv4Addr + /// Ipv4Addr structure + struct Ipv4Addr { Ipv4Address Address; ///< address Ipv4Mask Mask; ///< mask }; /// IPv4 address vector iterator typedef - typedef std::vector::const_iterator Iterator; + typedef std::vector::const_iterator Iterator; Ipv4AddressTlvValue(); ~Ipv4AddressTlvValue() override; uint32_t GetSerializedSize() const override; @@ -588,9 +588,9 @@ class Ipv4AddressTlvValue : public TlvValue /** * Add IPv4 address and mask * \param address the IPv4 address - * \param Mask the IPv4 mask + * \param mask the IPv4 mask */ - void Add(Ipv4Address address, Ipv4Mask Mask); + void Add(Ipv4Address address, Ipv4Mask mask); /** * Begin iterator * \returns the beginning element @@ -604,7 +604,7 @@ class Ipv4AddressTlvValue : public TlvValue Ipv4AddressTlvValue* Copy() const override; private: - std::vector* m_ipv4Addr; ///< ipv4 addr + std::vector* m_ipv4Addr; ///< ipv4 addr }; } // namespace ns3