replace ComponentManager::Create and ClassId with InterfaceId::CreateObjest and InterfaceId
This commit is contained in:
@@ -24,6 +24,8 @@ NS_LOG_COMPONENT_DEFINE ("Channel");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (Channel);
|
||||
|
||||
InterfaceId
|
||||
Channel::iid (void)
|
||||
{
|
||||
|
||||
@@ -24,9 +24,15 @@ NS_LOG_COMPONENT_DEFINE ("DropTailQueue");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
const ClassId DropTailQueue::cid =
|
||||
MakeClassId<DropTailQueue> ("DropTailQueue", Queue::iid ());
|
||||
NS_OBJECT_ENSURE_REGISTERED (DropTailQueue);
|
||||
|
||||
InterfaceId DropTailQueue::iid (void)
|
||||
{
|
||||
static InterfaceId iid = InterfaceId ("DropTailQueue")
|
||||
.SetParent<Queue> ()
|
||||
.AddConstructor<DropTailQueue> ();
|
||||
return iid;
|
||||
}
|
||||
|
||||
DropTailQueue::DropTailQueue () :
|
||||
Queue (),
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include <queue>
|
||||
#include "ns3/packet.h"
|
||||
#include "ns3/queue.h"
|
||||
#include "ns3/component-manager.h"
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
@@ -36,7 +35,7 @@ const int DTQ_NPACKETS_MAX_DEFAULT = 100;
|
||||
*/
|
||||
class DropTailQueue : public Queue {
|
||||
public:
|
||||
static const ClassId cid;
|
||||
static InterfaceId iid (void);
|
||||
/**
|
||||
* \brief DropTailQueue Constructor
|
||||
*
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (Ipv4);
|
||||
|
||||
InterfaceId
|
||||
Ipv4::iid (void)
|
||||
{
|
||||
|
||||
@@ -33,6 +33,8 @@ NS_LOG_COMPONENT_DEFINE ("NetDevice");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (NetDevice);
|
||||
|
||||
InterfaceId NetDevice::iid (void)
|
||||
{
|
||||
static InterfaceId iid = InterfaceId ("NetDevice")
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
namespace ns3{
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (Node);
|
||||
|
||||
InterfaceId
|
||||
Node::iid (void)
|
||||
{
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (PacketSocketFactory);
|
||||
|
||||
InterfaceId
|
||||
PacketSocketFactory::iid (void)
|
||||
{
|
||||
|
||||
@@ -20,15 +20,17 @@
|
||||
#include "ns3/log.h"
|
||||
#include "ns3/composite-trace-resolver.h"
|
||||
#include "ns3/default-value.h"
|
||||
#include "ns3/component-manager.h"
|
||||
#include "ns3/interface-id-default-value.h"
|
||||
#include "queue.h"
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("Queue");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
static ClassIdDefaultValue g_classIdDefaultValue ("Queue", "Packet Queue",
|
||||
Queue::iid (), "DropTailQueue");
|
||||
static InterfaceIdDefaultValue g_interfaceIdDefaultValue ("Queue", "Packet Queue",
|
||||
Queue::iid (), "DropTailQueue");
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (Queue);
|
||||
|
||||
|
||||
std::string
|
||||
@@ -281,8 +283,8 @@ Ptr<Queue>
|
||||
Queue::CreateDefault (void)
|
||||
{
|
||||
NS_LOG_FUNCTION;
|
||||
ClassId classId = g_classIdDefaultValue.GetValue ();
|
||||
Ptr<Queue> queue = ComponentManager::Create<Queue> (classId);
|
||||
InterfaceId interfaceId = g_interfaceIdDefaultValue.GetValue ();
|
||||
Ptr<Queue> queue = interfaceId.CreateObject ()->QueryInterface<Queue> ();
|
||||
return queue;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (SocketFactory);
|
||||
|
||||
InterfaceId SocketFactory::iid (void)
|
||||
{
|
||||
static InterfaceId iid = InterfaceId ("SocketFactory")
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (Udp);
|
||||
|
||||
InterfaceId Udp::iid (void)
|
||||
{
|
||||
static InterfaceId iid = InterfaceId ("Udp")
|
||||
|
||||
Reference in New Issue
Block a user