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
face-table.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#ifndef NFD_DAEMON_FW_FACE_TABLE_HPP
27
#define NFD_DAEMON_FW_FACE_TABLE_HPP
28
29
#include "
face/face.hpp
"
30
#include <boost/range/adaptor/map.hpp>
31
32
namespace
nfd
{
33
34
class
Forwarder
;
35
38
class
FaceTable
: noncopyable
39
{
40
public
:
41
explicit
42
FaceTable
(
Forwarder
& forwarder);
43
44
VIRTUAL_WITH_TESTS
45
~FaceTable
();
46
47
VIRTUAL_WITH_TESTS
void
48
add
(shared_ptr<Face> face);
49
51
VIRTUAL_WITH_TESTS
void
52
addReserved
(shared_ptr<Face> face,
FaceId
faceId);
53
54
VIRTUAL_WITH_TESTS
shared_ptr<Face>
55
get
(
FaceId
id)
const
;
56
57
size_t
58
size
()
const
;
59
60
public
:
// enumeration
61
typedef
std::map<FaceId, shared_ptr<Face>>
FaceMap
;
62
63
typedef
boost::select_second_const_range<FaceMap>
ForwardRange
;
64
67
typedef
boost::range_iterator<ForwardRange>::type
const_iterator
;
68
69
const_iterator
70
begin
()
const
;
71
72
const_iterator
73
end
()
const
;
74
75
public
:
// signals
78
signal::Signal<FaceTable, shared_ptr<Face>
>
onAdd
;
79
84
signal::Signal<FaceTable, shared_ptr<Face>
>
onRemove
;
85
86
private
:
87
void
88
addImpl(shared_ptr<Face> face,
FaceId
faceId);
89
90
// remove is private because it's a handler of face.onFail signal.
91
// face->close() closes the face and triggers .remove()
92
void
93
remove
(shared_ptr<Face> face,
const
std::string& reason);
94
95
ForwardRange
96
getForwardRange()
const
;
97
98
private
:
99
Forwarder
& m_forwarder;
100
FaceId
m_lastFaceId;
101
FaceMap m_faces;
102
};
103
104
}
// namespace nfd
105
106
#endif // NFD_DAEMON_FW_FACE_TABLE_HPP
face.hpp
nfd::FaceTable::const_iterator
boost::range_iterator< ForwardRange >::type const_iterator
ForwardIterator for shared_ptr<Face>
Definition:
face-table.hpp:67
nfd::FaceTable::end
const_iterator end() const
Definition:
face-table.cpp:125
nfd::FaceTable::add
void add(shared_ptr< Face > face)
Definition:
face-table.cpp:59
nfd::Forwarder
main class of NFD
Definition:
forwarder.hpp:54
ndn::util::signal::Signal
provides a lightweight signal / event system
Definition:
signal-signal.hpp:50
nfd::FaceTable::size
size_t size() const
Definition:
face-table.cpp:53
nfd::FaceTable::~FaceTable
~FaceTable()
Definition:
face-table.cpp:40
nfd::FaceTable::onRemove
signal::Signal< FaceTable, shared_ptr< Face > > onRemove
fires before a Face is removed
Definition:
face-table.hpp:84
nfd::FaceTable::FaceMap
std::map< FaceId, shared_ptr< Face > > FaceMap
Definition:
face-table.hpp:61
nfd::FaceTable
container of all Faces
Definition:
face-table.hpp:38
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:38
VIRTUAL_WITH_TESTS
#define VIRTUAL_WITH_TESTS
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
Definition:
common.hpp:37
FaceId
identifies a face
nfd::Forwarder
Forwarder
Definition:
forwarder.cpp:38
nfd::FaceTable::ForwardRange
boost::select_second_const_range< FaceMap > ForwardRange
Definition:
face-table.hpp:63
nfd::FaceTable::FaceTable
FaceTable(Forwarder &forwarder)
Definition:
face-table.cpp:34
nfd::FaceTable::addReserved
void addReserved(shared_ptr< Face > face, FaceId faceId)
add a special Face with a reserved FaceId
Definition:
face-table.cpp:72
nfd::FaceTable::begin
const_iterator begin() const
Definition:
face-table.cpp:119
nfd::FaceTable::onAdd
signal::Signal< FaceTable, shared_ptr< Face > > onAdd
fires after a Face is added
Definition:
face-table.hpp:78
ndnSIM
NFD
daemon
fw
face-table.hpp
Generated on Tue Feb 23 2016 22:18:44 for ndnSIM by
1.8.11