A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
candidate-queue.h
Go to the documentation of this file.
1
/*
2
* Copyright 2007 University of Washington
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Craig Dowell (craigdo@ee.washington.edu)
18
*/
19
20
#ifndef CANDIDATE_QUEUE_H
21
#define CANDIDATE_QUEUE_H
22
23
#include "ns3/ipv4-address.h"
24
25
#include <list>
26
#include <stdint.h>
27
28
namespace
ns3
29
{
30
31
class
SPFVertex;
32
52
class
CandidateQueue
53
{
54
public
:
60
CandidateQueue
();
61
68
virtual
~CandidateQueue
();
69
70
// Delete copy constructor and assignment operator to avoid misuse
71
CandidateQueue
(
const
CandidateQueue
&) =
delete
;
72
CandidateQueue
&
operator=
(
const
CandidateQueue
&) =
delete
;
73
80
void
Clear
();
81
94
void
Push
(
SPFVertex
* vNew);
95
106
SPFVertex
*
Pop
();
107
119
SPFVertex
*
Top
()
const
;
120
126
bool
Empty
()
const
;
127
135
uint32_t
Size
()
const
;
136
145
SPFVertex
*
Find
(
const
Ipv4Address
addr)
const
;
146
160
void
Reorder
();
161
162
private
:
174
static
bool
CompareSPFVertex
(
const
SPFVertex
* v1,
const
SPFVertex
* v2);
175
176
typedef
std::list<SPFVertex*>
CandidateList_t
;
177
CandidateList_t
m_candidates
;
178
186
friend
std::ostream&
operator<<
(std::ostream& os,
const
CandidateQueue
& q);
187
};
188
189
}
// namespace ns3
190
191
#endif
/* CANDIDATE_QUEUE_H */
ns3::CandidateQueue
A Candidate Queue used in routing calculations.
Definition:
candidate-queue.h:53
ns3::CandidateQueue::CompareSPFVertex
static bool CompareSPFVertex(const SPFVertex *v1, const SPFVertex *v2)
return true if v1 < v2
Definition:
candidate-queue.cc:185
ns3::CandidateQueue::Pop
SPFVertex * Pop()
Pop the Shortest Path First Vertex pointer at the top of the queue.
Definition:
candidate-queue.cc:110
ns3::CandidateQueue::CandidateQueue
CandidateQueue(const CandidateQueue &)=delete
ns3::CandidateQueue::Top
SPFVertex * Top() const
Return the Shortest Path First Vertex pointer at the top of the queue.
Definition:
candidate-queue.cc:124
ns3::CandidateQueue::operator=
CandidateQueue & operator=(const CandidateQueue &)=delete
ns3::CandidateQueue::Size
uint32_t Size() const
Return the number of Shortest Path First Vertex pointers presently stored in the Candidate Queue.
Definition:
candidate-queue.cc:143
ns3::CandidateQueue::Push
void Push(SPFVertex *vNew)
Push a Shortest Path First Vertex pointer onto the queue according to the priority scheme.
Definition:
candidate-queue.cc:98
ns3::CandidateQueue::Reorder
void Reorder()
Reorders the Candidate Queue according to the priority scheme.
Definition:
candidate-queue.cc:168
ns3::CandidateQueue::CandidateList_t
std::list< SPFVertex * > CandidateList_t
container of SPFVertex pointers
Definition:
candidate-queue.h:176
ns3::CandidateQueue::~CandidateQueue
virtual ~CandidateQueue()
Destroy an SPF Candidate Queue and release any resources held by the contents.
Definition:
candidate-queue.cc:79
ns3::CandidateQueue::m_candidates
CandidateList_t m_candidates
SPFVertex candidates.
Definition:
candidate-queue.h:177
ns3::CandidateQueue::Clear
void Clear()
Empty the Candidate Queue and release all of the resources associated with the Shortest Path First Ve...
Definition:
candidate-queue.cc:86
ns3::CandidateQueue::Find
SPFVertex * Find(const Ipv4Address addr) const
Searches the Candidate Queue for a Shortest Path First Vertex pointer that points to a vertex having ...
Definition:
candidate-queue.cc:150
ns3::CandidateQueue::CandidateQueue
CandidateQueue()
Create an empty SPF Candidate Queue.
Definition:
candidate-queue.cc:73
ns3::CandidateQueue::Empty
bool Empty() const
Test the Candidate Queue to determine if it is empty.
Definition:
candidate-queue.cc:136
ns3::CandidateQueue::operator<<
friend std::ostream & operator<<(std::ostream &os, const CandidateQueue &q)
Stream insertion operator.
Definition:
candidate-queue.cc:59
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:42
ns3::SPFVertex
Vertex used in shortest path first (SPF) computations.
Definition:
global-route-manager-impl.h:71
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
internet
model
candidate-queue.h
Generated on Sun Mar 3 2024 17:10:58 for ns-3 by
1.9.1