A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
ipv4-list-routing-helper.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2008 INRIA
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7
*/
8
#include "
ipv4-list-routing-helper.h
"
9
10
#include "ns3/ipv4-list-routing.h"
11
#include "ns3/node.h"
12
13
namespace
ns3
14
{
15
16
Ipv4ListRoutingHelper::Ipv4ListRoutingHelper
()
17
{
18
}
19
20
Ipv4ListRoutingHelper::~Ipv4ListRoutingHelper
()
21
{
22
for
(
auto
i =
m_list
.begin(); i !=
m_list
.end(); ++i)
23
{
24
delete
i->first;
25
}
26
}
27
28
Ipv4ListRoutingHelper::Ipv4ListRoutingHelper
(
const
Ipv4ListRoutingHelper
& o)
29
{
30
for
(
auto
i = o.
m_list
.begin(); i != o.
m_list
.end(); ++i)
31
{
32
m_list
.emplace_back(
const_cast<
const
Ipv4RoutingHelper
*
>
(i->first->Copy()), i->second);
33
}
34
}
35
36
Ipv4ListRoutingHelper
*
37
Ipv4ListRoutingHelper::Copy
()
const
38
{
39
return
new
Ipv4ListRoutingHelper
(*
this
);
40
}
41
42
void
43
Ipv4ListRoutingHelper::Add
(
const
Ipv4RoutingHelper
& routing, int16_t priority)
44
{
45
m_list
.emplace_back(
const_cast<
const
Ipv4RoutingHelper
*
>
(routing.
Copy
()), priority);
46
}
47
48
Ptr<Ipv4RoutingProtocol>
49
Ipv4ListRoutingHelper::Create
(
Ptr<Node>
node)
const
50
{
51
Ptr<Ipv4ListRouting>
list =
CreateObject<Ipv4ListRouting>
();
52
for
(
auto
i =
m_list
.begin(); i !=
m_list
.end(); ++i)
53
{
54
Ptr<Ipv4RoutingProtocol>
prot = i->first->Create(node);
55
list->AddRoutingProtocol(prot, i->second);
56
}
57
return
list
;
58
}
59
60
}
// namespace ns3
ns3::Ipv4ListRoutingHelper
Helper class that adds ns3::Ipv4ListRouting objects.
Definition
ipv4-list-routing-helper.h:28
ns3::Ipv4ListRoutingHelper::Copy
Ipv4ListRoutingHelper * Copy() const override
Definition
ipv4-list-routing-helper.cc:37
ns3::Ipv4ListRoutingHelper::Ipv4ListRoutingHelper
Ipv4ListRoutingHelper()
Definition
ipv4-list-routing-helper.cc:16
ns3::Ipv4ListRoutingHelper::~Ipv4ListRoutingHelper
~Ipv4ListRoutingHelper() override
Definition
ipv4-list-routing-helper.cc:20
ns3::Ipv4ListRoutingHelper::Create
Ptr< Ipv4RoutingProtocol > Create(Ptr< Node > node) const override
Definition
ipv4-list-routing-helper.cc:49
ns3::Ipv4ListRoutingHelper::Add
void Add(const Ipv4RoutingHelper &routing, int16_t priority)
Definition
ipv4-list-routing-helper.cc:43
ns3::Ipv4ListRoutingHelper::m_list
std::list< std::pair< const Ipv4RoutingHelper *, int16_t > > m_list
Container for pairs of Ipv4RoutingHelper pointer / priority.
Definition
ipv4-list-routing-helper.h:82
ns3::Ipv4RoutingHelper
a factory to create ns3::Ipv4RoutingProtocol objects
Definition
ipv4-routing-helper.h:35
ns3::Ipv4RoutingHelper::Copy
virtual Ipv4RoutingHelper * Copy() const =0
virtual constructor
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::CreateObject
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition
object.h:619
ipv4-list-routing-helper.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
list
#define list
Definition
openflow-interface.h:35
src
internet
helper
ipv4-list-routing-helper.cc
Generated on Wed Dec 4 2024 09:20:41 for ns-3 by
1.11.0