diff --git a/src/csma-layout/wscript b/src/csma-layout/wscript index c692d3511..a7c7a5c6d 100644 --- a/src/csma-layout/wscript +++ b/src/csma-layout/wscript @@ -14,5 +14,5 @@ def build(bld): if bld.env['ENABLE_EXAMPLES']: bld.add_subdirs('examples') - #bld.ns3_python_bindings() + bld.ns3_python_bindings() diff --git a/src/csma/model/csma-channel.cc b/src/csma/model/csma-channel.cc index 8291f2360..a95fbe436 100644 --- a/src/csma/model/csma-channel.cc +++ b/src/csma/model/csma-channel.cc @@ -58,6 +58,12 @@ CsmaChannel::CsmaChannel () m_deviceList.clear (); } +CsmaChannel::~CsmaChannel () +{ + NS_LOG_FUNCTION (this); + m_deviceList.clear (); +} + int32_t CsmaChannel::Attach (Ptr device) { @@ -345,6 +351,12 @@ CsmaDeviceRec::CsmaDeviceRec (Ptr device) active = true; } +CsmaDeviceRec::CsmaDeviceRec (CsmaDeviceRec const &deviceRec) +{ + devicePtr = deviceRec.devicePtr; + active = deviceRec.active; +} + bool CsmaDeviceRec::IsActive () { diff --git a/src/csma/model/csma-channel.h b/src/csma/model/csma-channel.h index 7e0f2c9bf..79b50cac6 100644 --- a/src/csma/model/csma-channel.h +++ b/src/csma/model/csma-channel.h @@ -45,6 +45,7 @@ public: CsmaDeviceRec(); CsmaDeviceRec(Ptr< CsmaNetDevice > device); + CsmaDeviceRec (CsmaDeviceRec const &); /** * \return If the net device pointed to by the devicePtr is active @@ -81,6 +82,10 @@ public: * \brief Create a CsmaChannel */ CsmaChannel (); + /** + * \brief Destroy a CsmaChannel + */ + virtual ~CsmaChannel (); /** * \brief Attach a given netdevice to this channel @@ -269,6 +274,9 @@ public: Time GetDelay (void); private: + // Avoid implicit copy constructor and assignment (python bindings issues) + CsmaChannel (CsmaChannel const &); + CsmaChannel &operator = (CsmaChannel const &); /** * The assigned data rate of the channel