NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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
() =
default
;
28
29
FaceContainer::FaceContainer
(
const
FaceContainer
& other)
30
{
31
AddAll
(other);
32
}
33
34
FaceContainer
&
35
FaceContainer::operator=
(
const
FaceContainer
&other)
36
{
37
m_faces.clear();
38
AddAll
(other);
39
40
return
*
this
;
41
}
42
43
void
44
FaceContainer::AddAll
(Ptr<FaceContainer> other)
45
{
46
AddAll
(*other);
47
}
48
49
void
50
FaceContainer::AddAll
(
const
FaceContainer
& other)
51
{
52
if
(
this
== &other) {
// adding self to self, need to make a copy
53
auto
copyOfFaces = other.m_faces;
54
m_faces.insert(m_faces.end(), copyOfFaces.begin(), copyOfFaces.end());
55
}
56
else
{
57
m_faces.insert(m_faces.end(), other.m_faces.begin(), other.m_faces.end());
58
}
59
}
60
61
FaceContainer::Iterator
62
FaceContainer::Begin
(
void
)
const
63
{
64
return
m_faces.begin();
65
}
66
67
FaceContainer::Iterator
68
FaceContainer::End
(
void
)
const
69
{
70
return
m_faces.end();
71
}
72
73
uint32_t
74
FaceContainer::GetN
(
void
)
const
75
{
76
return
m_faces.size();
77
}
78
79
void
80
FaceContainer::Add
(shared_ptr<Face>
face
)
81
{
82
m_faces.push_back(face);
83
}
84
85
shared_ptr<Face>
86
FaceContainer::Get
(
size_t
i)
const
87
{
88
return
m_faces.at(i);
89
}
90
91
}
// namespace ndn
92
}
// namespace ns3
ns3::ndn::FaceContainer::AddAll
void AddAll(Ptr< FaceContainer > other)
Add all entries from other container.
Definition:
ndn-face-container.cpp:44
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ns3::ndn::FaceContainer::operator=
FaceContainer & operator=(const FaceContainer &other)
Copy operator for FaceContainer.
Definition:
ndn-face-container.cpp:35
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:62
ns3::ndn::FaceContainer::End
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
Definition:
ndn-face-container.cpp:68
ns3
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
content-store-impl.cpp:38
face
ns3::ndn::FaceContainer::Add
void Add(shared_ptr< Face > face)
Add an entry to the container.
Definition:
ndn-face-container.cpp:80
ns3::ndn::FaceContainer::GetN
uint32_t GetN() const
Get the number of faces stored in this container.
Definition:
ndn-face-container.cpp:74
ns3::ndn::FaceContainer::Get
shared_ptr< Face > Get(size_t pos) const
Get a Face stored in the container.
Definition:
ndn-face-container.cpp:86
ns3::ndn::FaceContainer
A pool for Ndn faces.
Definition:
ndn-face-container.hpp:43
ns3::ndn::FaceContainer::FaceContainer
FaceContainer()
Create an empty FaceContainer.
ns3::ndn::FaceContainer::Iterator
Container::const_iterator Iterator
Iterator over FaceContainer.
Definition:
ndn-face-container.hpp:48
ndnSIM
helper
ndn-face-container.cpp
Generated on Thu Nov 2 2017 03:30:28 for ndnSIM by
1.8.11