remove external NetDeviceList and use the Node's integrated list

This commit is contained in:
Mathieu Lacage committed 2007-04-30 10:21:49 +02:00
1 parent f856c72ac2
commit 6d1fbb99fa
8 files changed
+2 -132

No files matched your search

-11
View File
@@ -44,7 +44,6 @@ public:
InternetNode::InternetNode()
{
// Instantiate the capabilities
m_netDevices = new NetDeviceList();
m_applicationList = new ApplicationList();
m_l3Demux = new L3Demux(this);
m_ipv4L4Demux = new Ipv4L4Demux(this);
@@ -55,7 +54,6 @@ InternetNode::InternetNode()
InternetNode::InternetNode (InternetNode const &o)
{
m_netDevices = new NetDeviceList ();
m_applicationList = new ApplicationList();
m_l3Demux = o.m_l3Demux->Copy (this);
m_ipv4L4Demux = o.m_ipv4L4Demux->Copy (this);
@@ -63,11 +61,9 @@ InternetNode::InternetNode (InternetNode const &o)
InternetNode const &
InternetNode::operator = (InternetNode const &o)
{
delete m_netDevices;
delete m_applicationList;
delete m_l3Demux;
delete m_ipv4L4Demux;
m_netDevices = new NetDeviceList ();
m_l3Demux = o.m_l3Demux->Copy (this);
m_ipv4L4Demux = o.m_ipv4L4Demux->Copy (this);
return *this;
@@ -75,7 +71,6 @@ InternetNode::operator = (InternetNode const &o)
InternetNode::~InternetNode ()
{
delete m_netDevices;
delete m_applicationList;
delete m_l3Demux;
delete m_ipv4L4Demux;
@@ -112,12 +107,6 @@ InternetNode::CreateTraceResolver (TraceContext const &context)
}
NetDeviceList*
InternetNode::GetNetDeviceList() const
{
return m_netDevices;
}
ApplicationList*
InternetNode::GetApplicationList() const
{
-2
View File
@@ -47,7 +47,6 @@ public:
virtual InternetNode* Copy() const;
virtual TraceResolver *CreateTraceResolver (TraceContext const &context);
// Capability access
virtual NetDeviceList* GetNetDeviceList() const;
virtual ApplicationList* GetApplicationList() const;
virtual L3Demux* GetL3Demux() const;
virtual Ipv4L4Demux* GetIpv4L4Demux() const;
@@ -59,7 +58,6 @@ public:
private:
virtual void DoAddDevice (NetDevice *device) const;
// Capabilities
NetDeviceList* m_netDevices;
ApplicationList* m_applicationList;
L3Demux* m_l3Demux;
Ipv4L4Demux* m_ipv4L4Demux;
-50
View File
@@ -1,50 +0,0 @@
// -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*-
//
// Copyright (c) 2006 Georgia Tech Research Corporation
// All rights reserved.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation;
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// Author: George F. Riley<riley@ece.gatech.edu>
//
// Manages the list of network device interfaces associated with a node.
// George F. Riley, Georgia Tech, Spring 2007
#include "net-device-list.h"
namespace ns3 {
NetDeviceList::NetDeviceList()
{}
NetDeviceList::~NetDeviceList()
{
// XXX shall I delete each NetDevice ?
}
void
NetDeviceList::Add(NetDevice *device)
{
m_netdevices.push_back (device);
}
NetDeviceList::Iterator
NetDeviceList::Begin () const
{
return m_netdevices.begin ();
}
NetDeviceList::Iterator
NetDeviceList::End () const
{
return m_netdevices.end ();
}
}//namespace ns3
-50
View File
@@ -1,50 +0,0 @@
// -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*-
//
// Copyright (c) 2006 Georgia Tech Research Corporation
// All rights reserved.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation;
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// Author: George F. Riley<riley@ece.gatech.edu>
//
// Manages the list of network device interfaces associated with a node.
// George F. Riley, Georgia Tech, Spring 2007
#ifndef NET_DEVICE_LIST_H
#define NET_DEVICE_LIST_H
#include <vector>
namespace ns3{
class NetDevice;
class NetDeviceList {
public:
typedef std::vector<NetDevice *>::const_iterator Iterator;
NetDeviceList();
~NetDeviceList();
// Manage the list
void Add(NetDevice *device);
NetDeviceList::Iterator Begin () const;
NetDeviceList::Iterator End () const;
public:
typedef std::vector<NetDevice *> NetDevices_t;
NetDevices_t m_netdevices;
};
} //namespace ns3
#endif
-6
View File
@@ -148,12 +148,6 @@ ApplicationList* Node::GetApplicationList() const
return 0;
}
NetDeviceList*
Node::GetNetDeviceList() const
{
return 0;
}
Ipv4 *
Node::GetIpv4 (void) const
{
-2
View File
@@ -88,7 +88,6 @@ namespace ns3 {
class NodeList;
class NetDeviceList;
class ApplicationList;
// The below five may be encapsulated/abstracted in a Kernel or Stack class
@@ -180,7 +179,6 @@ public:
// null capability exists.
virtual L3Demux* GetL3Demux() const;
virtual Ipv4L4Demux* GetIpv4L4Demux() const;
virtual NetDeviceList* GetNetDeviceList() const;
virtual ApplicationList* GetApplicationList() const;
virtual Ipv4 * GetIpv4 (void) const;
virtual Udp * GetUdp (void) const;