get rid of Attribute class. Use AttributeValue subclasses directly.

This commit is contained in:
Mathieu Lacage
2008-04-17 13:42:25 -07:00
parent db81db32a8
commit 4ff40c4a07
132 changed files with 1345 additions and 1628 deletions

View File

@@ -32,7 +32,7 @@ TypeId DropTailQueue::GetTypeId (void)
.SetParent<Queue> ()
.AddConstructor<DropTailQueue> ()
.AddAttribute ("MaxPackets", "The maximum number of packets accepted by this DropTailQueue.",
Uinteger (100),
UintegerValue (100),
MakeUintegerAccessor (&DropTailQueue::m_maxPackets),
MakeUintegerChecker<uint32_t> ())
;
@@ -132,7 +132,7 @@ DropTailQueueTest::RunTests (void)
bool result = true;
Ptr<DropTailQueue> queue = CreateObject<DropTailQueue> ();
NS_TEST_ASSERT (queue->SetAttributeFailSafe ("MaxPackets", Uinteger (3)));
NS_TEST_ASSERT (queue->SetAttributeFailSafe ("MaxPackets", UintegerValue (3)));
Ptr<Packet> p1, p2, p3, p4;
p1 = Create<Packet> ();

View File

@@ -62,7 +62,7 @@ NodeListPriv::GetTypeId (void)
static TypeId tid = TypeId ("ns3::NodeListPriv")
.SetParent<Object> ()
.AddAttribute ("NodeList", "The list of all nodes created during the simulation.",
ObjectVector (),
ObjectVectorValue (),
MakeObjectVectorAccessor (&NodeListPriv::m_nodes),
MakeObjectVectorChecker<Node> ())
;

View File

@@ -37,16 +37,16 @@ Node::GetTypeId (void)
static TypeId tid = TypeId ("ns3::Node")
.SetParent<Object> ()
.AddAttribute ("DeviceList", "The list of devices associated to this Node.",
ObjectVector (),
ObjectVectorValue (),
MakeObjectVectorAccessor (&Node::m_devices),
MakeObjectVectorChecker<NetDevice> ())
.AddAttribute ("ApplicationList", "The list of applications associated to this Node.",
ObjectVector (),
ObjectVectorValue (),
MakeObjectVectorAccessor (&Node::m_applications),
MakeObjectVectorChecker<Application> ())
.AddAttribute ("Id", "The id (unique integer) of this Node.",
TypeId::ATTR_GET, // allow only getting it.
Uinteger (0),
UintegerValue (0),
MakeUintegerAccessor (&Node::m_id),
MakeUintegerChecker<uint32_t> ())
;

View File

@@ -32,52 +32,52 @@ Tcp::GetTypeId (void)
.SetParent<SocketFactory> ()
.AddAttribute ("TcpDefaultSegmentSize",
"Default TCP maximum segment size in bytes (may be adjusted based on MTU discovery)",
Uinteger (536),
UintegerValue (536),
MakeUintegerAccessor (&Tcp::m_defaultSegSize),
MakeUintegerChecker<uint32_t> ())
.AddAttribute ("TcpDefaultAdvertisedWindowSize",
"Default TCP advertised window size (bytes)",
Uinteger (0xffff),
UintegerValue (0xffff),
MakeUintegerAccessor (&Tcp::m_defaultAdvWin),
MakeUintegerChecker<uint32_t> ())
.AddAttribute ("TcpDefaultSlowStartThreshold",
"Default TCP slow start threshold (bytes)",
Uinteger (0xffff),
UintegerValue (0xffff),
MakeUintegerAccessor (&Tcp::m_defaultSsThresh),
MakeUintegerChecker<uint32_t> ())
.AddAttribute ("TcpDefaultTxBufferSize",
"Default TCP maximum transmit buffer size (bytes)",
Uinteger (0xffffffffl),
UintegerValue (0xffffffffl),
MakeUintegerAccessor (&Tcp::m_defaultTxBuffer),
MakeUintegerChecker<uint32_t> ())
.AddAttribute ("TcpDefaultRxBufferSize",
"Default TCP maximum receive buffer size (bytes)",
Uinteger (0xffffffffl),
UintegerValue (0xffffffffl),
MakeUintegerAccessor (&Tcp::m_defaultRxBuffer),
MakeUintegerChecker<uint32_t> ())
.AddAttribute ("TcpDefaultInitialCongestionWindowSize",
"Default TCP initial congestion window size (segments)",
Uinteger (1),
UintegerValue (1),
MakeUintegerAccessor (&Tcp::m_defaultInitialCwnd),
MakeUintegerChecker<uint32_t> ())
.AddAttribute ("TcpDefaultConnTimeout",
"Default TCP retransmission timeout when opening connection (seconds)",
Uinteger (3),
UintegerValue (3),
MakeUintegerAccessor (&Tcp::m_defaultConnTimeout),
MakeUintegerChecker<uint32_t> ())
.AddAttribute ("TcpDefaultConnCount",
"Default number of connection attempts (SYN retransmissions) before returning failure",
Uinteger (6),
UintegerValue (6),
MakeUintegerAccessor (&Tcp::m_defaultConnCount),
MakeUintegerChecker<uint32_t> ())
.AddAttribute ("TcpDefaultDelAckTimeout",
"Default timeout value for TCP delayed acks, in seconds",
Double (0.2),
DoubleValue (0.2),
MakeDoubleAccessor (&Tcp::m_defaultDelAckTimeout),
MakeDoubleChecker<double> ())
.AddAttribute ("TcpDefaultDelAckCount",
"Default number of packets to wait before sending a TCP ack",
Uinteger (2),
UintegerValue (2),
MakeUintegerAccessor (&Tcp::m_defaultDelAckCount),
MakeUintegerChecker<uint32_t> ())
;