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
nix-vector.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2009 The Georgia Institute of Technology
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
* Authors: Josh Pelkey <jpelkey@gatech.edu>
19
*/
20
21
#ifndef NIX_VECTOR_H
22
#define NIX_VECTOR_H
23
24
#include "ns3/ptr.h"
25
#include "ns3/simple-ref-count.h"
26
#include "ns3/buffer.h"
27
28
namespace
ns3 {
29
63
class
NixVector
:
public
SimpleRefCount
<NixVector>
64
{
65
public
:
66
NixVector
();
67
~NixVector
();
71
Ptr<NixVector>
Copy
(
void
)
const
;
76
NixVector
(
const
NixVector
&o);
83
NixVector
&
operator =
(
const
NixVector
&o);
96
void
AddNeighborIndex
(uint32_t newBits, uint32_t numberOfBits);
110
uint32_t
ExtractNeighborIndex
(uint32_t numberOfBits);
115
uint32_t
GetRemainingBits
(
void
);
119
uint32_t
GetSerializedSize
(
void
)
const
;
130
uint32_t
Serialize
(uint32_t* buffer, uint32_t maxSize)
const
;
141
uint32_t
Deserialize
(
const
uint32_t* buffer, uint32_t size);
151
uint32_t
BitCount
(uint32_t numberOfNeighbors)
const
;
152
153
154
private
:
155
typedef
std::vector<uint32_t>
NixBits_t
;
156
157
/* for printing of nix-vector */
158
void
DumpNixVector
(std::ostream &os)
const
;
159
/* for printing of nix-vector */
160
friend
std::ostream &
operator <<
( std::ostream &outs,
const
NixVector
&nix);
161
162
/* the actual nix-vector */
163
NixBits_t
m_nixVector
;
164
165
/* for tracking where we are
166
* in the nix-vector
167
*/
168
uint32_t
m_used
;
169
170
/* for tracking how many bits we
171
* have used in the current vector
172
* entry. need this in order to
173
* expand the vector passed 32bits
174
*/
175
uint32_t
m_currentVectorBitSize
;
176
177
/* a counter of how total bits are in
178
* the nix-vector
179
*/
180
uint32_t
m_totalBitSize
;
181
182
/* internal for pretty printing of nix-vector */
183
void
PrintDec2BinNixFill
(uint32_t, uint32_t, std::ostream &os)
const
;
184
185
/* internal for pretty printing of nix-vector */
186
void
PrintDec2BinNix
(uint32_t, uint32_t, std::ostream &os)
const
;
187
};
188
}
// namespace ns3
189
190
#endif
/* NIX_VECTOR_H */
ns3::NixVector::NixVector
NixVector()
typedef for the nixVector
Definition:
nix-vector.cc:32
ns3::Ptr< NixVector >
ns3::NixVector
Neighbor-index data structure for nix-vector routing.
Definition:
nix-vector.h:63
ns3::NixVector::Copy
Ptr< NixVector > Copy(void) const
Definition:
nix-vector.cc:71
ns3::NixVector::operator<<
friend std::ostream & operator<<(std::ostream &outs, const NixVector &nix)
Definition:
nix-vector.cc:81
ns3::NixVector::operator=
NixVector & operator=(const NixVector &o)
Definition:
nix-vector.cc:57
ns3::NixVector::m_totalBitSize
uint32_t m_totalBitSize
Definition:
nix-vector.h:180
ns3::NixVector::GetRemainingBits
uint32_t GetRemainingBits(void)
Definition:
nix-vector.cc:357
ns3::NixVector::ExtractNeighborIndex
uint32_t ExtractNeighborIndex(uint32_t numberOfBits)
Definition:
nix-vector.cc:160
ns3::NixVector::PrintDec2BinNix
void PrintDec2BinNix(uint32_t, uint32_t, std::ostream &os) const
Definition:
nix-vector.cc:388
ns3::NixVector::PrintDec2BinNixFill
void PrintDec2BinNixFill(uint32_t, uint32_t, std::ostream &os) const
Definition:
nix-vector.cc:415
ns3::NixVector::m_nixVector
NixBits_t m_nixVector
Definition:
nix-vector.h:163
ns3::NixVector::Serialize
uint32_t Serialize(uint32_t *buffer, uint32_t maxSize) const
Definition:
nix-vector.cc:225
ns3::NixVector::DumpNixVector
void DumpNixVector(std::ostream &os) const
Definition:
nix-vector.cc:319
ns3::NixVector::GetSerializedSize
uint32_t GetSerializedSize(void) const
Definition:
nix-vector.cc:214
ns3::NixVector::NixBits_t
std::vector< uint32_t > NixBits_t
Definition:
nix-vector.h:155
ns3::NixVector::Deserialize
uint32_t Deserialize(const uint32_t *buffer, uint32_t size)
Definition:
nix-vector.cc:282
ns3::NixVector::m_used
uint32_t m_used
Definition:
nix-vector.h:168
ns3::NixVector::AddNeighborIndex
void AddNeighborIndex(uint32_t newBits, uint32_t numberOfBits)
Definition:
nix-vector.cc:88
ns3::NixVector::~NixVector
~NixVector()
Definition:
nix-vector.cc:43
ns3::NixVector::m_currentVectorBitSize
uint32_t m_currentVectorBitSize
Definition:
nix-vector.h:175
ns3::SimpleRefCount
A template-based reference counting class.
Definition:
simple-ref-count.h:64
ns3::NixVector::BitCount
uint32_t BitCount(uint32_t numberOfNeighbors) const
Definition:
nix-vector.cc:365
src
network
model
nix-vector.h
Generated on Sat Apr 19 2014 14:07:05 for ns-3 by
1.8.6