merge with HEAD
This commit is contained in:
commit
681415672a
22 files changed
+1774
-49
No files matched your search
@@ -28,6 +28,8 @@ static class QueueStackInitializationClass {
|
||||
public:
|
||||
QueueStackInitializationClass () {
|
||||
Queue::Default (DropTailQueue ());
|
||||
static DropTailQueue queue;
|
||||
Queue::AddDefault (queue, "DropTail");
|
||||
}
|
||||
} queue_stack_initialization_class;
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "ns3/debug.h"
|
||||
#include "ns3/composite-trace-resolver.h"
|
||||
#include "queue.h"
|
||||
#include "ns3/default-value.h"
|
||||
|
||||
NS_DEBUG_COMPONENT_DEFINE ("Queue");
|
||||
|
||||
@@ -209,4 +210,47 @@ Queue& Queue::Default()
|
||||
return *defaultQueue;
|
||||
}
|
||||
|
||||
|
||||
Queue *
|
||||
Queue::CreateDefault (void)
|
||||
{
|
||||
std::string defaultValue = GetDefault ()->GetValue ();
|
||||
for (List::iterator i = GetList ()->begin ();
|
||||
i != GetList ()->end (); i++)
|
||||
{
|
||||
if (i->second == defaultValue)
|
||||
{
|
||||
return i->first->Copy ();
|
||||
}
|
||||
}
|
||||
NS_ASSERT (false);
|
||||
// quiet compiler
|
||||
return 0;
|
||||
}
|
||||
void
|
||||
Queue::Add (Queue &queue, const std::string &name)
|
||||
{
|
||||
GetDefault ()->AddPossibleValue (name);
|
||||
GetList ()->push_back (std::make_pair (&queue, name));
|
||||
}
|
||||
void
|
||||
Queue::AddDefault (Queue &queue, const std::string &name)
|
||||
{
|
||||
GetDefault ()->AddDefaultValue (name);
|
||||
GetList ()->push_back (std::make_pair (&queue, name));
|
||||
}
|
||||
StringEnumDefaultValue *
|
||||
Queue::GetDefault (void)
|
||||
{
|
||||
static StringEnumDefaultValue value ("queue", "Packet Queue");
|
||||
return &value;
|
||||
}
|
||||
Queue::List *
|
||||
Queue::GetList (void)
|
||||
{
|
||||
static List list;
|
||||
return &list;
|
||||
}
|
||||
|
||||
|
||||
}; // namespace ns3
|
||||
@@ -26,12 +26,15 @@
|
||||
#define QUEUE_H
|
||||
|
||||
#include <string>
|
||||
#include <list>
|
||||
#include "ns3/packet.h"
|
||||
#include "ns3/callback-trace-source.h"
|
||||
#include "ns3/trace-resolver.h"
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
class StringEnumDefaultValue;
|
||||
|
||||
class Queue
|
||||
{
|
||||
public:
|
||||
@@ -108,6 +111,15 @@ private:
|
||||
uint32_t m_nTotalDroppedBytes;
|
||||
uint32_t m_nTotalDroppedPackets;
|
||||
|
||||
public:
|
||||
static Queue *CreateDefault (void);
|
||||
static void Add (Queue &queue, const std::string &name);
|
||||
static void AddDefault (Queue &queue, const std::string &name);
|
||||
private:
|
||||
typedef std::list<std::pair<Queue *,std::string> > List;
|
||||
static StringEnumDefaultValue *GetDefault (void);
|
||||
static List *GetList (void);
|
||||
|
||||
public:
|
||||
// Static methods to manage queue default
|
||||
// Set desired queue default
|
||||
|
||||
Reference in new issue
Block a user