NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
•
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
27
FaceContainer::FaceContainer
()
28
{
29
}
30
31
FaceContainer::FaceContainer
(
const
FaceContainer
& other)
32
{
33
AddAll
(other);
34
}
35
36
FaceContainer
&
37
FaceContainer::operator=
(
const
FaceContainer
&other)
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
52
FaceContainer::AddAll
(
const
FaceContainer
& other)
53
{
54
m_faces.insert(m_faces.end(), other.m_faces.begin(), other.m_faces.end());
55
}
56
57
FaceContainer::Iterator
58
FaceContainer::Begin
(
void
)
const
59
{
60
return
m_faces.begin();
61
}
62
63
FaceContainer::Iterator
64
FaceContainer::End
(
void
)
const
65
{
66
return
m_faces.end();
67
}
68
69
uint32_t
70
FaceContainer::GetN
(
void
)
const
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>
93
FaceContainer::Get
(
FaceContainer::Iterator
i)
const
94
{
95
return
*i;
96
}
97
98
}
// namespace ndn
99
}
// namespace ns3
ns3::ndn::FaceContainer::AddAll
void AddAll(Ptr< FaceContainer > other)
Add all entries from other container.
Definition:
ndn-face-container.cpp:46
ns3::ndn::FaceContainer::Add
void Add(const shared_ptr< Face > &face)
Set a metric for all faces in the container.
Definition:
ndn-face-container.cpp:87
ns3::ndn::FaceContainer::operator=
FaceContainer & operator=(const FaceContainer &other)
Copy operator for FaceContainer.
Definition:
ndn-face-container.cpp:37
ndn-face-container.hpp
ns3::ndn::FaceContainer::Begin
Iterator Begin() const
Get an iterator which refers to the first pair in the container.
Definition:
ndn-face-container.cpp:58
ns3::ndn::FaceContainer::Get
shared_ptr< Face > Get(Iterator i) const
Get a smart pointer to Face-derived object stored in the container.
Definition:
ndn-face-container.cpp:93
ns3::ndn::FaceContainer::End
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
Definition:
ndn-face-container.cpp:64
ns3::ndn::FaceContainer::GetN
uint32_t GetN() const
Get the number of faces stored in this container.
Definition:
ndn-face-container.cpp:70
ns3::ndn::FaceContainer
A pool for Ndn faces.
Definition:
ndn-face-container.hpp:44
ns3::ndn::FaceContainer::FaceContainer
FaceContainer()
Create an empty FaceContainer.
Definition:
ndn-face-container.cpp:27
ns3::ndn::FaceContainer::Iterator
Container::const_iterator Iterator
Iterator over FaceContainer.
Definition:
ndn-face-container.hpp:49
ndnSIM
helper
ndn-face-container.cpp
Generated on Wed Feb 18 2015 16:31:16 for ndnSIM by
1.8.7