From b1574fba1aa4fea6f0ef5c555f04a5bda749d43a Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Sun, 13 May 2007 10:02:10 +0200 Subject: [PATCH] remove Application::Copy --- src/applications/onoff-application.cc | 5 ---- src/applications/onoff-application.h | 1 - src/node/application.cc | 35 +-------------------------- src/node/application.h | 4 --- 4 files changed, 1 insertion(+), 44 deletions(-) diff --git a/src/applications/onoff-application.cc b/src/applications/onoff-application.cc index 347399791..cd7cd492f 100644 --- a/src/applications/onoff-application.cc +++ b/src/applications/onoff-application.cc @@ -194,11 +194,6 @@ void OnOffApplication::StopApplication() // Called at time specified by Stop } } -OnOffApplication* OnOffApplication::Copy() const -{ - return new OnOffApplication(*this); -} - // Event handlers void OnOffApplication::StartSending() { diff --git a/src/applications/onoff-application.h b/src/applications/onoff-application.h index 66fff3916..661fa225e 100644 --- a/src/applications/onoff-application.h +++ b/src/applications/onoff-application.h @@ -53,7 +53,6 @@ public: virtual ~OnOffApplication(); // Destructor virtual void StartApplication(); // Called at time specified by Start virtual void StopApplication(); // Called at time specified by Stop - virtual OnOffApplication* Copy() const;// Make a copy of the application // Event handlers void StartSending(); diff --git a/src/node/application.cc b/src/node/application.cc index ed4fc7ecd..399c4322c 100644 --- a/src/node/application.cc +++ b/src/node/application.cc @@ -41,19 +41,6 @@ Application::Application(Ptr n) { m_node->AddApplication (this); } - -Application::Application(const Application& o) - : m_node(0), m_startVar(0), m_stopVar(0), - m_start(false), m_stop(false) -{ // Copy constructor - m_node = o.m_node; - // Copy the start and stop random variables if they exist - if (o.m_startVar) m_startVar = o.m_startVar->Copy(); - if (o.m_stopVar) m_stopVar = o.m_stopVar->Copy(); - if (o.m_start) ScheduleStart(); - if (o.m_stop) ScheduleStop(); -} - // \brief Application Destructor Application::~Application() @@ -77,27 +64,7 @@ Application::DoDispose (void) m_startVar = 0; delete m_stopVar; m_stopVar = 0; -} - -Application& Application::operator=(const Application& rhs) -{ - if (this == &rhs) return *this; // Self assignment - m_node = rhs.m_node; - - delete m_startVar; - m_startVar = 0; - if (rhs.m_startVar) m_startVar = rhs.m_startVar->Copy(); - - delete m_stopVar; - m_stopVar = 0; - if (rhs.m_stopVar) m_stopVar = rhs.m_stopVar->Copy(); - - m_start = false; - if (rhs.m_start) ScheduleStart(); - if (rhs.m_stop) ScheduleStop(); - return *this; -} - +} // \brief Specify application start time // The virtual method STartApp will be called at the time diff --git a/src/node/application.h b/src/node/application.h index 83c16a31f..204591696 100644 --- a/src/node/application.h +++ b/src/node/application.h @@ -62,12 +62,8 @@ class Application : public Object { public: Application(Ptr); - Application(const Application&); // Copy constructor - Application& operator=(const Application&); // Assignment operator virtual ~Application(); - virtual Application* Copy() const = 0; // All applications must provide - // \brief Specify application start time // Applications start at various times in the simulation scenario. // The Start method specifies when the application should be