NS-3 based Named Data Networking (NDN) simulator
ndnSIM: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Groups
Pages
ndn-face-container.cc
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2
/*
3
* Copyright (c) 2011 University of California, Los Angeles
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
19
*/
20
21
#include "ndn-face-container.h"
22
23
#include <algorithm>
24
25
#include "ns3/ndn-face.h"
26
27
namespace
ns3 {
28
namespace
ndn {
29
30
FaceContainer::FaceContainer
()
31
{
32
}
33
34
FaceContainer::FaceContainer
(
const
FaceContainer
&other)
35
{
36
AddAll
(other);
37
}
38
39
FaceContainer
&
40
FaceContainer::operator=
(
const
FaceContainer
&other)
41
{
42
m_faces.clear ();
43
AddAll
(other);
44
45
return
*
this
;
46
}
47
48
49
void
50
FaceContainer::AddAll
(Ptr<FaceContainer> other)
51
{
52
AddAll
(*other);
53
}
54
55
void
56
FaceContainer::AddAll
(
const
FaceContainer
&other)
57
{
58
m_faces.insert (m_faces.end (),
59
other.m_faces.begin (), other.m_faces.end ());
60
}
61
62
FaceContainer::Iterator
63
FaceContainer::Begin
(
void
)
const
64
{
65
return
m_faces.begin ();
66
}
67
68
FaceContainer::Iterator
69
FaceContainer::End
(
void
)
const
70
{
71
return
m_faces.end ();
72
}
73
74
uint32_t
75
FaceContainer::GetN
(
void
)
const
76
{
77
return
m_faces.size ();
78
}
79
80
// void
81
// FaceContainer::SetMetricToAll (uint16_t metric)
82
// {
83
// for (FaceContainer::iterator it=m_faces.begin ();
84
// it != m_faces.end ();
85
// it++)
86
// {
87
// (*it)->SetMetric (metric);
88
// }
89
// }
90
91
void
92
FaceContainer::Add
(
const
Ptr<Face> &face)
93
{
94
m_faces.push_back (face);
95
}
96
97
Ptr<Face>
98
FaceContainer::Get
(
FaceContainer::Iterator
i)
const
99
{
100
return
*i;
101
}
102
103
}
// namespace ndn
104
}
// namespace ns3
ns3::ndn::FaceContainer::Add
void Add(const Ptr< Face > &face)
Set a metric for all faces in the container.
Definition:
ndn-face-container.cc:92
ns3::ndn::FaceContainer::GetN
uint32_t GetN() const
Get the number of faces stored in this container.
Definition:
ndn-face-container.cc:75
ns3::ndn::FaceContainer::Begin
Iterator Begin() const
Get an iterator which refers to the first pair in the container.
Definition:
ndn-face-container.cc:63
ns3::ndn::FaceContainer::Get
Ptr< Face > Get(Iterator i) const
Get a smart pointer to Face-derived object stored in the container.
Definition:
ndn-face-container.cc:98
ns3::ndn::FaceContainer::AddAll
void AddAll(Ptr< FaceContainer > other)
Add all entries from other container.
Definition:
ndn-face-container.cc:50
ns3::ndn::FaceContainer::operator=
FaceContainer & operator=(const FaceContainer &other)
Copy operator for FaceContainer.
Definition:
ndn-face-container.cc:40
ns3::ndn::FaceContainer::End
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
Definition:
ndn-face-container.cc:69
ns3::ndn::FaceContainer::FaceContainer
FaceContainer()
Create an empty FaceContainer.
Definition:
ndn-face-container.cc:30
ns3::ndn::FaceContainer
A pool for Ndn faces.
Definition:
ndn-face-container.h:43
ns3::ndn::FaceContainer::Iterator
Container::const_iterator Iterator
Iterator over FaceContainer.
Definition:
ndn-face-container.h:48
ndnSIM
helper
ndn-face-container.cc
Generated on Mon Jan 19 2015 11:27:03 for ndnSIM by
1.8.7