add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.

This commit is contained in:
Mathieu Lacage committed 2008-01-02 09:09:24 +01:00
1 parent 906a9748b5
commit 6b0e717a19
77 files changed
+403 -359

No files matched your search

-2
View File
@@ -30,7 +30,6 @@ Channel::Channel ()
: m_name("Channel")
{
NS_LOG_FUNCTION;
SetInterfaceId (Channel::iid);
}
Channel::Channel (std::string name)
@@ -38,7 +37,6 @@ Channel::Channel (std::string name)
{
NS_LOG_FUNCTION;
NS_LOG_PARAMS (this << name);
SetInterfaceId (Channel::iid);
}
Channel::~Channel ()
+1 -3
View File
@@ -28,9 +28,7 @@ namespace ns3 {
const InterfaceId Ipv4::iid = MakeInterfaceId ("Ipv4", Object::iid);
Ipv4::Ipv4 ()
{
SetInterfaceId (Ipv4::iid);
}
{}
Ipv4::~Ipv4 ()
{}
-1
View File
@@ -47,7 +47,6 @@ NetDevice::NetDevice(Ptr<Node> node, const Address& addr) :
m_isPointToPoint (false)
{
NS_LOG_FUNCTION;
SetInterfaceId (NetDevice::iid);
m_node->AddDevice (this);
}
+1 -2
View File
@@ -106,9 +106,8 @@ Node::Node(uint32_t sid)
void
Node::Construct (void)
{
SetInterfaceId (Node::iid);
m_id = NodeList::Add (this);
Ptr<PacketSocketFactory> socketFactory = Create<PacketSocketFactory> ();
Ptr<PacketSocketFactory> socketFactory = CreateObject<PacketSocketFactory> ();
AddInterface (socketFactory);
}
+2 -4
View File
@@ -28,14 +28,12 @@ const InterfaceId PacketSocketFactory::iid = MakeInterfaceId ("Packet",
SocketFactory::iid);
PacketSocketFactory::PacketSocketFactory ()
{
SetInterfaceId (PacketSocketFactory::iid);
}
{}
Ptr<Socket> PacketSocketFactory::CreateSocket (void)
{
Ptr<Node> node = QueryInterface<Node> (Node::iid);
Ptr<PacketSocket> socket = Create<PacketSocket> (node);
Ptr<PacketSocket> socket = CreateObject<PacketSocket> (node);
return socket;
}
} // namespace ns3
-1
View File
@@ -106,7 +106,6 @@ Queue::Queue() :
m_nTotalDroppedPackets(0)
{
NS_LOG_FUNCTION;
SetInterfaceId (Queue::iid);
}
Queue::~Queue()
+1 -3
View File
@@ -25,8 +25,6 @@ namespace ns3 {
const InterfaceId SocketFactory::iid = MakeInterfaceId ("SocketFactory", Object::iid);
SocketFactory::SocketFactory ()
{
SetInterfaceId (SocketFactory::iid);
}
{}
} // namespace ns3
+1 -3
View File
@@ -25,8 +25,6 @@ namespace ns3 {
const InterfaceId Udp::iid = MakeInterfaceId ("Udp", SocketFactory::iid);
Udp::Udp ()
{
SetInterfaceId (Udp::iid);
}
{}
} // namespace ns3