Small update of PIT. Now pit implementation is policy-templated.
Three versions are explicitly instantiated:
- CcnxPitImpl<persistent_policy_traits> ("ns3::CcnxPit")
- CcnxPitImpl<random_policy_traits> ("ns3::CcnxPitRandom")
- CcnxPitImpl<lru_policy_traits> ("ns3::CcnxPitLru")
diff --git a/utils/fifo-policy.h b/utils/fifo-policy.h
index 7a61721..7286524 100644
--- a/utils/fifo-policy.h
+++ b/utils/fifo-policy.h
@@ -71,7 +71,7 @@
inline bool
insert (typename parent_trie::iterator item)
{
- if (policy_container::size () >= max_size_)
+ if (max_size_ != 0 && policy_container::size () >= max_size_)
{
base_.erase (&(*policy_container::begin ()));
}
diff --git a/utils/lru-policy.h b/utils/lru-policy.h
index 92a9953..f828801 100644
--- a/utils/lru-policy.h
+++ b/utils/lru-policy.h
@@ -73,7 +73,7 @@
inline bool
insert (typename parent_trie::iterator item)
{
- if (policy_container::size () >= max_size_)
+ if (max_size_ != 0 && policy_container::size () >= max_size_)
{
base_.erase (&(*policy_container::begin ()));
}
diff --git a/utils/random-policy.h b/utils/random-policy.h
index 288cd74..2b17fb9 100644
--- a/utils/random-policy.h
+++ b/utils/random-policy.h
@@ -98,7 +98,7 @@
{
get_order (item) = u_rand.GetValue ();
- if (policy_container::size () >= max_size_)
+ if (max_size_ != 0 && policy_container::size () >= max_size_)
{
if (MemberHookLess<Container>() (*item, *policy_container::begin ()))
{