remove Application::Copy
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Sun, 13 May 2007 10:02:10 +0200
changeset 587 8d2fd4c1bb7a
parent 586 6220d0040d50
child 588 639ee55495ec
remove Application::Copy
src/applications/onoff-application.cc
src/applications/onoff-application.h
src/node/application.cc
src/node/application.h
--- a/src/applications/onoff-application.cc	Sun May 13 09:58:53 2007 +0200
+++ b/src/applications/onoff-application.cc	Sun May 13 10:02:10 2007 +0200
@@ -194,11 +194,6 @@
     }
 }
 
-OnOffApplication* OnOffApplication::Copy() const
-{
-  return new OnOffApplication(*this);
-}
-
 // Event handlers
 void OnOffApplication::StartSending()
 {
--- a/src/applications/onoff-application.h	Sun May 13 09:58:53 2007 +0200
+++ b/src/applications/onoff-application.h	Sun May 13 10:02:10 2007 +0200
@@ -53,7 +53,6 @@
   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();
--- a/src/node/application.cc	Sun May 13 09:58:53 2007 +0200
+++ b/src/node/application.cc	Sun May 13 10:02:10 2007 +0200
@@ -41,19 +41,6 @@
 {
   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 @@
   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
--- a/src/node/application.h	Sun May 13 09:58:53 2007 +0200
+++ b/src/node/application.h	Sun May 13 10:02:10 2007 +0200
@@ -62,12 +62,8 @@
 {
 public:
   Application(Ptr<Node>);
-  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