A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
internet
helper
ipv6-list-routing-helper.cc
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2008 INRIA
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
*/
20
21
#include "ns3/ipv6-list-routing.h"
22
#include "ns3/node.h"
23
24
#include "
ipv6-list-routing-helper.h
"
25
26
namespace
ns3
{
27
28
Ipv6ListRoutingHelper::Ipv6ListRoutingHelper
()
29
{
30
}
31
32
Ipv6ListRoutingHelper::~Ipv6ListRoutingHelper
()
33
{
34
for
(
std::list
<std::pair<const Ipv6RoutingHelper *, int16_t> >::iterator i =
m_list
.begin ();
35
i !=
m_list
.end (); ++i)
36
{
37
delete
i->first;
38
}
39
}
40
Ipv6ListRoutingHelper::Ipv6ListRoutingHelper
(
const
Ipv6ListRoutingHelper
&o)
41
{
42
std::list<std::pair<const Ipv6RoutingHelper *, int16_t> >::const_iterator i;
43
for
(i = o.
m_list
.begin (); i != o.
m_list
.end (); ++i)
44
{
45
m_list
.push_back (std::make_pair (const_cast<const Ipv6RoutingHelper *> (i->first->Copy ()), i->second));
46
}
47
}
48
49
Ipv6ListRoutingHelper
*
50
Ipv6ListRoutingHelper::Copy
(
void
)
const
51
{
52
return
new
Ipv6ListRoutingHelper
(*
this
);
53
}
54
55
void
56
Ipv6ListRoutingHelper::Add
(
const
Ipv6RoutingHelper
&routing, int16_t priority)
57
{
58
m_list
.push_back (std::make_pair (const_cast<const Ipv6RoutingHelper *> (routing.
Copy
()), priority));
59
}
60
Ptr<Ipv6RoutingProtocol>
61
Ipv6ListRoutingHelper::Create
(
Ptr<Node>
node)
const
62
{
63
Ptr<Ipv6ListRouting>
list
= CreateObject<Ipv6ListRouting> ();
64
for
(
std::list
<std::pair<const Ipv6RoutingHelper *,int16_t> >::const_iterator i =
m_list
.begin ();
65
i !=
m_list
.end (); ++i)
66
{
67
Ptr<Ipv6RoutingProtocol>
prot = i->first->Create (node);
68
list
->AddRoutingProtocol (prot,i->second);
69
}
70
return
list
;
71
}
72
73
}
// namespace ns3
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:73
ns3::Ipv6RoutingHelper::Copy
virtual Ipv6RoutingHelper * Copy(void) const =0
virtual constructor
ns3::Ipv6ListRoutingHelper::m_list
std::list< std::pair< const Ipv6RoutingHelper *, int16_t > > m_list
Container for pairs of Ipv6RoutingHelper pointer / priority.
Definition:
ipv6-list-routing-helper.h:97
ns3::Ipv6ListRoutingHelper::Ipv6ListRoutingHelper
Ipv6ListRoutingHelper()
Construct an Ipv6 Ipv6ListRoutingHelper which is used to make life easier for people wanting to confi...
Definition:
ipv6-list-routing-helper.cc:28
ns3::Ipv6ListRoutingHelper::Create
virtual Ptr< Ipv6RoutingProtocol > Create(Ptr< Node > node) const
Definition:
ipv6-list-routing-helper.cc:61
ns3::Ipv6RoutingHelper
A factory to create ns3::Ipv6RoutingProtocol objects.
Definition:
ipv6-routing-helper.h:45
list
#define list
Definition:
openflow-interface.h:47
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ipv6-list-routing-helper.h
ns3::Ipv6ListRoutingHelper::Add
void Add(const Ipv6RoutingHelper &routing, int16_t priority)
Definition:
ipv6-list-routing-helper.cc:56
ns3::Ipv6ListRoutingHelper::~Ipv6ListRoutingHelper
virtual ~Ipv6ListRoutingHelper()
Destroy an Ipv6 Ipv6ListRoutingHelper.
Definition:
ipv6-list-routing-helper.cc:32
ns3::Ipv6ListRoutingHelper
Helper class that adds ns3::Ipv6ListRouting objects.
Definition:
ipv6-list-routing-helper.h:39
ns3::Ipv6ListRoutingHelper::Copy
Ipv6ListRoutingHelper * Copy(void) const
Definition:
ipv6-list-routing-helper.cc:50
Generated on Wed Nov 7 2018 10:01:53 for ns-3 by
1.8.14