NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
ndnlp-sequence-generator.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
25
#ifndef NFD_DAEMON_FACE_NDNLP_SEQUENCE_GENERATOR_HPP
26
#define NFD_DAEMON_FACE_NDNLP_SEQUENCE_GENERATOR_HPP
27
28
#include "common.hpp"
29
30
namespace
nfd
{
31
namespace
ndnlp {
32
35
class
SequenceBlock
36
{
37
public
:
38
SequenceBlock
(uint64_t start,
size_t
count
);
39
42
uint64_t
43
operator[]
(
size_t
pos)
const
;
44
45
size_t
46
count
()
const
;
47
48
private
:
49
uint64_t m_start;
50
size_t
m_count;
51
};
52
53
inline
uint64_t
54
SequenceBlock::operator[]
(
size_t
pos)
const
55
{
56
if
(pos >= m_count)
57
BOOST_THROW_EXCEPTION(std::out_of_range(
"pos"
));
58
return
m_start +
static_cast<
uint64_t
>
(pos);
59
}
60
61
inline
size_t
62
SequenceBlock::count
()
const
63
{
64
return
m_count;
65
}
66
70
class
SequenceGenerator
: noncopyable
71
{
72
public
:
73
SequenceGenerator
();
74
79
SequenceBlock
80
nextBlock(
size_t
count
);
81
82
private
:
84
uint64_t m_next;
85
};
86
87
}
// namespace ndnlp
88
}
// namespace nfd
89
90
#endif // NFD_DAEMON_FACE_NDNLP_SEQUENCE_GENERATOR_HPP
nfd::ndnlp::SequenceBlock::operator[]
uint64_t operator[](size_t pos) const
Definition:
ndnlp-sequence-generator.hpp:54
nfd::ndnlp::SequenceBlock::count
size_t count() const
Definition:
ndnlp-sequence-generator.hpp:62
nfd::ndnlp::SequenceGenerator
generates sequence numbers
Definition:
ndnlp-sequence-generator.hpp:70
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:38
nfd::ndnlp::SequenceBlock
represents a block of sequence numbers
Definition:
ndnlp-sequence-generator.hpp:35
nfd::ndnlp::SequenceBlock::SequenceBlock
SequenceBlock(uint64_t start, size_t count)
Definition:
ndnlp-sequence-generator.cpp:30
ndnSIM
NFD
daemon
face
ndnlp-sequence-generator.hpp
Generated on Tue Feb 23 2016 22:18:44 for ndnSIM by
1.8.11