remove Application::Copy

This commit is contained in:
Mathieu Lacage
2007-05-13 10:02:10 +02:00
parent 87112f46f7
commit b1574fba1a
4 changed files with 1 additions and 44 deletions

View File

@@ -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()
{

View File

@@ -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();

View File

@@ -41,19 +41,6 @@ Application::Application(Ptr<Node> 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

View File

@@ -62,12 +62,8 @@ class Application : public Object
{
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