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-global-router.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
20
#ifndef NDN_GLOBAL_ROUTER_H
21
#define NDN_GLOBAL_ROUTER_H
22
23
#include "ns3/ndnSIM/model/ndn-common.hpp"
24
#include "ns3/ndnSIM/model/ndn-face.hpp"
25
26
#include "ns3/object.h"
27
#include "ns3/ptr.h"
28
29
#include <list>
30
#include <tuple>
31
32
namespace
ns3 {
33
34
class
Channel;
35
36
namespace
ndn {
37
38
class
L3Protocol
;
39
44
class
GlobalRouter
:
public
Object {
45
public
:
49
typedef
std::tuple<Ptr<GlobalRouter>, shared_ptr<Face>, Ptr<GlobalRouter>>
Incidency
;
53
typedef
std::list<Incidency>
IncidencyList
;
57
typedef
std::list<shared_ptr<Name>>
LocalPrefixList
;
58
64
static
TypeId
65
GetTypeId
();
66
70
GlobalRouter
();
71
75
uint32_t
76
GetId
()
const
;
77
81
Ptr<L3Protocol>
82
GetL3Protocol
()
const
;
83
88
void
89
AddLocalPrefix
(shared_ptr<Name> prefix);
90
96
void
97
AddIncidency
(shared_ptr<Face> face, Ptr<GlobalRouter> ndn);
98
102
IncidencyList
&
103
GetIncidencies
();
104
108
const
LocalPrefixList
&
109
GetLocalPrefixes
()
const
;
110
111
// ??
112
protected
:
113
virtual
void
114
NotifyNewAggregate
();
115
117
private
:
118
uint32_t m_id;
119
120
Ptr<L3Protocol> m_ndn;
121
LocalPrefixList
m_localPrefixes;
122
IncidencyList
m_incidencies;
123
124
static
uint32_t m_idCounter;
125
};
126
127
inline
bool
128
operator==
(
const
GlobalRouter::Incidency
& a,
const
GlobalRouter::Incidency
& b)
129
{
130
return
std::get<0>(a) == std::get<0>(b) && std::get<1>(a) == std::get<1>(b)
131
&& std::get<2>(a) == std::get<2>(b);
132
}
133
134
inline
bool
135
operator!=
(
const
GlobalRouter::Incidency
& a,
const
GlobalRouter::Incidency
& b)
136
{
137
return
!(a == b);
138
}
139
140
}
// namespace ndn
141
}
// namespace ns3
142
143
#endif // NDN_GLOBAL_ROUTER_H
ns3::ndn::GlobalRouter::AddLocalPrefix
void AddLocalPrefix(shared_ptr< Name > prefix)
Add new locally exported prefix.
Definition:
ndn-global-router.cpp:69
ns3::ndn::GlobalRouter::GlobalRouter
GlobalRouter()
Default constructor.
Definition:
ndn-global-router.cpp:41
ns3::ndn::GlobalRouter::LocalPrefixList
std::list< shared_ptr< Name > > LocalPrefixList
List of locally exported prefixes.
Definition:
ndn-global-router.hpp:57
ns3::ndn::GlobalRouter
Class representing global router interface for ndnSIM.
Definition:
ndn-global-router.hpp:44
ns3::ndn::GlobalRouter::Incidency
std::tuple< Ptr< GlobalRouter >, shared_ptr< Face >, Ptr< GlobalRouter > > Incidency
Graph edge.
Definition:
ndn-global-router.hpp:49
ns3::ndn::GlobalRouter::AddIncidency
void AddIncidency(shared_ptr< Face > face, Ptr< GlobalRouter > ndn)
Add edge to the node.
Definition:
ndn-global-router.cpp:75
ns3::ndn::GlobalRouter::NotifyNewAggregate
virtual void NotifyNewAggregate()
Notify when the object is aggregated to another object (e.g., Node)
Definition:
ndn-global-router.cpp:48
ns3::ndn::GlobalRouter::GetId
uint32_t GetId() const
Get numeric ID of the node (internally assigned)
Definition:
ndn-global-router.cpp:57
ns3::ndn::GlobalRouter::IncidencyList
std::list< Incidency > IncidencyList
List of graph edges.
Definition:
ndn-global-router.hpp:53
ns3::ndn::GlobalRouter::GetIncidencies
IncidencyList & GetIncidencies()
Get list of edges that are connected to this node.
Definition:
ndn-global-router.cpp:81
L3Protocol
ndn L3Protocol
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-l3-protocol.cpp:53
ns3::ndn::GlobalRouter::GetTypeId
static TypeId GetTypeId()
Interface ID.
Definition:
ndn-global-router.cpp:35
ns3::ndn::operator!=
bool operator!=(const GlobalRouter::Incidency &a, const GlobalRouter::Incidency &b)
Definition:
ndn-global-router.hpp:135
ns3::ndn::GlobalRouter::GetL3Protocol
Ptr< L3Protocol > GetL3Protocol() const
Helper function to get smart pointer to ndn::L3Protocol object (basically, self)
Definition:
ndn-global-router.cpp:63
ns3::ndn::GlobalRouter::GetLocalPrefixes
const LocalPrefixList & GetLocalPrefixes() const
Get list of locally exported prefixes.
Definition:
ndn-global-router.cpp:87
ns3::ndn::operator==
bool operator==(const GlobalRouter::Incidency &a, const GlobalRouter::Incidency &b)
Definition:
ndn-global-router.hpp:128
ndnSIM
model
ndn-global-router.hpp
Generated on Wed Feb 18 2015 16:31:16 for ndnSIM by
1.8.7