port code from Interface to Object

This commit is contained in:
Mathieu Lacage committed 2007-05-25 10:56:03 +02:00
1 parent daabafbbec
commit 53893fa3c9
23 files changed
+78 -72

No files matched your search

+5 -5
View File
@@ -27,19 +27,19 @@ NS_DEBUG_COMPONENT_DEFINE ("Channel");
namespace ns3 {
const InterfaceId Channel::iid ("Channel");
const InterfaceId Channel::iid = MakeInterfaceId ("Channel", Object::iid);
Channel::Channel ()
: Interface (Channel::iid),
m_name("Channel")
: m_name("Channel")
{
SetInterfaceId (Channel::iid);
NS_DEBUG("Channel::Channel ()");
}
Channel::Channel (std::string name)
: Interface (Channel::iid),
m_name(name)
: m_name(name)
{
SetInterfaceId (Channel::iid);
NS_DEBUG("Channel::Channel (" << name << ")");
}
+2 -2
View File
@@ -24,7 +24,7 @@
#include <string>
#include <stdint.h>
#include "ns3/interface.h"
#include "ns3/object.h"
#include "ns3/ptr.h"
namespace ns3 {
@@ -37,7 +37,7 @@ class NetDevice;
* A channel is a logical path over which information flows. The path can
* be as simple as a short piece of wire, or as complicated as space-time.
*/
class Channel : public Interface
class Channel : public Object
{
public:
static const InterfaceId iid;
+4 -3
View File
@@ -22,11 +22,12 @@
namespace ns3 {
const InterfaceId IIpv4::iid ("IIpv4");
const InterfaceId IIpv4::iid = MakeInterfaceId ("IIpv4", Object::iid);
IIpv4::IIpv4 ()
: Interface (IIpv4::iid)
{}
{
SetInterfaceId (IIpv4::iid);
}
IIpv4::~IIpv4 ()
{}
+2 -2
View File
@@ -23,7 +23,7 @@
#include <stdint.h>
#include "ns3/ipv4-address.h"
#include "ns3/interface.h"
#include "ns3/object.h"
namespace ns3 {
@@ -40,7 +40,7 @@ class Ipv4Route;
* This class also allows you to control the content of the ipv4
* forwarding table.
*/
class IIpv4 : public Interface
class IIpv4 : public Object
{
public:
static const InterfaceId iid;
+6 -6
View File
@@ -30,21 +30,21 @@
namespace ns3{
const InterfaceId INode::iid ("INode");
const InterfaceId INode::iid = MakeInterfaceId ("INode", Object::iid);
INode::INode()
: Interface (INode::iid),
m_id(0),
: m_id(0),
m_sid(0)
{
SetInterfaceId (INode::iid);
m_id = NodeList::Add (this);
}
INode::INode(uint32_t sid)
: Interface (INode::iid),
m_id(0),
: m_id(0),
m_sid(sid)
{
SetInterfaceId (INode::iid);
m_id = NodeList::Add (this);
}
@@ -126,7 +126,7 @@ void INode::DoDispose()
*i = 0;
}
m_applications.clear ();
Interface::DoDispose ();
Object::DoDispose ();
}
}//namespace ns3
+2 -2
View File
@@ -27,7 +27,7 @@
#include <vector>
#include "ns3/interface.h"
#include "ns3/object.h"
namespace ns3 {
@@ -53,7 +53,7 @@ class Application;
*
* Every INode created is added to the NodeList automatically.
*/
class INode : public Interface
class INode : public Object
{
public:
static const InterfaceId iid;
+4 -3
View File
@@ -22,10 +22,11 @@
namespace ns3 {
const InterfaceId ISocketFactory::iid ("ISocketFactory");
const InterfaceId ISocketFactory::iid = MakeInterfaceId ("ISocketFactory", Object::iid);
ISocketFactory::ISocketFactory ()
: Interface (ISocketFactory::iid)
{}
{
SetInterfaceId (ISocketFactory::iid);
}
} // namespace ns3
+2 -2
View File
@@ -21,14 +21,14 @@
#ifndef I_SOCKET_FACTORY_H
#define I_SOCKET_FACTORY_H
#include "ns3/interface.h"
#include "ns3/object.h"
#include "ns3/ptr.h"
namespace ns3 {
class Socket;
class ISocketFactory : public Interface
class ISocketFactory : public Object
{
public:
static const InterfaceId iid;
+2 -2
View File
@@ -22,11 +22,11 @@
namespace ns3 {
const InterfaceId IUdp::iid ("IUdp");
const InterfaceId IUdp::iid = MakeInterfaceId ("IUdp", ISocketFactory::iid);
IUdp::IUdp ()
{
AddSelfInterface (IUdp::iid, this);
SetInterfaceId (IUdp::iid);
}
} // namespace ns3
+3 -3
View File
@@ -21,7 +21,7 @@
#include <iostream>
#include "ns3/assert.h"
#include "ns3/interface.h"
#include "ns3/object.h"
#include "channel.h"
#include "net-device.h"
@@ -30,10 +30,9 @@
namespace ns3 {
const InterfaceId NetDevice::iid ("NetDevice");
const InterfaceId NetDevice::iid = MakeInterfaceId ("NetDevice", Object::iid);
NetDevice::NetDevice(Ptr<INode> node, const MacAddress& addr) :
Interface (NetDevice::iid),
m_node (node),
m_name(""),
m_ifIndex (0),
@@ -44,6 +43,7 @@ NetDevice::NetDevice(Ptr<INode> node, const MacAddress& addr) :
m_isMulticast (false),
m_isPointToPoint (false)
{
SetInterfaceId (NetDevice::iid);
m_node->AddDevice (this);
}
+2 -2
View File
@@ -25,7 +25,7 @@
#include <stdint.h>
#include "ns3/callback.h"
#include "ns3/packet.h"
#include "ns3/interface.h"
#include "ns3/object.h"
#include "ns3/ptr.h"
#include "mac-address.h"
@@ -55,7 +55,7 @@ class Channel;
* this base class and implement your own version of the
* NetDevice::SendTo method.
*/
class NetDevice : public Interface
class NetDevice : public Object
{
public:
static const InterfaceId iid;
+2 -2
View File
@@ -27,10 +27,9 @@ NS_DEBUG_COMPONENT_DEFINE ("Queue");
namespace ns3 {
const InterfaceId Queue::iid ("Queue");
const InterfaceId Queue::iid = MakeInterfaceId ("Queue", Object::iid);
Queue::Queue() :
Interface (Queue::iid),
m_nBytes(0),
m_nTotalReceivedBytes(0),
m_nPackets(0),
@@ -38,6 +37,7 @@ Queue::Queue() :
m_nTotalDroppedBytes(0),
m_nTotalDroppedPackets(0)
{
SetInterfaceId (Queue::iid);
NS_DEBUG("Queue::Queue ()");
}
+2 -2
View File
@@ -28,7 +28,7 @@
#include <string>
#include <list>
#include "ns3/packet.h"
#include "ns3/interface.h"
#include "ns3/object.h"
#include "ns3/callback-trace-source.h"
#include "ns3/trace-resolver.h"
@@ -41,7 +41,7 @@ class StringEnumDefaultValue;
*
* This class defines the base APIs for packet queues in the ns-3 system
*/
class Queue : public Interface
class Queue : public Object
{
public:
static const InterfaceId iid;