NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ndn-face-container.cpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
20 #include "ndn-face-container.hpp"
21 
22 #include <algorithm>
23 
24 namespace ns3 {
25 namespace ndn {
26 
28 {
29 }
30 
32 {
33  AddAll(other);
34 }
35 
38 {
39  m_faces.clear();
40  AddAll(other);
41 
42  return *this;
43 }
44 
45 void
46 FaceContainer::AddAll(Ptr<FaceContainer> other)
47 {
48  AddAll(*other);
49 }
50 
51 void
53 {
54  m_faces.insert(m_faces.end(), other.m_faces.begin(), other.m_faces.end());
55 }
56 
59 {
60  return m_faces.begin();
61 }
62 
64 FaceContainer::End(void) const
65 {
66  return m_faces.end();
67 }
68 
69 uint32_t
71 {
72  return m_faces.size();
73 }
74 
75 // void
76 // FaceContainer::SetMetricToAll (uint16_t metric)
77 // {
78 // for (FaceContainer::iterator it=m_faces.begin ();
79 // it != m_faces.end ();
80 // it++)
81 // {
82 // (*it)->SetMetric (metric);
83 // }
84 // }
85 
86 void
87 FaceContainer::Add(const shared_ptr<Face>& face)
88 {
89  m_faces.push_back(face);
90 }
91 
92 shared_ptr<Face>
94 {
95  return *i;
96 }
97 
98 } // namespace ndn
99 } // namespace ns3
void AddAll(Ptr< FaceContainer > other)
Add all entries from other container.
void Add(const shared_ptr< Face > &face)
Set a metric for all faces in the container.
FaceContainer & operator=(const FaceContainer &other)
Copy operator for FaceContainer.
Iterator Begin() const
Get an iterator which refers to the first pair in the container.
shared_ptr< Face > Get(Iterator i) const
Get a smart pointer to Face-derived object stored in the container.
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
uint32_t GetN() const
Get the number of faces stored in this container.
A pool for Ndn faces.
FaceContainer()
Create an empty FaceContainer.
Container::const_iterator Iterator
Iterator over FaceContainer.