diff --git a/src/core/model/ptr.h b/src/core/model/ptr.h index 36ed7a5cc..fdb75e990 100644 --- a/src/core/model/ptr.h +++ b/src/core/model/ptr.h @@ -80,9 +80,9 @@ private: /** Helper to test for null pointer. */ class Tester { - private: - /** Disable delete (by virtue that this is unimplemented). */ - void operator delete (void *); + public: + // Delete operator delete to avoid misuse + void operator delete (void *) = delete; }; /** Interoperate with const instances. */ diff --git a/src/dsr/helper/dsr-helper.h b/src/dsr/helper/dsr-helper.h index 85b6d0796..ee2636d51 100644 --- a/src/dsr/helper/dsr-helper.h +++ b/src/dsr/helper/dsr-helper.h @@ -58,6 +58,10 @@ public: */ DsrHelper (); ~DsrHelper (); + + // Delete assignment operator to avoid misuse + DsrHelper &operator= (const DsrHelper &) = delete; + /** * \brief Construct an DsrHelper from another previously initialized instance * (Copy Constructor). @@ -83,13 +87,6 @@ public: */ void Set (std::string name, const AttributeValue &value); private: - /** - * \brief Assignment operator declared private and not implemented to disallow - * assignment and prevent the compiler from happily inserting its own. - * \param o source object - * \return DsrHelper object - */ - DsrHelper & operator = (const DsrHelper &o); ObjectFactory m_agentFactory; ///< DSR factory }; diff --git a/src/mesh/model/dot11s/hwmp-protocol.h b/src/mesh/model/dot11s/hwmp-protocol.h index 002e2fdd7..ec2068c20 100644 --- a/src/mesh/model/dot11s/hwmp-protocol.h +++ b/src/mesh/model/dot11s/hwmp-protocol.h @@ -68,8 +68,14 @@ public: * \return the object TypeId */ static TypeId GetTypeId (); + HwmpProtocol (); ~HwmpProtocol (); + + // Delete copy constructor and assignment operator to avoid misuse + HwmpProtocol (const HwmpProtocol &) = delete; + HwmpProtocol &operator= (const HwmpProtocol &) = delete; + void DoDispose (); /** @@ -171,18 +177,6 @@ private: virtual void DoInitialize (); - /** - * assignment operator - * \param hwmp the HWMP protocol to assign - * \returns the assigned value - */ - HwmpProtocol& operator= (const HwmpProtocol & hwmp); - /** - * Copy constructor - defined but not implemented (on purpose) - * \param hwmp the HWMP protocol - */ - HwmpProtocol (const HwmpProtocol & hwmp); - /** * \brief Structure of path error: IePerr and list of receivers: * interfaces and MAC address diff --git a/src/mesh/model/dot11s/peer-link-frame.h b/src/mesh/model/dot11s/peer-link-frame.h index 332884572..cc4ee84b2 100644 --- a/src/mesh/model/dot11s/peer-link-frame.h +++ b/src/mesh/model/dot11s/peer-link-frame.h @@ -45,6 +45,11 @@ class PeerLinkOpenStart : public Header { public: PeerLinkOpenStart (); + + // Delete copy constructor and assignment operator to avoid misuse + PeerLinkOpenStart (const PeerLinkOpenStart &) = delete; + PeerLinkOpenStart &operator= (const PeerLinkOpenStart &) = delete; + ///\brief fields: struct PlinkOpenStartFields { @@ -91,19 +96,6 @@ private: * \returns true if equal */ friend bool operator== (const PeerLinkOpenStart & a, const PeerLinkOpenStart & b); - - /** - * assignment operator - * \param peer the peer link open start - * \returns the assigned value - */ - PeerLinkOpenStart& operator= (const PeerLinkOpenStart & peer); - /** - * constructor - * \param peer the peer link open start - */ - PeerLinkOpenStart (const PeerLinkOpenStart & peer); - }; bool operator== (const PeerLinkOpenStart & a, const PeerLinkOpenStart & b); @@ -120,6 +112,11 @@ class PeerLinkCloseStart : public Header { public: PeerLinkCloseStart (); + + // Delete copy constructor and assignment operator to avoid misuse + PeerLinkCloseStart (const PeerLinkCloseStart &) = delete; + PeerLinkCloseStart &operator= (const PeerLinkCloseStart &) = delete; + ///\brief fields: struct PlinkCloseStartFields { @@ -160,17 +157,6 @@ private: * \returns true if equal */ friend bool operator== (const PeerLinkCloseStart & a, const PeerLinkCloseStart & b); - - /** - * assignment operator - * - * \param peer the value to assign - * \returns the assigned value - */ - PeerLinkCloseStart& operator= (const PeerLinkCloseStart & peer); - /// type conversion operator - PeerLinkCloseStart (const PeerLinkCloseStart &); - }; bool operator== (const PeerLinkCloseStart & a, const PeerLinkCloseStart & b); @@ -188,6 +174,11 @@ class PeerLinkConfirmStart : public Header { public: PeerLinkConfirmStart (); + + // Delete copy constructor and assignment operator to avoid misuse + PeerLinkConfirmStart (const PeerLinkConfirmStart &) = delete; + PeerLinkConfirmStart &operator= (const PeerLinkConfirmStart &) = delete; + ///\brief fields: struct PlinkConfirmStartFields { @@ -234,19 +225,6 @@ private: * \returns true if equal */ friend bool operator== (const PeerLinkConfirmStart & a, const PeerLinkConfirmStart & b); - - /** - * assignment operator - * \param peer the peer link confirm start - * \returns the assigned value - */ - PeerLinkConfirmStart& operator= (const PeerLinkConfirmStart & peer); - /** - * constructor - * \param peer the peer link confirm start - */ - PeerLinkConfirmStart (const PeerLinkConfirmStart & peer); - }; bool operator== (const PeerLinkConfirmStart & a, const PeerLinkConfirmStart & b); } // namespace dot11s diff --git a/src/mesh/model/dot11s/peer-link.h b/src/mesh/model/dot11s/peer-link.h index 6ad034e45..f09e0a4fe 100644 --- a/src/mesh/model/dot11s/peer-link.h +++ b/src/mesh/model/dot11s/peer-link.h @@ -53,6 +53,11 @@ public: /// C-tor create empty link PeerLink (); ~PeerLink (); + + // Delete copy constructor and assignment operator to avoid misuse + PeerLink (const PeerLink &) = delete; + PeerLink &operator= (const PeerLink &) = delete; + void DoDispose (); /// Peer Link state: enum PeerState { @@ -327,19 +332,6 @@ private: /// Several successive beacons were lost, close link void BeaconLoss (); private: - - /** - * assignment operator - * \param link the peer link - * \returns the peer link assigned - */ - PeerLink& operator= (const PeerLink & link); - /** - * Copy constructor. Intentionally unimplemented - * \param o object to copy - */ - PeerLink (const PeerLink & o); - /// The number of interface I am associated with uint32_t m_interface; /// pointer to MAC plugin, which is responsible for peer management diff --git a/src/mesh/model/dot11s/peer-management-protocol.h b/src/mesh/model/dot11s/peer-management-protocol.h index 2e259114d..bb9bc8e0f 100644 --- a/src/mesh/model/dot11s/peer-management-protocol.h +++ b/src/mesh/model/dot11s/peer-management-protocol.h @@ -51,6 +51,11 @@ class PeerManagementProtocol : public Object public: PeerManagementProtocol (); ~PeerManagementProtocol (); + + // Delete copy constructor and assignment operator to avoid misuse + PeerManagementProtocol (const PeerManagementProtocol &) = delete; + PeerManagementProtocol &operator= (const PeerManagementProtocol &) = delete; + /** * \brief Get the type ID. * \return the object TypeId @@ -254,17 +259,6 @@ private: ///\brief this vector keeps pointers to MAC-plugins typedef std::map > PeerManagementProtocolMacMap; -private: - /** - * assignment operator - * - * \param peer the value to assign - * \returns the assigned value - */ - PeerManagementProtocol& operator= (const PeerManagementProtocol & peer); - /// type conversion operator - PeerManagementProtocol (const PeerManagementProtocol &); - /** * Initiate link function * diff --git a/src/mesh/model/flame/flame-protocol.h b/src/mesh/model/flame/flame-protocol.h index 332ecfb1b..666472152 100644 --- a/src/mesh/model/flame/flame-protocol.h +++ b/src/mesh/model/flame/flame-protocol.h @@ -93,8 +93,14 @@ public: * \return the object TypeId */ static TypeId GetTypeId (); + FlameProtocol (); ~FlameProtocol (); + + // Delete copy constructor and assignment operator to avoid misuse + FlameProtocol (const FlameProtocol &) = delete; + FlameProtocol &operator= (const FlameProtocol &) = delete; + void DoDispose (); /** @@ -146,16 +152,6 @@ public: /// Reset statistics function void ResetStats (); private: - /** - * assignment operator - * - * \param flame the object to assign - * \returns the assigned value - */ - FlameProtocol& operator= (const FlameProtocol & flame); - /// type conversion operator - FlameProtocol (const FlameProtocol &); - /// LLC protocol number reserved by flame static const uint16_t FLAME_PROTOCOL = 0x4040; /** diff --git a/src/mesh/model/flame/flame-rtable.h b/src/mesh/model/flame/flame-rtable.h index b66058608..d3b97fb31 100644 --- a/src/mesh/model/flame/flame-rtable.h +++ b/src/mesh/model/flame/flame-rtable.h @@ -84,8 +84,14 @@ public: * \return the object TypeId */ static TypeId GetTypeId (); + FlameRtable (); ~FlameRtable (); + + // Delete copy constructor and assignment operator to avoid misuse + FlameRtable (const FlameRtable &) = delete; + FlameRtable &operator= (const FlameRtable &) = delete; + void DoDispose (); /** @@ -111,16 +117,6 @@ public: */ LookupResult Lookup (Mac48Address destination); private: - /** - * assignment operator - * - * \param table the flame table to assign - * \returns the assigned value - */ - FlameRtable& operator= (const FlameRtable & table); - /// type conversion operator - FlameRtable (const FlameRtable &); - /// Routing table entry struct Route { diff --git a/src/network/utils/sequence-number.h b/src/network/utils/sequence-number.h index bc43b23c6..fb91e33dc 100644 --- a/src/network/utils/sequence-number.h +++ b/src/network/utils/sequence-number.h @@ -347,95 +347,24 @@ public: template friend std::istream & operator >> (std::istream &is, const SequenceNumber &val); -private: // unimplemented operators - /** - * \brief Plus equals operator - unimplemented - * \param value value - * \returns sequence number - */ - SequenceNumber& operator+= (SequenceNumber const &value); - /** - * \brief Minus equals operator - unimplemented - * \param value value - * \returns sequence number - */ - SequenceNumber& operator-= (SequenceNumber const &value); - /** - * \brief Multiplication operator - unimplemented - * \param b value - * \returns sequence number - */ - SequenceNumber operator* (const SequenceNumber& b) const; - /** - * \brief Division operator - unimplemented - * \param b value - * \returns sequence number - */ - SequenceNumber operator/ (const SequenceNumber& b) const; - /** - * \brief Modulo operator - unimplemented - * \param b value - * \returns sequence number - */ - SequenceNumber operator% (const SequenceNumber& b) const; - /** - * \brief Logical NOT operator - unimplemented - * \returns condition - */ - bool operator ! () const; - /** - * \brief Logical AND operator - unimplemented - * \param b value - * \returns condition - */ - bool operator && (const SequenceNumber& b) const; - /** - * \brief Logical OR operator - unimplemented - * \param b value - * \returns condition - */ - bool operator || (const SequenceNumber& b) const; - /** - * \brief Bitwise NOT operator - unimplemented - * \returns sequence number - */ - SequenceNumber operator~ () const; - /** - * \brief Bitwise AND operator - unimplemented - * \param b value - * \returns sequence number - */ - SequenceNumber operator& (const SequenceNumber& b) const; - /** - * \brief Bitwise OR operator - unimplemented - * \param b value - * \returns sequence number - */ - SequenceNumber operator| (const SequenceNumber& b) const; - /** - * \brief Bitwise XOR operator - unimplemented - * \param b value - * \returns sequence number - */ - SequenceNumber operator^ (const SequenceNumber& b) const; - /** - * \brief Bitwise left shift operator - unimplemented - * \param b value - * \returns sequence number - */ - SequenceNumber operator<< (const SequenceNumber& b) const; - /** - * \brief Bitwise right shift operator - unimplemented - * \param b value - * \returns sequence number - */ - SequenceNumber operator>> (const SequenceNumber& b) const; - /** - * \brief Indirection operator - unimplemented - * \returns integer - */ - int operator* (); - //SequenceNumber* operator& (); +public: + // Unimplemented operators + SequenceNumber &operator+= (const SequenceNumber &) = delete; + SequenceNumber &operator-= (const SequenceNumber &) = delete; + SequenceNumber operator* (const SequenceNumber &) const = delete; + SequenceNumber operator/ (const SequenceNumber &) const = delete; + SequenceNumber operator% (const SequenceNumber &) const = delete; + bool operator ! () const = delete; + bool operator && (const SequenceNumber &) const = delete; + bool operator || (const SequenceNumber &) const = delete; + SequenceNumber operator~ () const = delete; + SequenceNumber operator& (const SequenceNumber &) const = delete; + SequenceNumber operator| (const SequenceNumber &) const = delete; + SequenceNumber operator^ (const SequenceNumber &) const = delete; + SequenceNumber operator<< (const SequenceNumber &) const = delete; + SequenceNumber operator>> (const SequenceNumber &) const = delete; + int operator* () = delete; + //SequenceNumber* operator& () = delete; private: NUMERIC_TYPE m_value; //!< Sequence number value diff --git a/src/nix-vector-routing/helper/nix-vector-helper.h b/src/nix-vector-routing/helper/nix-vector-helper.h index 2fa46b631..a83b3ec3a 100644 --- a/src/nix-vector-routing/helper/nix-vector-helper.h +++ b/src/nix-vector-routing/helper/nix-vector-helper.h @@ -72,6 +72,9 @@ public: */ NixVectorHelper (const NixVectorHelper &o); + // Delete assignment operator to avoid misuse + NixVectorHelper &operator= (const NixVectorHelper &) = delete; + /** * \returns pointer to clone of this NixVectorHelper * @@ -105,13 +108,6 @@ public: void PrintRoutingPathAt (Time printTime, Ptr source, IpAddress dest, Ptr stream, Time::Unit unit = Time::S); private: - /** - * \brief Assignment operator declared private and not implemented to disallow - * assignment and prevent the compiler from happily inserting its own. - * \return Nothing useful. - */ - NixVectorHelper &operator = (const NixVectorHelper &); - ObjectFactory m_agentFactory; //!< Object factory /** diff --git a/src/olsr/helper/olsr-helper.h b/src/olsr/helper/olsr-helper.h index 0464ae586..d654bb807 100644 --- a/src/olsr/helper/olsr-helper.h +++ b/src/olsr/helper/olsr-helper.h @@ -54,6 +54,9 @@ public: */ OlsrHelper (const OlsrHelper &o); + // Delete assignment operator to avoid misuse + OlsrHelper &operator= (const OlsrHelper &) = delete; + /** * \returns pointer to clone of this OlsrHelper * @@ -100,12 +103,6 @@ public: int64_t AssignStreams (NodeContainer c, int64_t stream); private: - /** - * \brief Assignment operator declared private and not implemented to disallow - * assignment and prevent the compiler from happily inserting its own. - * \return nothing - */ - OlsrHelper &operator = (const OlsrHelper &); ObjectFactory m_agentFactory; //!< Object factory std::map< Ptr, std::set > m_interfaceExclusions; //!< container of interfaces excluded from OLSR operations diff --git a/src/propagation/model/channel-condition-model.h b/src/propagation/model/channel-condition-model.h index 205b72cda..731dd29e6 100644 --- a/src/propagation/model/channel-condition-model.h +++ b/src/propagation/model/channel-condition-model.h @@ -218,9 +218,12 @@ public: */ virtual ~ChannelConditionModel (); + // Delete copy constructor and assignment operator to avoid misuse + ChannelConditionModel (const ChannelConditionModel &) = delete; + ChannelConditionModel &operator= (const ChannelConditionModel &) = delete; + /** * Computes the condition of the channel between a and b - * * \param a mobility model * \param b mobility model @@ -238,21 +241,6 @@ public: * \return the number of stream indices assigned by this model */ virtual int64_t AssignStreams (int64_t stream) = 0; - - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - ChannelConditionModel (const ChannelConditionModel&) = delete; - - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns the ChannelConditionModel instance - */ - ChannelConditionModel &operator = (const ChannelConditionModel &) = delete; }; /** @@ -280,6 +268,10 @@ public: */ virtual ~AlwaysLosChannelConditionModel (); + // Delete copy constructor and assignment operator to avoid misuse + AlwaysLosChannelConditionModel (const AlwaysLosChannelConditionModel &) = delete; + AlwaysLosChannelConditionModel &operator= (const AlwaysLosChannelConditionModel &) = delete; + /** * Computes the condition of the channel between a and b, that will be always LoS * @@ -289,21 +281,6 @@ public: */ virtual Ptr GetChannelCondition (Ptr a, Ptr b) const override; - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - AlwaysLosChannelConditionModel (const AlwaysLosChannelConditionModel&) = delete; - - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns a copy of the object - */ - AlwaysLosChannelConditionModel &operator = (const AlwaysLosChannelConditionModel &) = delete; - /** * If this model uses objects of type RandomVariableStream, * set the stream numbers to the integers starting with the offset @@ -341,6 +318,10 @@ public: */ virtual ~NeverLosChannelConditionModel (); + // Delete copy constructor and assignment operator to avoid misuse + NeverLosChannelConditionModel (const NeverLosChannelConditionModel &) = delete; + NeverLosChannelConditionModel &operator= (const NeverLosChannelConditionModel &) = delete; + /** * Computes the condition of the channel between a and b, that will be always non-LoS * @@ -350,21 +331,6 @@ public: */ virtual Ptr GetChannelCondition (Ptr a, Ptr b) const override; - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - NeverLosChannelConditionModel (const NeverLosChannelConditionModel&) = delete; - - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns a copy of the object - */ - NeverLosChannelConditionModel &operator = (const NeverLosChannelConditionModel &) = delete; - /** * If this model uses objects of type RandomVariableStream, * set the stream numbers to the integers starting with the offset @@ -402,6 +368,10 @@ public: */ virtual ~NeverLosVehicleChannelConditionModel (); + // Delete copy constructor and assignment operator to avoid misuse + NeverLosVehicleChannelConditionModel (const NeverLosVehicleChannelConditionModel &) = delete; + NeverLosVehicleChannelConditionModel &operator= (const NeverLosVehicleChannelConditionModel &) = delete; + /** * Computes the condition of the channel between a and b, that will be always NLOSv * @@ -411,21 +381,6 @@ public: */ virtual Ptr GetChannelCondition (Ptr a, Ptr b) const override; - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - NeverLosVehicleChannelConditionModel (const NeverLosVehicleChannelConditionModel&) = delete; - - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns a copy of the object - */ - NeverLosVehicleChannelConditionModel &operator = (const NeverLosVehicleChannelConditionModel &) = delete; - /** * If this model uses objects of type RandomVariableStream, * set the stream numbers to the integers starting with the offset diff --git a/src/propagation/model/three-gpp-propagation-loss-model.h b/src/propagation/model/three-gpp-propagation-loss-model.h index 172c7137b..6fbc7cdd8 100644 --- a/src/propagation/model/three-gpp-propagation-loss-model.h +++ b/src/propagation/model/three-gpp-propagation-loss-model.h @@ -49,6 +49,10 @@ public: */ virtual ~ThreeGppPropagationLossModel () override; + // Delete copy constructor and assignment operator to avoid misuse + ThreeGppPropagationLossModel (const ThreeGppPropagationLossModel &) = delete; + ThreeGppPropagationLossModel &operator= (const ThreeGppPropagationLossModel &) = delete; + /** * \brief Set the channel condition model used to determine the channel * state (e.g., the LOS/NLOS condition) @@ -74,21 +78,6 @@ public: */ double GetFrequency (void) const; - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - ThreeGppPropagationLossModel (const ThreeGppPropagationLossModel &) = delete; - - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns the ThreeGppPropagationLossModel instance - */ - ThreeGppPropagationLossModel & operator = (const ThreeGppPropagationLossModel &) = delete; - private: /** * Computes the received power by applying the pathloss model described in @@ -266,20 +255,9 @@ public: */ virtual ~ThreeGppRmaPropagationLossModel () override; - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ + // Delete copy constructor and assignment operator to avoid misuse ThreeGppRmaPropagationLossModel (const ThreeGppRmaPropagationLossModel &) = delete; - - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns the ThreeGppRmaPropagationLossModel instance - */ - ThreeGppRmaPropagationLossModel & operator = (const ThreeGppRmaPropagationLossModel &) = delete; + ThreeGppRmaPropagationLossModel &operator= (const ThreeGppRmaPropagationLossModel &) = delete; private: /** @@ -368,20 +346,9 @@ public: */ virtual ~ThreeGppUmaPropagationLossModel () override; - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ + // Delete copy constructor and assignment operator to avoid misuse ThreeGppUmaPropagationLossModel (const ThreeGppUmaPropagationLossModel &) = delete; - - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \return the ThreeGppUmaPropagationLossModel instance - */ - ThreeGppUmaPropagationLossModel & operator = (const ThreeGppUmaPropagationLossModel &) = delete; + ThreeGppUmaPropagationLossModel &operator= (const ThreeGppUmaPropagationLossModel &) = delete; private: virtual int64_t DoAssignStreams (int64_t stream) override; @@ -461,20 +428,9 @@ public: */ virtual ~ThreeGppUmiStreetCanyonPropagationLossModel () override; - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ + // Delete copy constructor and assignment operator to avoid misuse ThreeGppUmiStreetCanyonPropagationLossModel (const ThreeGppUmiStreetCanyonPropagationLossModel &) = delete; - - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \return the ThreeGppUmiStreetCanyonPropagationLossModel instance - */ - ThreeGppUmiStreetCanyonPropagationLossModel & operator = (const ThreeGppUmiStreetCanyonPropagationLossModel &) = delete; + ThreeGppUmiStreetCanyonPropagationLossModel &operator= (const ThreeGppUmiStreetCanyonPropagationLossModel &) = delete; private: /** @@ -558,20 +514,9 @@ public: */ virtual ~ThreeGppIndoorOfficePropagationLossModel () override; - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ + // Delete copy constructor and assignment operator to avoid misuse ThreeGppIndoorOfficePropagationLossModel (const ThreeGppIndoorOfficePropagationLossModel &) = delete; - - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \return the ThreeGppIndoorOfficePropagationLossModel instance - */ - ThreeGppIndoorOfficePropagationLossModel & operator = (const ThreeGppIndoorOfficePropagationLossModel &) = delete; + ThreeGppIndoorOfficePropagationLossModel &operator= (const ThreeGppIndoorOfficePropagationLossModel &) = delete; private: /** diff --git a/src/propagation/model/three-gpp-v2v-propagation-loss-model.h b/src/propagation/model/three-gpp-v2v-propagation-loss-model.h index 8a30f33ad..c494df2a2 100644 --- a/src/propagation/model/three-gpp-v2v-propagation-loss-model.h +++ b/src/propagation/model/three-gpp-v2v-propagation-loss-model.h @@ -49,21 +49,10 @@ public: */ virtual ~ThreeGppV2vUrbanPropagationLossModel () override; - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ + // Delete copy constructor and assignment operator to avoid misuse ThreeGppV2vUrbanPropagationLossModel (const ThreeGppV2vUrbanPropagationLossModel &) = delete; + ThreeGppV2vUrbanPropagationLossModel &operator= (const ThreeGppV2vUrbanPropagationLossModel &) = delete; - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns the ThreeGppRmaPropagationLossModel instance - */ - ThreeGppV2vUrbanPropagationLossModel & operator = (const ThreeGppV2vUrbanPropagationLossModel &) = delete; - private: /** * \brief Computes the pathloss between a and b considering that the line of diff --git a/src/wifi/model/block-ack-manager.h b/src/wifi/model/block-ack-manager.h index 421c0ab91..ef60756ad 100644 --- a/src/wifi/model/block-ack-manager.h +++ b/src/wifi/model/block-ack-manager.h @@ -69,15 +69,6 @@ struct Bar class BlockAckManager : public Object { private: - /// type conversion operator - BlockAckManager (const BlockAckManager&); - /** - * assignment operator - * \param block BlockAckManager to assign - * \returns the assigned BlockAckManager - */ - BlockAckManager& operator= (const BlockAckManager& block); - /** * Enumeration for the statuses of a buffered MPDU */ @@ -98,6 +89,10 @@ public: BlockAckManager (); ~BlockAckManager (); + // Delete copy constructor and assignment operator to avoid misuse + BlockAckManager (const BlockAckManager &) = delete; + BlockAckManager &operator= (const BlockAckManager &) = delete; + /** * \param recipient Address of peer station involved in block ack mechanism. * \param tid Traffic ID. diff --git a/src/wifi/model/wifi-mac.h b/src/wifi/model/wifi-mac.h index 3ff4f612c..4d4cfb339 100644 --- a/src/wifi/model/wifi-mac.h +++ b/src/wifi/model/wifi-mac.h @@ -94,6 +94,10 @@ public: WifiMac (); virtual ~WifiMac (); + // Delete copy constructor and assignment operator to avoid misuse + WifiMac (const WifiMac &) = delete; + WifiMac &operator= (const WifiMac &) = delete; + /** * Sets the device this PHY is associated with. * @@ -544,16 +548,6 @@ protected: private: - /// type conversion operator - WifiMac (const WifiMac&); - /** - * assignment operator - * - * \param mac the WifiMac to assign - * \returns the assigned value - */ - WifiMac & operator= (const WifiMac& mac); - /** * \param dcf the DCF to be configured * \param cwmin the minimum contention window for the DCF diff --git a/src/wimax/model/bandwidth-manager.h b/src/wimax/model/bandwidth-manager.h index e669094e9..5f5efa34f 100644 --- a/src/wimax/model/bandwidth-manager.h +++ b/src/wimax/model/bandwidth-manager.h @@ -66,6 +66,11 @@ public: */ BandwidthManager (Ptr device); ~BandwidthManager (void); + + // Delete copy constructor and assignment operator to avoid misuse + BandwidthManager (const BandwidthManager &) = delete; + BandwidthManager &operator= (const BandwidthManager &) = delete; + void DoDispose (void); /** @@ -100,14 +105,6 @@ public: */ uint32_t GetSymbolsPerFrameAllocated (void); private: - /// Bandwidth manager type conversion operator - BandwidthManager (const BandwidthManager &); - /** - * Bandwidth manager assignment operator - * \returns the bandwidth manager - */ - BandwidthManager& operator= (const BandwidthManager &); - Ptr m_device; ///< the device uint16_t m_nrBwReqsSent; ///< bandwidth requests sent }; diff --git a/src/wimax/model/bs-link-manager.h b/src/wimax/model/bs-link-manager.h index b4750c71c..2d4d9dec5 100644 --- a/src/wimax/model/bs-link-manager.h +++ b/src/wimax/model/bs-link-manager.h @@ -52,6 +52,11 @@ public: */ BSLinkManager (Ptr bs); ~BSLinkManager (void); + + // Delete copy constructor and assignment operator to avoid misuse + BSLinkManager (const BSLinkManager &) = delete; + BSLinkManager &operator= (const BSLinkManager &) = delete; + /** * \return the ranging opportunities to allocate */ @@ -74,14 +79,6 @@ public: */ void VerifyInvitedRanging (Cid cid, uint8_t uiuc); private: - /// copy constructor (disabled) - BSLinkManager (const BSLinkManager &); - /** - * assignment operator (disabled) - * \returns the BS link manager - */ - BSLinkManager & operator= (const BSLinkManager &); - /** * Perform ranging function * \param cid the CID diff --git a/src/wimax/model/burst-profile-manager.h b/src/wimax/model/burst-profile-manager.h index e90960174..6f8e7fe95 100644 --- a/src/wimax/model/burst-profile-manager.h +++ b/src/wimax/model/burst-profile-manager.h @@ -51,6 +51,11 @@ public: */ BurstProfileManager (Ptr device); ~BurstProfileManager (void); + + // Delete copy constructor and assignment operator to avoid misuse + BurstProfileManager (const BurstProfileManager &) = delete; + BurstProfileManager &operator= (const BurstProfileManager &) = delete; + void DoDispose (void); /** * \returns the number of available burst profile @@ -98,14 +103,6 @@ public: */ uint8_t GetBurstProfileToRequest (void); private: - /// Type conversion operator - BurstProfileManager (const BurstProfileManager &); - /** - * Assignment operator - * \returns burst profile manager - */ - BurstProfileManager& operator= (const BurstProfileManager &); - Ptr m_device; ///< the device }; diff --git a/src/wimax/model/ss-scheduler.h b/src/wimax/model/ss-scheduler.h index ee30dc94d..4c0e35a83 100644 --- a/src/wimax/model/ss-scheduler.h +++ b/src/wimax/model/ss-scheduler.h @@ -55,6 +55,10 @@ public: SSScheduler (Ptr ss); ~SSScheduler (void); + // Delete copy constructor and assignment operator to avoid misuse + SSScheduler (const SSScheduler &) = delete; + SSScheduler &operator= (const SSScheduler &) = delete; + /** * Set poll me value * \param pollMe the poll me flag @@ -78,16 +82,7 @@ public: void DoDispose (void); -protected: private: - /// type conversion operator - SSScheduler (const SSScheduler &); - /** - * assignment operator - * \returns the SS scheduler - */ - SSScheduler & operator= (const SSScheduler &); - /** * Select connection * \returns pointer to the wimax connection