A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
nix-vector.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 The Georgia Institute of Technology
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
* Authors: Josh Pelkey <jpelkey@gatech.edu>
18
*/
19
20
#ifndef NIX_VECTOR_H
21
#define NIX_VECTOR_H
22
23
#include "
buffer.h
"
24
25
#include "ns3/ptr.h"
26
#include "ns3/simple-ref-count.h"
27
28
namespace
ns3
29
{
30
64
class
NixVector
:
public
SimpleRefCount
<NixVector>
65
{
66
public
:
67
NixVector
();
68
~NixVector
();
72
Ptr<NixVector>
Copy
()
const
;
77
NixVector
(
const
NixVector
& o);
84
NixVector
&
operator=
(
const
NixVector
& o);
97
void
AddNeighborIndex
(uint32_t newBits, uint32_t numberOfBits);
111
uint32_t
ExtractNeighborIndex
(uint32_t numberOfBits);
116
uint32_t
GetRemainingBits
()
const
;
120
uint32_t
GetSerializedSize
()
const
;
131
uint32_t
Serialize
(uint32_t* buffer, uint32_t maxSize)
const
;
142
uint32_t
Deserialize
(
const
uint32_t* buffer, uint32_t size);
152
uint32_t
BitCount
(uint32_t numberOfNeighbors)
const
;
153
158
void
SetEpoch
(uint32_t epoch);
159
164
uint32_t
GetEpoch
()
const
;
165
166
private
:
168
typedef
std::vector<uint32_t>
NixBits_t
;
169
177
void
DumpNixVector
(std::ostream& os)
const
;
178
186
friend
std::ostream&
operator<<
(std::ostream& os,
const
NixVector
& nix);
187
188
NixBits_t
m_nixVector
;
189
uint32_t
m_used
;
190
195
uint32_t
m_totalBitSize
;
196
197
uint32_t
m_epoch
;
198
205
void
PrintDec2BinNix
(uint32_t decimalNum, uint32_t bitCount, std::ostream& os)
const
;
206
};
207
}
// namespace ns3
208
209
#endif
/* NIX_VECTOR_H */
buffer.h
ns3::NixVector
Neighbor-index data structure for nix-vector routing.
Definition:
nix-vector.h:65
ns3::NixVector::AddNeighborIndex
void AddNeighborIndex(uint32_t newBits, uint32_t numberOfBits)
Definition:
nix-vector.cc:88
ns3::NixVector::m_used
uint32_t m_used
For tracking where we are in the nix-vector.
Definition:
nix-vector.h:189
ns3::NixVector::GetSerializedSize
uint32_t GetSerializedSize() const
Definition:
nix-vector.cc:199
ns3::NixVector::~NixVector
~NixVector()
Definition:
nix-vector.cc:41
ns3::NixVector::m_epoch
uint32_t m_epoch
Epoch of the Nix-vector creation.
Definition:
nix-vector.h:197
ns3::NixVector::NixVector
NixVector()
Definition:
nix-vector.cc:32
ns3::NixVector::operator<<
friend std::ostream & operator<<(std::ostream &os, const NixVector &nix)
Stream insertion operator.
Definition:
nix-vector.cc:80
ns3::NixVector::GetRemainingBits
uint32_t GetRemainingBits() const
Definition:
nix-vector.cc:323
ns3::NixVector::operator=
NixVector & operator=(const NixVector &o)
Definition:
nix-vector.cc:55
ns3::NixVector::m_totalBitSize
uint32_t m_totalBitSize
A counter of how total bits are in the nix-vector.
Definition:
nix-vector.h:195
ns3::NixVector::Serialize
uint32_t Serialize(uint32_t *buffer, uint32_t maxSize) const
Definition:
nix-vector.cc:213
ns3::NixVector::NixBits_t
std::vector< uint32_t > NixBits_t
Typedef: the NixVector bits storage.
Definition:
nix-vector.h:168
ns3::NixVector::ExtractNeighborIndex
uint32_t ExtractNeighborIndex(uint32_t numberOfBits)
Definition:
nix-vector.cc:144
ns3::NixVector::m_nixVector
NixBits_t m_nixVector
the actual nix-vector
Definition:
nix-vector.h:188
ns3::NixVector::SetEpoch
void SetEpoch(uint32_t epoch)
Set the NixVector Epoch.
Definition:
nix-vector.cc:381
ns3::NixVector::DumpNixVector
void DumpNixVector(std::ostream &os) const
Print the NixVector.
Definition:
nix-vector.cc:289
ns3::NixVector::Deserialize
uint32_t Deserialize(const uint32_t *buffer, uint32_t size)
Definition:
nix-vector.cc:239
ns3::NixVector::Copy
Ptr< NixVector > Copy() const
Definition:
nix-vector.cc:69
ns3::NixVector::BitCount
uint32_t BitCount(uint32_t numberOfNeighbors) const
Definition:
nix-vector.cc:331
ns3::NixVector::PrintDec2BinNix
void PrintDec2BinNix(uint32_t decimalNum, uint32_t bitCount, std::ostream &os) const
Internal for pretty printing of nix-vector (no fill)
Definition:
nix-vector.cc:354
ns3::NixVector::GetEpoch
uint32_t GetEpoch() const
Get the NixVector Epoch.
Definition:
nix-vector.cc:387
ns3::Ptr< NixVector >
ns3::SimpleRefCount
A template-based reference counting class.
Definition:
simple-ref-count.h:81
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
network
model
nix-vector.h
Generated on Sun Mar 3 2024 17:11:05 for ns-3 by
1.9.1