A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
ipv6-option-demux.cc
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2007-2009 Strasbourg University
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: David Gross <gdavid.devel@gmail.com>
19
*/
20
21
#include <sstream>
22
#include "ns3/node.h"
23
#include "ns3/ptr.h"
24
#include "ns3/object-vector.h"
25
#include "
ipv6-option-demux.h
"
26
#include "
ipv6-option.h
"
27
28
namespace
ns3
29
{
30
31
NS_OBJECT_ENSURE_REGISTERED
(Ipv6OptionDemux);
32
33
TypeId
Ipv6OptionDemux::GetTypeId
()
34
{
35
static
TypeId
tid =
TypeId
(
"ns3::Ipv6OptionDemux"
)
36
.
SetParent
<
Object
> ()
37
.AddAttribute (
"Options"
,
"The set of IPv6 options registered with this demux."
,
38
ObjectVectorValue
(),
39
MakeObjectVectorAccessor
(&
Ipv6OptionDemux::m_options
),
40
MakeObjectVectorChecker<Ipv6Option> ())
41
;
42
return
tid;
43
}
44
45
Ipv6OptionDemux::Ipv6OptionDemux
()
46
{
47
}
48
49
Ipv6OptionDemux::~Ipv6OptionDemux
()
50
{
51
}
52
53
void
Ipv6OptionDemux::DoDispose
()
54
{
55
for
(Ipv6OptionList_t::iterator it =
m_options
.begin (); it !=
m_options
.end (); it++)
56
{
57
(*it)->Dispose ();
58
*it = 0;
59
}
60
m_options
.clear ();
61
m_node
= 0;
62
Object::DoDispose
();
63
}
64
65
void
Ipv6OptionDemux::SetNode
(
Ptr<Node>
node)
66
{
67
m_node
= node;
68
}
69
70
void
Ipv6OptionDemux::Insert
(
Ptr<Ipv6Option>
option)
71
{
72
m_options
.push_back (option);
73
}
74
75
Ptr<Ipv6Option>
Ipv6OptionDemux::GetOption
(
int
optionNumber)
76
{
77
for
(Ipv6OptionList_t::iterator i =
m_options
.begin (); i !=
m_options
.end (); ++i)
78
{
79
if
((*i)->GetOptionNumber () == optionNumber)
80
{
81
return
*i;
82
}
83
}
84
return
0;
85
}
86
87
void
Ipv6OptionDemux::Remove
(
Ptr<Ipv6Option>
option)
88
{
89
m_options
.remove (option);
90
}
91
92
}
/* namespace ns3 */
93
ns3::Ipv6OptionDemux::Insert
void Insert(Ptr< Ipv6Option > option)
Insert a new IPv6 Option.
Definition:
ipv6-option-demux.cc:70
ns3::Ipv6OptionDemux::DoDispose
virtual void DoDispose()
Dispose this object.
Definition:
ipv6-option-demux.cc:53
ns3::MakeObjectVectorAccessor
Ptr< const AttributeAccessor > MakeObjectVectorAccessor(U T::*memberContainer)
Definition:
object-vector.h:51
ns3::Ptr< Node >
ns3::Ipv6OptionDemux::SetNode
void SetNode(Ptr< Node > node)
Set the node.
Definition:
ipv6-option-demux.cc:65
ns3::Ipv6OptionDemux::m_node
Ptr< Node > m_node
The node.
Definition:
ipv6-option-demux.h:99
ns3::Object::DoDispose
virtual void DoDispose(void)
Definition:
object.cc:335
ipv6-option-demux.h
ns3::Ipv6OptionDemux::Ipv6OptionDemux
Ipv6OptionDemux()
Constructor.
Definition:
ipv6-option-demux.cc:45
ns3::NS_OBJECT_ENSURE_REGISTERED
NS_OBJECT_ENSURE_REGISTERED(AntennaModel)
ns3::Ipv6OptionDemux::m_options
Ipv6OptionList_t m_options
List of IPv6 Options supported.
Definition:
ipv6-option-demux.h:94
ns3::Ipv6OptionDemux::GetOption
Ptr< Ipv6Option > GetOption(int optionNumber)
Get the option corresponding to optionNumber.
Definition:
ipv6-option-demux.cc:75
ns3::Ipv6OptionDemux::Remove
void Remove(Ptr< Ipv6Option > option)
Remove an option from this demux.
Definition:
ipv6-option-demux.cc:87
ipv6-option.h
ns3::Ipv6OptionDemux::GetTypeId
static TypeId GetTypeId(void)
The interface ID.
Definition:
ipv6-option-demux.cc:33
ns3::Object
a base class which provides memory management and object aggregation
Definition:
object.h:63
ns3::ObjectPtrContainerValue
contain a set of ns3::Object pointers.
Definition:
object-ptr-container.h:38
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Definition:
type-id.cc:610
ns3::Ipv6OptionDemux::~Ipv6OptionDemux
virtual ~Ipv6OptionDemux()
Destructor.
Definition:
ipv6-option-demux.cc:49
src
internet
model
ipv6-option-demux.cc
Generated on Sat Nov 16 2013 12:55:28 for ns-3 by
1.8.5