diff --git a/src/bridge/model/bridge-channel.h b/src/bridge/model/bridge-channel.h index 52351f594..1f348e248 100644 --- a/src/bridge/model/bridge-channel.h +++ b/src/bridge/model/bridge-channel.h @@ -50,6 +50,10 @@ public: BridgeChannel (); virtual ~BridgeChannel (); + // Delete copy constructor and assignment operator to avoid misuse + BridgeChannel (const BridgeChannel &) = delete; + BridgeChannel & operator = (const BridgeChannel &) = delete; + /** * Adds a channel to the bridged pool * \param bridgedChannel the channel to add to the pool @@ -61,24 +65,7 @@ public: virtual Ptr GetDevice (std::size_t i) const; private: - - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - BridgeChannel (const BridgeChannel &); - - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns - */ - BridgeChannel &operator = (const BridgeChannel &); - std::vector< Ptr > m_bridgedChannels; //!< pool of bridged channels - }; } // namespace ns3 diff --git a/src/bridge/model/bridge-net-device.h b/src/bridge/model/bridge-net-device.h index ea1f9aff8..a5bcb09ec 100644 --- a/src/bridge/model/bridge-net-device.h +++ b/src/bridge/model/bridge-net-device.h @@ -79,6 +79,10 @@ public: BridgeNetDevice (); virtual ~BridgeNetDevice (); + // Delete copy constructor and assignment operator to avoid misuse + BridgeNetDevice (const BridgeNetDevice &) = delete; + BridgeNetDevice & operator = (const BridgeNetDevice &) = delete; + /** * \brief Add a 'port' to a bridge device * \param bridgePort the NetDevice to add @@ -186,21 +190,6 @@ protected: Ptr GetLearnedState (Mac48Address source); private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - BridgeNetDevice (const BridgeNetDevice &); - - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns - */ - BridgeNetDevice &operator = (const BridgeNetDevice &); - NetDevice::ReceiveCallback m_rxCallback; //!< receive callback NetDevice::PromiscReceiveCallback m_promiscRxCallback; //!< promiscuous receive callback diff --git a/src/dsr/model/dsr-rcache.h b/src/dsr/model/dsr-rcache.h index 8d1d42bcc..0e3779698 100644 --- a/src/dsr/model/dsr-rcache.h +++ b/src/dsr/model/dsr-rcache.h @@ -389,6 +389,9 @@ public: DsrRouteCache (); virtual ~DsrRouteCache (); + // Delete assignment operator to avoid misuse + DsrRouteCache & operator = (DsrRouteCache const &) = delete; + /** * \brief Remove the aged route cache entries when the route cache is full * \param rtVector the route cache to scan. @@ -742,11 +745,6 @@ public: } private: - /** - * \brief assignment operator - defined but not implemented to avoid misuse. - * \return - */ - DsrRouteCache & operator= (DsrRouteCache const &); DsrRouteCacheEntry::IP_VECTOR m_vector; ///< The route vector to save the ip addresses for intermediate nodes. uint32_t m_maxCacheLen; ///< The maximum number of packets that we allow a routing protocol to buffer. Time RouteCacheTimeout; ///< The maximum period of time that dsr is allowed to for an unused route. diff --git a/src/fd-net-device/model/fd-net-device.h b/src/fd-net-device/model/fd-net-device.h index e4f582778..368bd0242 100644 --- a/src/fd-net-device/model/fd-net-device.h +++ b/src/fd-net-device/model/fd-net-device.h @@ -116,6 +116,9 @@ public: */ virtual ~FdNetDevice (); + // Delete assignment operator to avoid misuse + FdNetDevice (FdNetDevice const &) = delete; + /** * Set the link layer encapsulation mode of this device. * @@ -241,14 +244,6 @@ protected: std::queue< std::pair > m_pendingQueue; private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse as suggested in - * http://www.nsnam.org/wiki/NS-3_Python_Bindings#.22invalid_use_of_incomplete_type.22 - */ - FdNetDevice (FdNetDevice const &); - /** * Spin up the device */ diff --git a/src/flow-monitor/helper/flow-monitor-helper.h b/src/flow-monitor/helper/flow-monitor-helper.h index f0ba5cbf4..cc7d150eb 100644 --- a/src/flow-monitor/helper/flow-monitor-helper.h +++ b/src/flow-monitor/helper/flow-monitor-helper.h @@ -43,6 +43,10 @@ public: FlowMonitorHelper (); ~FlowMonitorHelper (); + // Delete copy constructor and assignment operator to avoid misuse + FlowMonitorHelper (const FlowMonitorHelper &) = delete; + FlowMonitorHelper& operator= (const FlowMonitorHelper &) = delete; + /** * \brief Set an attribute for the to-be-created FlowMonitor object * \param n1 attribute name @@ -113,20 +117,6 @@ public: void SerializeToXmlFile (std::string fileName, bool enableHistograms, bool enableProbes); private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - FlowMonitorHelper (const FlowMonitorHelper&); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns - */ - FlowMonitorHelper& operator= (const FlowMonitorHelper&); - ObjectFactory m_monitorFactory; //!< Object factory Ptr m_flowMonitor; //!< the FlowMonitor object Ptr m_flowClassifier4; //!< the FlowClassifier object for IPv4 diff --git a/src/flow-monitor/model/flow-classifier.h b/src/flow-monitor/model/flow-classifier.h index e711f3bbe..13eb0baaa 100644 --- a/src/flow-monitor/model/flow-classifier.h +++ b/src/flow-monitor/model/flow-classifier.h @@ -55,17 +55,15 @@ class FlowClassifier : public SimpleRefCount private: FlowId m_lastNewFlowId; //!< Last known Flow ID - /// Defined and not implemented to avoid misuse - FlowClassifier (FlowClassifier const &); - /// Defined and not implemented to avoid misuse - /// \returns - FlowClassifier& operator= (FlowClassifier const &); - public: FlowClassifier (); virtual ~FlowClassifier (); + // Delete copy constructor and assignment operator to avoid misuse + FlowClassifier (FlowClassifier const &) = delete; + FlowClassifier& operator= (FlowClassifier const &) = delete; + /// Serializes the results to an std::ostream in XML format /// \param os the output stream /// \param indent number of spaces to use as base indentation level diff --git a/src/flow-monitor/model/flow-probe.h b/src/flow-monitor/model/flow-probe.h index 72cc43ef3..3388ad0cd 100644 --- a/src/flow-monitor/model/flow-probe.h +++ b/src/flow-monitor/model/flow-probe.h @@ -38,13 +38,6 @@ class FlowMonitor; /// regarding only the packets that pass through that probe. class FlowProbe : public Object { -private: - /// Defined and not implemented to avoid misuse - FlowProbe (FlowProbe const &); - /// Defined and not implemented to avoid misuse - /// \returns - FlowProbe& operator= (FlowProbe const &); - protected: /// Constructor /// \param flowMonitor the FlowMonitor this probe is associated with @@ -53,6 +46,10 @@ protected: public: virtual ~FlowProbe (); + + // Delete copy constructor and assignment operator to avoid misuse + FlowProbe (FlowProbe const &) = delete; + FlowProbe& operator= (FlowProbe const &) = delete; /// Register this type. /// \return The TypeId. diff --git a/src/internet/model/arp-cache.h b/src/internet/model/arp-cache.h index 017d48495..daa3bf41c 100644 --- a/src/internet/model/arp-cache.h +++ b/src/internet/model/arp-cache.h @@ -50,21 +50,6 @@ class Ipv4Header; */ class ArpCache : public Object { -private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - ArpCache (ArpCache const &); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns - */ - ArpCache& operator= (ArpCache const &); - public: /** * \brief Get the type ID. @@ -72,9 +57,14 @@ public: */ static TypeId GetTypeId (void); class Entry; + ArpCache (); ~ArpCache (); + // Delete copy constructor and assignment operator to avoid misuse + ArpCache (ArpCache const &) = delete; + ArpCache & operator = (ArpCache const &) = delete; + /** * \brief Set the NetDevice and Ipv4Interface associated with the ArpCache * diff --git a/src/internet/model/arp-l3-protocol.h b/src/internet/model/arp-l3-protocol.h index d4835d31a..602bef504 100644 --- a/src/internet/model/arp-l3-protocol.h +++ b/src/internet/model/arp-l3-protocol.h @@ -63,6 +63,10 @@ public: ArpL3Protocol (); virtual ~ArpL3Protocol (); + // Delete copy constructor and assignment operator to avoid misuse + ArpL3Protocol (const ArpL3Protocol &) = delete; + ArpL3Protocol & operator = (const ArpL3Protocol &) = delete; + /** * \brief Set the node the ARP L3 protocol is associated with * \param node the node @@ -128,21 +132,6 @@ protected: virtual void NotifyNewAggregate (); private: typedef std::list > CacheList; //!< container of the ARP caches - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \param o - */ - ArpL3Protocol (const ArpL3Protocol &o); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \param o - * \returns - */ - ArpL3Protocol &operator = (const ArpL3Protocol &o); /** * \brief Finds the cache associated with a NetDevice diff --git a/src/internet/model/arp-queue-disc-item.h b/src/internet/model/arp-queue-disc-item.h index b33633a25..996229b59 100644 --- a/src/internet/model/arp-queue-disc-item.h +++ b/src/internet/model/arp-queue-disc-item.h @@ -44,8 +44,14 @@ public: */ ArpQueueDiscItem (Ptr p, const Address & addr, uint16_t protocol, const ArpHeader & header); + /** Destructor. */ virtual ~ArpQueueDiscItem (); + // Delete default constructor, copy constructor and assignment operator to avoid misuse + ArpQueueDiscItem () = delete; + ArpQueueDiscItem (const ArpQueueDiscItem &) = delete; + ArpQueueDiscItem & operator = (const ArpQueueDiscItem &) = delete; + /** * \return the correct packet size (header plus payload). */ @@ -82,28 +88,8 @@ public: virtual uint32_t Hash (uint32_t perturbation) const; private: - /** - * \brief Default constructor - * - * Defined and unimplemented to avoid misuse - */ - ArpQueueDiscItem (); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - ArpQueueDiscItem (const ArpQueueDiscItem &); - /** - * \brief Assignment operator - * - * Defined and unimplemented to avoid misuse - * \returns - */ - ArpQueueDiscItem &operator = (const ArpQueueDiscItem &); - ArpHeader m_header; //!< The ARP header. - bool m_headerAdded; //!< True if the header has already been added to the packet. + bool m_headerAdded; //!< True if the header has already been added to the packet. }; } // namespace ns3 diff --git a/src/internet/model/ipv4-interface.h b/src/internet/model/ipv4-interface.h index 9a7e918ae..4000aca58 100644 --- a/src/internet/model/ipv4-interface.h +++ b/src/internet/model/ipv4-interface.h @@ -62,6 +62,10 @@ public: Ipv4Interface (); virtual ~Ipv4Interface(); + // Delete copy constructor and assignment operator to avoid misuse + Ipv4Interface (const Ipv4Interface &) = delete; + Ipv4Interface & operator = (const Ipv4Interface &) = delete; + /** * \brief Set node associated with interface. * \param node node @@ -190,24 +194,8 @@ public: protected: virtual void DoDispose (void); + private: - /** - * \brief Copy constructor - * \param o object to copy - * - * Defined and unimplemented to avoid misuse - */ - Ipv4Interface (const Ipv4Interface &o); - - /** - * \brief Assignment operator - * \param o object to copy - * \returns the copied object - * - * Defined and unimplemented to avoid misuse - */ - Ipv4Interface &operator = (const Ipv4Interface &o); - /** * \brief Initialize interface. */ diff --git a/src/internet/model/ipv4-l3-protocol.h b/src/internet/model/ipv4-l3-protocol.h index 3ebaa45d4..69c293efe 100644 --- a/src/internet/model/ipv4-l3-protocol.h +++ b/src/internet/model/ipv4-l3-protocol.h @@ -90,6 +90,10 @@ public: Ipv4L3Protocol(); virtual ~Ipv4L3Protocol (); + // Delete copy constructor and assignment operator to avoid misuse + Ipv4L3Protocol (const Ipv4L3Protocol &) = delete; + Ipv4L3Protocol & operator = (const Ipv4L3Protocol &) = delete; + /** * \enum DropReason * \brief Reason why a packet has been dropped. @@ -275,21 +279,6 @@ private: */ friend class ::Ipv4L3ProtocolTestCase; - /** - * \brief Copy constructor. - * - * Defined but not implemented to avoid misuse - */ - Ipv4L3Protocol(const Ipv4L3Protocol &); - - /** - * \brief Copy constructor. - * - * Defined but not implemented to avoid misuse - * \returns the copied object - */ - Ipv4L3Protocol &operator = (const Ipv4L3Protocol &); - // class Ipv4 attributes virtual void SetIpForward (bool forward); virtual bool GetIpForward (void) const; diff --git a/src/internet/model/ipv4-queue-disc-item.h b/src/internet/model/ipv4-queue-disc-item.h index 7ce1cda4e..556149fe3 100644 --- a/src/internet/model/ipv4-queue-disc-item.h +++ b/src/internet/model/ipv4-queue-disc-item.h @@ -46,6 +46,11 @@ public: virtual ~Ipv4QueueDiscItem (); + // Delete default constructor, copy constructor and assignment operator to avoid misuse + Ipv4QueueDiscItem () = delete; + Ipv4QueueDiscItem (const Ipv4QueueDiscItem &) = delete; + Ipv4QueueDiscItem & operator = (const Ipv4QueueDiscItem &) = delete; + /** * \return the correct packet size (header plus payload). */ @@ -96,26 +101,6 @@ public: virtual uint32_t Hash (uint32_t perturbation) const; private: - /** - * \brief Default constructor - * - * Defined and unimplemented to avoid misuse - */ - Ipv4QueueDiscItem (); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - Ipv4QueueDiscItem (const Ipv4QueueDiscItem &); - /** - * \brief Assignment operator - * - * Defined and unimplemented to avoid misuse - * \returns - */ - Ipv4QueueDiscItem &operator = (const Ipv4QueueDiscItem &); - Ipv4Header m_header; //!< The IPv4 header. bool m_headerAdded; //!< True if the header has already been added to the packet. }; diff --git a/src/internet/model/ipv6-interface.h b/src/internet/model/ipv6-interface.h index 91be93120..c275ab32c 100644 --- a/src/internet/model/ipv6-interface.h +++ b/src/internet/model/ipv6-interface.h @@ -67,6 +67,10 @@ public: */ virtual ~Ipv6Interface (); + // Delete copy constructor and assignment operator to avoid misuse + Ipv6Interface (const Ipv6Interface &) = delete; + Ipv6Interface & operator = (const Ipv6Interface &) = delete; + /** * \brief Set node associated with interface. * \param node node @@ -279,23 +283,6 @@ protected: virtual void DoDispose (); private: - /** - * \brief Copy constructor - * \param o object to copy - * - * Defined and unimplemented to avoid misuse - */ - Ipv6Interface (const Ipv6Interface &o); - - /** - * \brief Assignment operator - * \param o object to copy - * \returns the copied object - * - * Defined and unimplemented to avoid misuse - */ - Ipv6Interface &operator = (const Ipv6Interface &o); - /** * \brief Container for the Ipv6InterfaceAddresses. */ diff --git a/src/internet/model/ipv6-l3-protocol.h b/src/internet/model/ipv6-l3-protocol.h index 9f7c12163..f7962aece 100644 --- a/src/internet/model/ipv6-l3-protocol.h +++ b/src/internet/model/ipv6-l3-protocol.h @@ -99,6 +99,10 @@ public: */ virtual ~Ipv6L3Protocol (); + // Delete copy constructor and assignment operator to avoid misuse + Ipv6L3Protocol (const Ipv6L3Protocol &) = delete; + Ipv6L3Protocol & operator = (const Ipv6L3Protocol &) = delete; + /** * \brief Set node associated with this stack. * \param node node to set @@ -567,21 +571,6 @@ private: /// Trace of locally delivered packets TracedCallback, uint32_t> m_localDeliverTrace; - /** - * \brief Copy constructor. - * - * Defined but not implemented to avoid misuse - */ - Ipv6L3Protocol (const Ipv6L3Protocol&); - - /** - * \brief Copy constructor. - * - * Defined but not implemented to avoid misuse - * \returns the copied object - */ - Ipv6L3Protocol &operator = (const Ipv6L3Protocol&); - /** * \brief Construct an IPv6 header. * \param src source IPv6 address diff --git a/src/internet/model/ipv6-queue-disc-item.h b/src/internet/model/ipv6-queue-disc-item.h index 760ec492b..06967b59c 100644 --- a/src/internet/model/ipv6-queue-disc-item.h +++ b/src/internet/model/ipv6-queue-disc-item.h @@ -46,6 +46,11 @@ public: virtual ~Ipv6QueueDiscItem (); + // Delete default constructor, copy constructor and assignment operator to avoid misuse + Ipv6QueueDiscItem () = delete; + Ipv6QueueDiscItem (const Ipv6QueueDiscItem &) = delete; + Ipv6QueueDiscItem & operator = (const Ipv6QueueDiscItem &) = delete; + /** * \return the correct packet size (header plus payload). */ @@ -96,26 +101,6 @@ public: virtual uint32_t Hash (uint32_t perturbation) const; private: - /** - * \brief Default constructor - * - * Defined and unimplemented to avoid misuse - */ - Ipv6QueueDiscItem (); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - Ipv6QueueDiscItem (const Ipv6QueueDiscItem &); - /** - * \brief Assignment operator - * - * Defined and unimplemented to avoid misuse - * \returns - */ - Ipv6QueueDiscItem &operator = (const Ipv6QueueDiscItem &); - Ipv6Header m_header; //!< The IPv6 header. bool m_headerAdded; //!< True if the header has already been added to the packet. }; diff --git a/src/internet/model/ndisc-cache.h b/src/internet/model/ndisc-cache.h index c243ab70c..bfbd3fa2b 100644 --- a/src/internet/model/ndisc-cache.h +++ b/src/internet/model/ndisc-cache.h @@ -72,6 +72,10 @@ public: */ ~NdiscCache (); + // Delete default and copy constructor, and assignment operator to avoid misuse + NdiscCache (NdiscCache const &) = delete; + NdiscCache & operator = (NdiscCache const &) = delete; + /** * \brief Get the NetDevice associated with this cache. * \return NetDevice @@ -438,24 +442,7 @@ protected: */ Cache m_ndCache; - private: - - /** - * \brief Copy constructor. - * - * Not implemented to avoid misuse - */ - NdiscCache (NdiscCache const &); - - /** - * \brief Copy constructor. - * - * Not implemented to avoid misuse - * \returns - */ - NdiscCache& operator= (NdiscCache const &); - /** * \brief The NetDevice. */ diff --git a/src/internet/model/tcp-l4-protocol.h b/src/internet/model/tcp-l4-protocol.h index 5f9b348c1..33a9b3148 100644 --- a/src/internet/model/tcp-l4-protocol.h +++ b/src/internet/model/tcp-l4-protocol.h @@ -89,6 +89,10 @@ public: TcpL4Protocol (); virtual ~TcpL4Protocol (); + // Delete copy constructor and assignment operator to avoid misuse + TcpL4Protocol (const TcpL4Protocol &) = delete; + TcpL4Protocol & operator = (const TcpL4Protocol &) = delete; + /** * Set node associated with this stack * \param node the node @@ -324,20 +328,6 @@ private: IpL4Protocol::DownTargetCallback m_downTarget; //!< Callback to send packets over IPv4 IpL4Protocol::DownTargetCallback6 m_downTarget6; //!< Callback to send packets over IPv6 - /** - * \brief Copy constructor - * - * Defined and not implemented to avoid misuse - */ - TcpL4Protocol (const TcpL4Protocol &); - /** - * \brief Copy constructor - * - * Defined and not implemented to avoid misuse - * \returns - */ - TcpL4Protocol &operator = (const TcpL4Protocol &); - /** * \brief Send a packet via TCP (IPv4) * diff --git a/src/internet/model/udp-l4-protocol.h b/src/internet/model/udp-l4-protocol.h index eb456904c..292513fdd 100644 --- a/src/internet/model/udp-l4-protocol.h +++ b/src/internet/model/udp-l4-protocol.h @@ -70,6 +70,10 @@ public: UdpL4Protocol (); virtual ~UdpL4Protocol (); + // Delete copy constructor and assignment operator to avoid misuse + UdpL4Protocol (const UdpL4Protocol &) = delete; + UdpL4Protocol &operator = (const UdpL4Protocol &) = delete; + /** * Set node associated with this stack * \param node the node @@ -257,20 +261,6 @@ private: Ipv4EndPointDemux *m_endPoints; //!< A list of IPv4 end points. Ipv6EndPointDemux *m_endPoints6; //!< A list of IPv6 end points. - /** - * \brief Copy constructor - * - * Defined and not implemented to avoid misuse - */ - UdpL4Protocol (const UdpL4Protocol &); - /** - * \brief Copy constructor - * - * Defined and not implemented to avoid misuse - * \returns - */ - UdpL4Protocol &operator = (const UdpL4Protocol &); - std::vector > m_sockets; //!< list of sockets IpL4Protocol::DownTargetCallback m_downTarget; //!< Callback to send packets over IPv4 IpL4Protocol::DownTargetCallback6 m_downTarget6; //!< Callback to send packets over IPv6 diff --git a/src/network/utils/queue-item.h b/src/network/utils/queue-item.h index 65d2181af..0b07d4515 100644 --- a/src/network/utils/queue-item.h +++ b/src/network/utils/queue-item.h @@ -54,6 +54,11 @@ public: virtual ~QueueItem (); + // Delete default constructor, copy constructor and assignment operator to avoid misuse + QueueItem () = delete; + QueueItem (const QueueItem &) = delete; + QueueItem & operator = (const QueueItem &) = delete; + /** * \return the packet included in this item. */ @@ -101,26 +106,6 @@ public: typedef void (* TracedCallback) (Ptr item); private: - /** - * \brief Default constructor - * - * Defined and unimplemented to avoid misuse - */ - QueueItem (); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - QueueItem (const QueueItem &); - /** - * \brief Assignment operator - * - * Defined and unimplemented to avoid misuse - * \returns - */ - QueueItem &operator = (const QueueItem &); - /** * The packet contained in the queue item. */ @@ -157,6 +142,11 @@ public: virtual ~QueueDiscItem (); + // Delete default constructor, copy constructor and assignment operator to avoid misuse + QueueDiscItem () = delete; + QueueDiscItem (const QueueDiscItem &) = delete; + QueueDiscItem & operator = (const QueueDiscItem &) = delete; + /** * \brief Get the MAC address included in this item * \return the MAC address included in this item. @@ -227,26 +217,6 @@ public: virtual uint32_t Hash (uint32_t perturbation = 0) const; private: - /** - * \brief Default constructor - * - * Defined and unimplemented to avoid misuse - */ - QueueDiscItem (); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - QueueDiscItem (const QueueDiscItem &); - /** - * \brief Assignment operator - * - * Defined and unimplemented to avoid misuse - * \returns - */ - QueueDiscItem &operator = (const QueueDiscItem &); - Address m_address; //!< MAC destination address uint16_t m_protocol; //!< L3 Protocol number uint8_t m_txq; //!< Transmission queue index diff --git a/src/propagation/model/cost231-propagation-loss-model.h b/src/propagation/model/cost231-propagation-loss-model.h index bb458ca9f..2ab21b8bc 100644 --- a/src/propagation/model/cost231-propagation-loss-model.h +++ b/src/propagation/model/cost231-propagation-loss-model.h @@ -58,6 +58,10 @@ public: static TypeId GetTypeId (void); Cost231PropagationLossModel (); + // Delete copy constructor and assignment operator to avoid misuse + Cost231PropagationLossModel (const Cost231PropagationLossModel &) = delete; + Cost231PropagationLossModel & operator = (const Cost231PropagationLossModel &) = delete; + /** * Get the propagation loss * \param a the mobility model of the source @@ -123,21 +127,8 @@ public: * \param shadowing the shadowing value */ void SetShadowing (double shadowing); -private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - Cost231PropagationLossModel (const Cost231PropagationLossModel &); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns - */ - Cost231PropagationLossModel & operator = (const Cost231PropagationLossModel &); +private: double DoCalcRxPower (double txPowerDbm, Ptr a, Ptr b) const override; int64_t DoAssignStreams (int64_t stream) override; diff --git a/src/propagation/model/itu-r-1411-los-propagation-loss-model.h b/src/propagation/model/itu-r-1411-los-propagation-loss-model.h index 3d3930532..c1916f5ae 100644 --- a/src/propagation/model/itu-r-1411-los-propagation-loss-model.h +++ b/src/propagation/model/itu-r-1411-los-propagation-loss-model.h @@ -53,6 +53,10 @@ public: ItuR1411LosPropagationLossModel (); virtual ~ItuR1411LosPropagationLossModel (); + // Delete copy constructor and assignment operator to avoid misuse + ItuR1411LosPropagationLossModel (const ItuR1411LosPropagationLossModel &) = delete; + ItuR1411LosPropagationLossModel & operator = (const ItuR1411LosPropagationLossModel &) = delete; + /** * Set the operating frequency * @@ -72,20 +76,6 @@ public: double GetLoss (Ptr a, Ptr b) const; private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - ItuR1411LosPropagationLossModel (const ItuR1411LosPropagationLossModel &); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns - */ - ItuR1411LosPropagationLossModel & operator = (const ItuR1411LosPropagationLossModel &); - double DoCalcRxPower (double txPowerDbm, Ptr a, Ptr b) const override; diff --git a/src/propagation/model/itu-r-1411-nlos-over-rooftop-propagation-loss-model.h b/src/propagation/model/itu-r-1411-nlos-over-rooftop-propagation-loss-model.h index 460dc9519..b2357135d 100644 --- a/src/propagation/model/itu-r-1411-nlos-over-rooftop-propagation-loss-model.h +++ b/src/propagation/model/itu-r-1411-nlos-over-rooftop-propagation-loss-model.h @@ -53,6 +53,10 @@ public: ItuR1411NlosOverRooftopPropagationLossModel (); virtual ~ItuR1411NlosOverRooftopPropagationLossModel (); + // Delete copy constructor and assignment operator to avoid misuse + ItuR1411NlosOverRooftopPropagationLossModel (const ItuR1411NlosOverRooftopPropagationLossModel &) = delete; + ItuR1411NlosOverRooftopPropagationLossModel & operator = (const ItuR1411NlosOverRooftopPropagationLossModel &) = delete; + /** * Set the operating frequency * @@ -72,20 +76,6 @@ public: double GetLoss (Ptr a, Ptr b) const; private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - ItuR1411NlosOverRooftopPropagationLossModel (const ItuR1411NlosOverRooftopPropagationLossModel &); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns - */ - ItuR1411NlosOverRooftopPropagationLossModel & operator = (const ItuR1411NlosOverRooftopPropagationLossModel &); - double DoCalcRxPower (double txPowerDbm, Ptr a, Ptr b) const override; diff --git a/src/propagation/model/jakes-propagation-loss-model.h b/src/propagation/model/jakes-propagation-loss-model.h index b1d577ca8..2e2e24f87 100644 --- a/src/propagation/model/jakes-propagation-loss-model.h +++ b/src/propagation/model/jakes-propagation-loss-model.h @@ -43,23 +43,14 @@ public: static TypeId GetTypeId (); JakesPropagationLossModel (); virtual ~JakesPropagationLossModel (); - + + // Delete copy constructor and assignment operator to avoid misuse + JakesPropagationLossModel (const JakesPropagationLossModel &) = delete; + JakesPropagationLossModel & operator = (const JakesPropagationLossModel &) = delete; + private: friend class JakesProcess; - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - JakesPropagationLossModel (const JakesPropagationLossModel &); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns - */ - JakesPropagationLossModel & operator = (const JakesPropagationLossModel &); double DoCalcRxPower (double txPowerDbm, Ptr a, Ptr b) const override; diff --git a/src/propagation/model/kun-2600-mhz-propagation-loss-model.h b/src/propagation/model/kun-2600-mhz-propagation-loss-model.h index 649e796c5..1c7a5ac79 100644 --- a/src/propagation/model/kun-2600-mhz-propagation-loss-model.h +++ b/src/propagation/model/kun-2600-mhz-propagation-loss-model.h @@ -51,6 +51,10 @@ public: Kun2600MhzPropagationLossModel (); virtual ~Kun2600MhzPropagationLossModel (); + // Delete copy constructor and assignment operator to avoid misuse + Kun2600MhzPropagationLossModel (const Kun2600MhzPropagationLossModel &) = delete; + Kun2600MhzPropagationLossModel & operator = (const Kun2600MhzPropagationLossModel &) = delete; + /** * \param a the first mobility model * \param b the second mobility model @@ -61,20 +65,6 @@ public: double GetLoss (Ptr a, Ptr b) const; private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - Kun2600MhzPropagationLossModel (const Kun2600MhzPropagationLossModel &); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns - */ - Kun2600MhzPropagationLossModel & operator = (const Kun2600MhzPropagationLossModel &); - // inherited from PropagationLossModel double DoCalcRxPower (double txPowerDbm, Ptr a, diff --git a/src/propagation/model/okumura-hata-propagation-loss-model.h b/src/propagation/model/okumura-hata-propagation-loss-model.h index 4e9c364a6..d04c40833 100644 --- a/src/propagation/model/okumura-hata-propagation-loss-model.h +++ b/src/propagation/model/okumura-hata-propagation-loss-model.h @@ -54,6 +54,10 @@ public: OkumuraHataPropagationLossModel (); virtual ~OkumuraHataPropagationLossModel (); + // Delete copy constructor and assignment operator to avoid misuse + OkumuraHataPropagationLossModel (const OkumuraHataPropagationLossModel &) = delete; + OkumuraHataPropagationLossModel & operator = (const OkumuraHataPropagationLossModel &) = delete; + /** * \param a the first mobility model * \param b the second mobility model @@ -64,20 +68,6 @@ public: double GetLoss (Ptr a, Ptr b) const; private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - OkumuraHataPropagationLossModel (const OkumuraHataPropagationLossModel &); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns - */ - OkumuraHataPropagationLossModel & operator = (const OkumuraHataPropagationLossModel &); - double DoCalcRxPower (double txPowerDbm, Ptr a, Ptr b) const override; diff --git a/src/propagation/model/propagation-loss-model.h b/src/propagation/model/propagation-loss-model.h index 40d14f394..3afc1d116 100644 --- a/src/propagation/model/propagation-loss-model.h +++ b/src/propagation/model/propagation-loss-model.h @@ -59,6 +59,10 @@ public: PropagationLossModel (); virtual ~PropagationLossModel (); + // Delete copy constructor and assignment operator to avoid misuse + PropagationLossModel (const PropagationLossModel &) = delete; + PropagationLossModel & operator = (const PropagationLossModel &) = delete; + /** * \brief Enables a chain of loss models to act on the signal * \param next The next PropagationLossModel to add to the chain @@ -129,21 +133,6 @@ protected: virtual int64_t DoAssignStreams (int64_t stream) = 0; private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - PropagationLossModel (const PropagationLossModel &); - - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns - */ - PropagationLossModel &operator = (const PropagationLossModel &); - Ptr m_next; //!< Next propagation loss model in the list }; @@ -164,21 +153,11 @@ public: RandomPropagationLossModel (); virtual ~RandomPropagationLossModel (); -private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - RandomPropagationLossModel (const RandomPropagationLossModel &); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns - */ - RandomPropagationLossModel & operator = (const RandomPropagationLossModel &); + // Delete copy constructor and assignment operator to avoid misuse + RandomPropagationLossModel (const RandomPropagationLossModel &) = delete; + RandomPropagationLossModel & operator = (const RandomPropagationLossModel &) = delete; +private: double DoCalcRxPower (double txPowerDbm, Ptr a, Ptr b) const override; @@ -273,6 +252,11 @@ public: */ static TypeId GetTypeId (void); FriisPropagationLossModel (); + + // Delete copy constructor and assignment operator to avoid misuse + FriisPropagationLossModel (const FriisPropagationLossModel &) = delete; + FriisPropagationLossModel & operator = (const FriisPropagationLossModel &) = delete; + /** * \param frequency (Hz) * @@ -310,20 +294,6 @@ public: double GetSystemLoss (void) const; private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - FriisPropagationLossModel (const FriisPropagationLossModel &); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns - */ - FriisPropagationLossModel & operator = (const FriisPropagationLossModel &); - double DoCalcRxPower (double txPowerDbm, Ptr a, Ptr b) const override; @@ -387,6 +357,10 @@ public: static TypeId GetTypeId (void); TwoRayGroundPropagationLossModel (); + // Delete copy constructor and assignment operator to avoid misuse + TwoRayGroundPropagationLossModel (const TwoRayGroundPropagationLossModel &) = delete; + TwoRayGroundPropagationLossModel & operator = (const TwoRayGroundPropagationLossModel &) = delete; + /** * \param frequency (Hz) * @@ -430,20 +404,6 @@ public: void SetHeightAboveZ (double heightAboveZ); private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - TwoRayGroundPropagationLossModel (const TwoRayGroundPropagationLossModel &); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns - */ - TwoRayGroundPropagationLossModel & operator = (const TwoRayGroundPropagationLossModel &); - double DoCalcRxPower (double txPowerDbm, Ptr a, Ptr b) const override; @@ -500,6 +460,10 @@ public: static TypeId GetTypeId (void); LogDistancePropagationLossModel (); + // Delete copy constructor and assignment operator to avoid misuse + LogDistancePropagationLossModel (const LogDistancePropagationLossModel &) = delete; + LogDistancePropagationLossModel & operator = (const LogDistancePropagationLossModel &) = delete; + /** * \param n the path loss exponent. * Set the path loss exponent. @@ -518,20 +482,6 @@ public: void SetReference (double referenceDistance, double referenceLoss); private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - LogDistancePropagationLossModel (const LogDistancePropagationLossModel &); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns - */ - LogDistancePropagationLossModel & operator = (const LogDistancePropagationLossModel &); - double DoCalcRxPower (double txPowerDbm, Ptr a, Ptr b) const override; @@ -599,23 +549,13 @@ public: static TypeId GetTypeId (void); ThreeLogDistancePropagationLossModel (); + // Delete copy constructor and assignment operator to avoid misuse + ThreeLogDistancePropagationLossModel (const ThreeLogDistancePropagationLossModel &) = delete; + ThreeLogDistancePropagationLossModel & operator = (const ThreeLogDistancePropagationLossModel &) = delete; + // Parameters are all accessible via attributes. private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - ThreeLogDistancePropagationLossModel (const ThreeLogDistancePropagationLossModel&); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns - */ - ThreeLogDistancePropagationLossModel& operator= (const ThreeLogDistancePropagationLossModel&); - double DoCalcRxPower (double txPowerDbm, Ptr a, Ptr b) const override; @@ -671,23 +611,13 @@ public: NakagamiPropagationLossModel (); + // Delete copy constructor and assignment operator to avoid misuse + NakagamiPropagationLossModel (const NakagamiPropagationLossModel &) = delete; + NakagamiPropagationLossModel & operator = (const NakagamiPropagationLossModel &) = delete; + // Parameters are all accessible via attributes. private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - NakagamiPropagationLossModel (const NakagamiPropagationLossModel&); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns - */ - NakagamiPropagationLossModel& operator= (const NakagamiPropagationLossModel&); - double DoCalcRxPower (double txPowerDbm, Ptr a, Ptr b) const override; @@ -729,6 +659,11 @@ public: FixedRssLossModel (); virtual ~FixedRssLossModel (); + + // Delete copy constructor and assignment operator to avoid misuse + FixedRssLossModel (const FixedRssLossModel &) = delete; + FixedRssLossModel & operator = (const FixedRssLossModel &) = delete; + /** * \param rss (dBm) the received signal strength * @@ -737,20 +672,6 @@ public: void SetRss (double rss); private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - FixedRssLossModel (const FixedRssLossModel &); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns - */ - FixedRssLossModel & operator = (const FixedRssLossModel &); - double DoCalcRxPower (double txPowerDbm, Ptr a, Ptr b) const override; @@ -779,6 +700,10 @@ public: MatrixPropagationLossModel (); virtual ~MatrixPropagationLossModel (); + // Delete copy constructor and assignment operator to avoid misuse + MatrixPropagationLossModel (const MatrixPropagationLossModel &) = delete; + MatrixPropagationLossModel & operator = (const MatrixPropagationLossModel &) = delete; + /** * \brief Set loss (in dB, positive) between pair of ns-3 objects * (typically, nodes). @@ -797,20 +722,6 @@ public: void SetDefaultLoss (double defaultLoss); private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - MatrixPropagationLossModel (const MatrixPropagationLossModel &); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns - */ - MatrixPropagationLossModel &operator = (const MatrixPropagationLossModel &); - double DoCalcRxPower (double txPowerDbm, Ptr a, Ptr b) const override; @@ -844,21 +755,12 @@ public: */ static TypeId GetTypeId (void); RangePropagationLossModel (); -private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - RangePropagationLossModel (const RangePropagationLossModel&); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns - */ - RangePropagationLossModel& operator= (const RangePropagationLossModel&); + // Delete copy constructor and assignment operator to avoid misuse + RangePropagationLossModel (const RangePropagationLossModel &) = delete; + RangePropagationLossModel & operator = (const RangePropagationLossModel &) = delete; + +private: double DoCalcRxPower (double txPowerDbm, Ptr a, Ptr b) const override; diff --git a/src/sixlowpan/model/sixlowpan-net-device.h b/src/sixlowpan/model/sixlowpan-net-device.h index 0946d55df..7b1315052 100644 --- a/src/sixlowpan/model/sixlowpan-net-device.h +++ b/src/sixlowpan/model/sixlowpan-net-device.h @@ -88,6 +88,10 @@ public: */ SixLowPanNetDevice (); + // Delete copy constructor and assignment operator to avoid misuse + SixLowPanNetDevice (SixLowPanNetDevice const &) = delete; + SixLowPanNetDevice & operator = (SixLowPanNetDevice const &) = delete; + // inherited from NetDevice base class virtual void SetIfIndex (const uint32_t index); virtual uint32_t GetIfIndex (void) const; @@ -234,19 +238,6 @@ protected: virtual void DoDispose (void); private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse. - */ - SixLowPanNetDevice (SixLowPanNetDevice const &); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse. - * \returns - */ - SixLowPanNetDevice& operator= (SixLowPanNetDevice const &); /** * \brief Receives all the packets from a NetDevice for further processing. * \param [in] device The NetDevice the packet ws received from. diff --git a/src/spectrum/model/spectrum-phy.h b/src/spectrum/model/spectrum-phy.h index 8c7410291..d02a988ae 100644 --- a/src/spectrum/model/spectrum-phy.h +++ b/src/spectrum/model/spectrum-phy.h @@ -49,6 +49,10 @@ public: SpectrumPhy (); virtual ~SpectrumPhy (); + // Delete copy constructor and assignment operator to avoid misuse + SpectrumPhy (SpectrumPhy const &) = delete; + SpectrumPhy &operator= (SpectrumPhy const &) = delete; + /** * \brief Get the type ID. * \return the object TypeId @@ -111,35 +115,8 @@ public: * @param params the parameters of the signals being received */ virtual void StartRx (Ptr params) = 0; - -private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - */ - SpectrumPhy (SpectrumPhy const &); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse - * \returns - */ - SpectrumPhy& operator= (SpectrumPhy const &); }; - - - - - - - - } // namespace ns3 - - - - #endif /* SPECTRUM_PHY_H */ diff --git a/src/topology-read/model/inet-topology-reader.h b/src/topology-read/model/inet-topology-reader.h index 2b0f213ee..cb151012e 100644 --- a/src/topology-read/model/inet-topology-reader.h +++ b/src/topology-read/model/inet-topology-reader.h @@ -61,6 +61,10 @@ public: InetTopologyReader (); virtual ~InetTopologyReader (); + // Delete copy constructor and assignment operator to avoid misuse + InetTopologyReader (const InetTopologyReader &) = delete; + InetTopologyReader & operator = (const InetTopologyReader &) = delete; + /** * \brief Main topology reading function. * @@ -75,21 +79,6 @@ public: */ virtual NodeContainer Read (void); -private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse. - */ - InetTopologyReader (const InetTopologyReader&); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse. - * \returns - */ - InetTopologyReader& operator= (const InetTopologyReader&); - // end class InetTopologyReader }; diff --git a/src/topology-read/model/orbis-topology-reader.h b/src/topology-read/model/orbis-topology-reader.h index 54f1e0cca..001f103fb 100644 --- a/src/topology-read/model/orbis-topology-reader.h +++ b/src/topology-read/model/orbis-topology-reader.h @@ -58,6 +58,10 @@ public: OrbisTopologyReader (); virtual ~OrbisTopologyReader (); + // Delete copy constructor and assignment operator to avoid misuse + OrbisTopologyReader (const OrbisTopologyReader &) = delete; + OrbisTopologyReader & operator = (const OrbisTopologyReader &) = delete; + /** * \brief Main topology reading function. * @@ -70,22 +74,6 @@ public: */ virtual NodeContainer Read (void); -private: -private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse. - */ - OrbisTopologyReader (const OrbisTopologyReader&); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse. - * \returns - */ - OrbisTopologyReader& operator= (const OrbisTopologyReader&); - // end class OrbisTopologyReader }; diff --git a/src/topology-read/model/rocketfuel-topology-reader.h b/src/topology-read/model/rocketfuel-topology-reader.h index bb22c6e41..b57bc353d 100644 --- a/src/topology-read/model/rocketfuel-topology-reader.h +++ b/src/topology-read/model/rocketfuel-topology-reader.h @@ -57,6 +57,10 @@ public: RocketfuelTopologyReader (); virtual ~RocketfuelTopologyReader (); + // Delete copy constructor and assignment operator to avoid misuse + RocketfuelTopologyReader (const RocketfuelTopologyReader &) = delete; + RocketfuelTopologyReader & operator = (const RocketfuelTopologyReader &) = delete; + /** * \brief Main topology reading function. * @@ -117,22 +121,6 @@ private: int m_nodesNumber; //!< Number of nodes. std::map > m_nodeMap; //!< Map of the nodes (name, node). -private: - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse. - */ - RocketfuelTopologyReader (const RocketfuelTopologyReader&); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse. - * \returns - */ - RocketfuelTopologyReader& operator= (const RocketfuelTopologyReader&); - - // end class RocketfuelTopologyReader }; diff --git a/src/topology-read/model/topology-reader.h b/src/topology-read/model/topology-reader.h index af9b2ed10..39e07112e 100644 --- a/src/topology-read/model/topology-reader.h +++ b/src/topology-read/model/topology-reader.h @@ -149,6 +149,10 @@ private: TopologyReader (); virtual ~TopologyReader (); + // Delete copy constructor and assignment operator to avoid misuse + TopologyReader (const TopologyReader &) = delete; + TopologyReader & operator = (const TopologyReader &) = delete; + /** * \brief Main topology reading function. * @@ -205,21 +209,6 @@ private: void AddLink (Link link); private: - - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse. - */ - TopologyReader (const TopologyReader&); - /** - * \brief Copy constructor - * - * Defined and unimplemented to avoid misuse. - * \returns - */ - TopologyReader& operator= (const TopologyReader&); - /** * The name of the input file. */ diff --git a/src/traffic-control/helper/traffic-control-helper.h b/src/traffic-control/helper/traffic-control-helper.h index 621c78182..d90086e0b 100644 --- a/src/traffic-control/helper/traffic-control-helper.h +++ b/src/traffic-control/helper/traffic-control-helper.h @@ -48,6 +48,9 @@ public: virtual ~QueueDiscFactory () {} + // Delete default constructor to avoid misuse + QueueDiscFactory () = delete; + /** * \brief Add a factory to create an internal queue * @@ -87,13 +90,6 @@ public: Ptr CreateQueueDisc (const std::vector > & queueDiscs); private: - /** - * \brief Default constructor - * - * Defined and unimplemented to avoid misuse - */ - QueueDiscFactory (); - /// Factory to create this queue disc ObjectFactory m_queueDiscFactory; /// Vector of factories to create internal queues diff --git a/src/traffic-control/model/queue-disc.h b/src/traffic-control/model/queue-disc.h index af69f7b90..16d3b6924 100644 --- a/src/traffic-control/model/queue-disc.h +++ b/src/traffic-control/model/queue-disc.h @@ -288,6 +288,10 @@ public: virtual ~QueueDisc (); + // Delete copy constructor and assignment operator to avoid misuse + QueueDisc (const QueueDisc &) = delete; + QueueDisc & operator = (const QueueDisc &) = delete; + /** * \brief Get the number of packets stored by the queue disc * \return the number of packets stored by the queue disc. @@ -564,23 +568,6 @@ protected: bool Mark (Ptr item, const char* reason); private: - /** - * \brief Copy constructor - * \param o object to copy - * - * Defined and unimplemented to avoid misuse - */ - QueueDisc (const QueueDisc &o); - - /** - * \brief Assignment operator - * \param o object to copy - * \returns the copied object - * - * Defined and unimplemented to avoid misuse - */ - QueueDisc &operator = (const QueueDisc &o); - /** * This function actually enqueues a packet into the queue disc. * \param item item to enqueue diff --git a/src/traffic-control/model/traffic-control-layer.h b/src/traffic-control/model/traffic-control-layer.h index 17c76ed0e..0d2f1ef33 100644 --- a/src/traffic-control/model/traffic-control-layer.h +++ b/src/traffic-control/model/traffic-control-layer.h @@ -109,6 +109,10 @@ public: virtual ~TrafficControlLayer (); + // Delete copy constructor and assignment operator to avoid misuse + TrafficControlLayer (TrafficControlLayer const &) = delete; + TrafficControlLayer & operator = (TrafficControlLayer const &) = delete; + /** * \brief Register an IN handler * @@ -203,17 +207,6 @@ protected: virtual void NotifyNewAggregate (void); private: - /** - * \brief Copy constructor - * Disable default implementation to avoid misuse - */ - TrafficControlLayer (TrafficControlLayer const &); - /** - * \brief Assignment operator - * \return this object - * Disable default implementation to avoid misuse - */ - TrafficControlLayer& operator= (TrafficControlLayer const &); /** * \brief Protocol handler entry. * This structure is used to demultiplex all the protocols. diff --git a/src/traffic-control/test/adaptive-red-queue-disc-test-suite.cc b/src/traffic-control/test/adaptive-red-queue-disc-test-suite.cc index 81c1c7054..56125a2be 100644 --- a/src/traffic-control/test/adaptive-red-queue-disc-test-suite.cc +++ b/src/traffic-control/test/adaptive-red-queue-disc-test-suite.cc @@ -52,22 +52,16 @@ public: */ AredQueueDiscTestItem (Ptr p, const Address & addr); virtual ~AredQueueDiscTestItem (); + + // Delete copy constructor and assignment operator to avoid misuse + AredQueueDiscTestItem (const AredQueueDiscTestItem &) = delete; + AredQueueDiscTestItem & operator = (const AredQueueDiscTestItem &) = delete; + virtual void AddHeader (void); virtual bool Mark(void); private: AredQueueDiscTestItem (); - /** - * \brief Copy constructor - * Disable default implementation to avoid misuse - */ - AredQueueDiscTestItem (const AredQueueDiscTestItem &); - /** - * \brief Assignment operator - * \return this object - * Disable default implementation to avoid misuse - */ - AredQueueDiscTestItem &operator = (const AredQueueDiscTestItem &); }; AredQueueDiscTestItem::AredQueueDiscTestItem (Ptr p, const Address & addr) diff --git a/src/traffic-control/test/cobalt-queue-disc-test-suite.cc b/src/traffic-control/test/cobalt-queue-disc-test-suite.cc index 40958f727..07c40dab7 100644 --- a/src/traffic-control/test/cobalt-queue-disc-test-suite.cc +++ b/src/traffic-control/test/cobalt-queue-disc-test-suite.cc @@ -51,22 +51,17 @@ public: */ CobaltQueueDiscTestItem (Ptr p, const Address & addr,uint16_t protocol, bool ecnCapable); virtual ~CobaltQueueDiscTestItem (); + + // Delete copy constructor and assignment operator to avoid misuse + CobaltQueueDiscTestItem (const CobaltQueueDiscTestItem &) = delete; + CobaltQueueDiscTestItem & operator = (const CobaltQueueDiscTestItem &) = delete; + virtual void AddHeader (void); virtual bool Mark (void); private: CobaltQueueDiscTestItem (); - /** - * \brief Copy constructor - * Disable default implementation to avoid misuse - */ - CobaltQueueDiscTestItem (const CobaltQueueDiscTestItem &); - /** - * \brief Assignment operator - * \return this object - * Disable default implementation to avoid misuse - */ - CobaltQueueDiscTestItem &operator = (const CobaltQueueDiscTestItem &); + bool m_ecnCapablePacket; ///< ECN capable packet? }; diff --git a/src/traffic-control/test/codel-queue-disc-test-suite.cc b/src/traffic-control/test/codel-queue-disc-test-suite.cc index 1e1709fab..8335dd214 100644 --- a/src/traffic-control/test/codel-queue-disc-test-suite.cc +++ b/src/traffic-control/test/codel-queue-disc-test-suite.cc @@ -71,22 +71,17 @@ public: */ CodelQueueDiscTestItem (Ptr p, const Address & addr, bool ecnCapable); virtual ~CodelQueueDiscTestItem (); + + // Delete copy constructor and assignment operator to avoid misuse + CodelQueueDiscTestItem (const CodelQueueDiscTestItem &) = delete; + CodelQueueDiscTestItem & operator = (const CodelQueueDiscTestItem &) = delete; + virtual void AddHeader (void); virtual bool Mark(void); private: CodelQueueDiscTestItem (); - /** - * \brief Copy constructor - * Disable default implementation to avoid misuse - */ - CodelQueueDiscTestItem (const CodelQueueDiscTestItem &); - /** - * \brief Assignment operator - * \return this object - * Disable default implementation to avoid misuse - */ - CodelQueueDiscTestItem &operator = (const CodelQueueDiscTestItem &); + bool m_ecnCapablePacket; ///< ECN capable packet? }; diff --git a/src/traffic-control/test/fifo-queue-disc-test-suite.cc b/src/traffic-control/test/fifo-queue-disc-test-suite.cc index 253171572..83446f61f 100644 --- a/src/traffic-control/test/fifo-queue-disc-test-suite.cc +++ b/src/traffic-control/test/fifo-queue-disc-test-suite.cc @@ -50,22 +50,16 @@ public: */ FifoQueueDiscTestItem (Ptr p, const Address & addr); virtual ~FifoQueueDiscTestItem (); + + // Delete copy constructor and assignment operator to avoid misuse + FifoQueueDiscTestItem (const FifoQueueDiscTestItem &) = delete; + FifoQueueDiscTestItem & operator = (const FifoQueueDiscTestItem &) = delete; + virtual void AddHeader (void); virtual bool Mark (void); private: FifoQueueDiscTestItem (); - /** - * \brief Copy constructor - * Disable default implementation to avoid misuse - */ - FifoQueueDiscTestItem (const FifoQueueDiscTestItem &); - /** - * \brief Assignment operator - * \return this object - * Disable default implementation to avoid misuse - */ - FifoQueueDiscTestItem &operator = (const FifoQueueDiscTestItem &); }; FifoQueueDiscTestItem::FifoQueueDiscTestItem (Ptr p, const Address & addr) diff --git a/src/traffic-control/test/pie-queue-disc-test-suite.cc b/src/traffic-control/test/pie-queue-disc-test-suite.cc index 1d8739e06..369186958 100644 --- a/src/traffic-control/test/pie-queue-disc-test-suite.cc +++ b/src/traffic-control/test/pie-queue-disc-test-suite.cc @@ -50,6 +50,11 @@ public: */ PieQueueDiscTestItem (Ptr p, const Address & addr, bool ecnCapable); virtual ~PieQueueDiscTestItem (); + + // Delete copy constructor and assignment operator to avoid misuse + PieQueueDiscTestItem (const PieQueueDiscTestItem &) = delete; + PieQueueDiscTestItem & operator = (const PieQueueDiscTestItem &) = delete; + virtual void AddHeader (void); virtual bool Mark (void); @@ -73,17 +78,7 @@ public: private: PieQueueDiscTestItem (); - /** - * \brief Copy constructor - * Disable default implementation to avoid misuse - */ - PieQueueDiscTestItem (const PieQueueDiscTestItem &); - /** - * \brief Assignment operator - * \return this object - * Disable default implementation to avoid misuse - */ - PieQueueDiscTestItem &operator = (const PieQueueDiscTestItem &); + bool m_ecnCapablePacket; //!< ECN capable packet? }; diff --git a/src/traffic-control/test/red-queue-disc-test-suite.cc b/src/traffic-control/test/red-queue-disc-test-suite.cc index ccbf90d57..668b21c92 100644 --- a/src/traffic-control/test/red-queue-disc-test-suite.cc +++ b/src/traffic-control/test/red-queue-disc-test-suite.cc @@ -48,22 +48,17 @@ public: */ RedQueueDiscTestItem (Ptr p, const Address & addr, bool ecnCapable); virtual ~RedQueueDiscTestItem (); + + // Delete copy constructor and assignment operator to avoid misuse + RedQueueDiscTestItem (const RedQueueDiscTestItem &) = delete; + RedQueueDiscTestItem & operator = (const RedQueueDiscTestItem &) = delete; + virtual void AddHeader (void); virtual bool Mark(void); private: RedQueueDiscTestItem (); - /** - * \brief Copy constructor - * Disable default implementation to avoid misuse - */ - RedQueueDiscTestItem (const RedQueueDiscTestItem &); - /** - * \brief Assignment operator - * \return this object - * Disable default implementation to avoid misuse - */ - RedQueueDiscTestItem &operator = (const RedQueueDiscTestItem &); + bool m_ecnCapablePacket; ///< ECN capable packet? }; diff --git a/src/traffic-control/test/tbf-queue-disc-test-suite.cc b/src/traffic-control/test/tbf-queue-disc-test-suite.cc index 8e9667a16..a6f19192a 100644 --- a/src/traffic-control/test/tbf-queue-disc-test-suite.cc +++ b/src/traffic-control/test/tbf-queue-disc-test-suite.cc @@ -52,22 +52,16 @@ public: */ TbfQueueDiscTestItem (Ptr p, const Address & addr); virtual ~TbfQueueDiscTestItem (); + + // Delete copy constructor and assignment operator to avoid misuse + TbfQueueDiscTestItem (const TbfQueueDiscTestItem &) = delete; + TbfQueueDiscTestItem & operator = (const TbfQueueDiscTestItem &) = delete; + virtual void AddHeader (void); virtual bool Mark (void); private: TbfQueueDiscTestItem (); - /** - * \brief Copy constructor - * Disable default implementation to avoid misuse - */ - TbfQueueDiscTestItem (const TbfQueueDiscTestItem &); - /** - * \brief Assignment operator - * \return this object - * Disable default implementation to avoid misuse - */ - TbfQueueDiscTestItem &operator = (const TbfQueueDiscTestItem &); }; TbfQueueDiscTestItem::TbfQueueDiscTestItem (Ptr p, const Address & addr) diff --git a/src/traffic-control/test/tc-flow-control-test-suite.cc b/src/traffic-control/test/tc-flow-control-test-suite.cc index 52a2d0931..f5fe96600 100644 --- a/src/traffic-control/test/tc-flow-control-test-suite.cc +++ b/src/traffic-control/test/tc-flow-control-test-suite.cc @@ -55,22 +55,16 @@ public: */ QueueDiscTestItem (Ptr p); virtual ~QueueDiscTestItem (); + + // Delete copy constructor and assignment operator to avoid misuse + QueueDiscTestItem (const QueueDiscTestItem &) = delete; + QueueDiscTestItem & operator = (const QueueDiscTestItem &) = delete; + virtual void AddHeader (void); virtual bool Mark(void); private: QueueDiscTestItem (); - /** - * \brief Copy constructor - * Disable default implementation to avoid misuse - */ - QueueDiscTestItem (const QueueDiscTestItem &); - /** - * \brief Assignment operator - * \return this object - * Disable default implementation to avoid misuse - */ - QueueDiscTestItem &operator = (const QueueDiscTestItem &); }; QueueDiscTestItem::QueueDiscTestItem (Ptr p) diff --git a/src/wifi/model/wifi-net-device.h b/src/wifi/model/wifi-net-device.h index 534a92dab..43c2abb15 100644 --- a/src/wifi/model/wifi-net-device.h +++ b/src/wifi/model/wifi-net-device.h @@ -62,6 +62,10 @@ public: WifiNetDevice (); virtual ~WifiNetDevice (); + // Delete copy constructor and assignment operator to avoid misuse + WifiNetDevice (const WifiNetDevice &o) = delete; + WifiNetDevice &operator = (const WifiNetDevice &) = delete; + /** * \param mac the MAC layer to use. */ @@ -153,23 +157,6 @@ protected: private: - /** - * \brief Copy constructor - * \param o object to copy - * - * Defined and unimplemented to avoid misuse - */ - WifiNetDevice (const WifiNetDevice &o); - - /** - * \brief Assignment operator - * \param o object to copy - * \returns the copied object - * - * Defined and unimplemented to avoid misuse - */ - WifiNetDevice &operator = (const WifiNetDevice &o); - /** * Set that the link is up. A link is always up in ad-hoc mode. * For a STA, a link is up when the STA is associated with an AP.