src/internet/model/candidate-queue.h
author Tommaso Pecorella <tommaso.pecorella@unifi.it>
Wed, 20 Nov 2013 20:15:02 +0100
changeset 10440 1e48ff9185f1
parent 7176 9f2663992e99
child 11045 6024c150e4c8
permissions -rw-r--r--
Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     2
/*
1457
562a7017ed93 Copyrights/licenses for routing code
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
     3
 * Copyright 2007 University of Washington
562a7017ed93 Copyrights/licenses for routing code
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
     4
 * 
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     8
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    12
 * GNU General Public License for more details.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    13
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
1457
562a7017ed93 Copyrights/licenses for routing code
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
    17
 *
562a7017ed93 Copyrights/licenses for routing code
Tom Henderson <tomh@tomh.org>
parents: 1121
diff changeset
    18
 * Author:  Craig Dowell (craigdo@ee.washington.edu)
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    19
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    20
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    21
#ifndef CANDIDATE_QUEUE_H
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    22
#define CANDIDATE_QUEUE_H
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    23
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    24
#include <stdint.h>
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    25
#include <list>
2196
fb01b99ce66d Don't include the 'global-route-manager-impl.h' private header from the public header 'candidate-queue.h'.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1457
diff changeset
    26
#include "ns3/ipv4-address.h"
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    27
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    28
namespace ns3 {
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    29
2196
fb01b99ce66d Don't include the 'global-route-manager-impl.h' private header from the public header 'candidate-queue.h'.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1457
diff changeset
    30
class SPFVertex;
fb01b99ce66d Don't include the 'global-route-manager-impl.h' private header from the public header 'candidate-queue.h'.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1457
diff changeset
    31
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
    32
/**
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    33
 * \brief A Candidate Queue used in static routing.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    34
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    35
 * The CandidateQueue is used in the OSPF shortest path computations.  It
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    36
 * is a priority queue used to store candidates for the shortest path to a
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
    37
 * given network.
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    38
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    39
 * The queue holds Shortest Path First Vertex pointers and orders them
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    40
 * according to the lowest value of the field m_distanceFromRoot.  Remaining
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    41
 * vertices are ordered according to increasing distance.  This implements a
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    42
 * priority queue.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    43
 *
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    44
 * Although a STL priority_queue almost does what we want, the requirement
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    45
 * for a Find () operation, the dynamic nature of the data and the derived
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    46
 * requirement for a Reorder () operation led us to implement this simple 
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    47
 * enhanced priority queue.
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    48
 */
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    49
class CandidateQueue
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    50
{
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    51
public:
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    52
/**
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
    53
 * @brief Create an empty SPF Candidate Queue.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    54
 * @internal
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    55
 *
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    56
 * @see SPFVertex
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    57
 */
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    58
  CandidateQueue ();
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    59
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    60
/**
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    61
 * @internal Destroy an SPF Candidate Queue and release any resources held 
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    62
 * by the contents.
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    63
 * @internal
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    64
 *
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    65
 * @see SPFVertex
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    66
 */
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    67
  virtual ~CandidateQueue ();
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    68
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    69
/**
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    70
 * @brief Empty the Candidate Queue and release all of the resources 
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    71
 * associated with the Shortest Path First Vertex pointers in the queue.
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    72
 * @internal
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    73
 *
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    74
 * @see SPFVertex
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    75
 */
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    76
  void Clear (void);
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    77
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    78
/**
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    79
 * @brief Push a Shortest Path First Vertex pointer onto the queue according
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    80
 * to the priority scheme.
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    81
 * @internal
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    82
 * 
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    83
 * On completion, the top of the queue will hold the Shortest Path First
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    84
 * Vertex pointer that points to a vertex having lowest value of the field
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    85
 * m_distanceFromRoot.  Remaining vertices are ordered according to 
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    86
 * increasing distance.
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    87
 *
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    88
 * @see SPFVertex
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    89
 * @param vNew The Shortest Path First Vertex to add to the queue.
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    90
 */
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    91
  void Push (SPFVertex *vNew);
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    92
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    93
/**
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    94
 * @brief Pop the Shortest Path First Vertex pointer at the top of the queue.
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    95
 * @internal
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    96
 *
6273
8d70de29d514 spell check, mostly in comments.
Andrey Mazo <mazo@iitp.ru>
parents: 5858
diff changeset
    97
 * The caller is given the responsibility for releasing the resources 
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    98
 * associated with the vertex.
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
    99
 *
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   100
 * @see SPFVertex
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   101
 * @see Top ()
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   102
 * @returns The Shortest Path First Vertex pointer at the top of the queue.
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   103
 */
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   104
  SPFVertex* Pop (void);
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   105
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   106
/**
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   107
 * @brief Return the Shortest Path First Vertex pointer at the top of the 
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   108
 * queue.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   109
 * @internal
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   110
 *
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   111
 * This method does not pop the SPFVertex* off of the queue, it simply 
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   112
 * returns the pointer.
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   113
 *
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   114
 * @see SPFVertex
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   115
 * @see Pop ()
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   116
 * @returns The Shortest Path First Vertex pointer at the top of the queue.
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   117
 */
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   118
  SPFVertex* Top (void) const;
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   119
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   120
/**
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   121
 * @brief Test the Candidate Queue to determine if it is empty.
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   122
 * @internal
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   123
 *
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   124
 * @returns True if the queue is empty, false otherwise.
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   125
 */
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   126
  bool Empty (void) const;
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   127
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   128
/**
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   129
 * @brief Return the number of Shortest Path First Vertex pointers presently
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   130
 * stored in the Candidate Queue.
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   131
 * @internal
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   132
 *
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   133
 * @see SPFVertex
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   134
 * @returns The number of SPFVertex* pointers in the Candidate Queue.
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   135
 */
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   136
  uint32_t Size (void) const;
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   137
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   138
/**
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   139
 * @brief Searches the Candidate Queue for a Shortest Path First Vertex 
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   140
 * pointer that points to a vertex having the given IP address.
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   141
 * @internal
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   142
 *
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   143
 * @see SPFVertex
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   144
 * @param addr The IP address to search for.
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   145
 * @returns The SPFVertex* pointer corresponding to the given IP address.
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   146
 */
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   147
  SPFVertex* Find (const Ipv4Address addr) const;
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   148
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   149
/**
7176
9f2663992e99 internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6834
diff changeset
   150
 * @brief Reorders the Candidate Queue according to the priority scheme.
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   151
 * @internal
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   152
 * 
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   153
 * On completion, the top of the queue will hold the Shortest Path First
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   154
 * Vertex pointer that points to a vertex having lowest value of the field
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   155
 * m_distanceFromRoot.  Remaining vertices are ordered according to 
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   156
 * increasing distance.
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   157
 *
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   158
 * This method is provided in case the values of m_distanceFromRoot change
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   159
 * during the routing calculations.
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   160
 *
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   161
 * @see SPFVertex
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   162
 */
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   163
  void Reorder (void);
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   164
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   165
private:
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   166
/**
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   167
 * Candidate Queue copy construction is disallowed (not implemented) to 
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   168
 * prevent the compiler from slipping in incorrect versions that don't
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   169
 * properly deal with deep copies.
5227
ecb08c1fc273 Fix some doxygen warnings revealed by WARN_NO_PARAMDOC=YES in doc/doxygen.conf.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 3378
diff changeset
   170
 * \param sr object to copy
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   171
 */
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   172
  CandidateQueue (CandidateQueue& sr);
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   173
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   174
/**
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   175
 * Candidate Queue assignment operator is disallowed (not implemented) to
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   176
 * prevent the compiler from slipping in incorrect versions that don't
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   177
 * properly deal with deep copies.
5227
ecb08c1fc273 Fix some doxygen warnings revealed by WARN_NO_PARAMDOC=YES in doc/doxygen.conf.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 3378
diff changeset
   178
 * \param sr object to assign
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7176
diff changeset
   179
 * \return copied object
1114
4bf5d1262aae doxygen update (@internal)
Craig Dowell <craigdo@ee.washington.edu>
parents: 1111
diff changeset
   180
 */
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   181
  CandidateQueue& operator= (CandidateQueue& sr);
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 5227
diff changeset
   182
/**
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 5227
diff changeset
   183
 * \brief return true if v1 < v2
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 5227
diff changeset
   184
 *
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 5227
diff changeset
   185
 * SPFVertexes are added into the queue according to the ordering
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 5227
diff changeset
   186
 * defined by this method. If v1 should be popped before v2, this 
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 5227
diff changeset
   187
 * method return true; false otherwise
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 5227
diff changeset
   188
 *
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7176
diff changeset
   189
 * \param v1 first operand
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7176
diff changeset
   190
 * \param v2 second operand
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 5227
diff changeset
   191
 * \return True if v1 should be popped before v2; false otherwise
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 5227
diff changeset
   192
 */
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 5227
diff changeset
   193
  static bool CompareSPFVertex (const SPFVertex* v1, const SPFVertex* v2);
3378
747aeace32ee no need for protected members
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2196
diff changeset
   194
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7176
diff changeset
   195
  typedef std::list<SPFVertex*> CandidateList_t; //!< container of SPFVertex pointers
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7176
diff changeset
   196
  CandidateList_t m_candidates;  //!< SPFVertex candidates
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 5227
diff changeset
   197
10440
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7176
diff changeset
   198
  /**
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7176
diff changeset
   199
   * \brief Stream insertion operator.
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7176
diff changeset
   200
   *
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7176
diff changeset
   201
   * \param os the reference to the output stream
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7176
diff changeset
   202
   * \param q the CandidateQueue
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7176
diff changeset
   203
   * \returns the reference to the output stream
1e48ff9185f1 Bug 938 - missing Doxygen in ns-3 (internet model + helper)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents: 7176
diff changeset
   204
   */
5858
afb51c7f34c2 bug 667: Add equal-cost multipath routing (ECMP) to IPv4 global routing
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents: 5227
diff changeset
   205
  friend std::ostream& operator<< (std::ostream& os, const CandidateQueue& q);
1111
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   206
};
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   207
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   208
} // namespace ns3
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   209
835cd416a0a8 rename party
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   210
#endif /* CANDIDATE_QUEUE_H */