NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
status-dataset-context.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
#ifndef NDN_MGMT_STATUS_DATASET_CONTEXT_HPP
23
#define NDN_MGMT_STATUS_DATASET_CONTEXT_HPP
24
25
#include "../interest.hpp"
26
#include "../data.hpp"
27
#include "../util/time.hpp"
28
#include "../encoding/encoding-buffer.hpp"
29
#include "
control-response.hpp
"
30
31
namespace
ndn
{
32
namespace
mgmt {
33
36
class
StatusDatasetContext
: noncopyable
37
{
38
public
:
41
const
Name
&
42
getPrefix
()
const
;
43
54
StatusDatasetContext
&
55
setPrefix
(
const
Name
& prefix);
56
59
const
time::milliseconds&
60
getExpiry
()
const
;
61
68
StatusDatasetContext
&
69
setExpiry
(
const
time::milliseconds& expiry);
70
74
void
75
append
(
const
Block
& block);
76
80
void
81
end
();
82
91
void
92
reject
(
const
ControlResponse
& resp =
ControlResponse
().setCode(400));
93
94
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
95
typedef
std::function<void(
const
Name
& dataName,
const
Block
&
content
, time::milliseconds
imsFresh
,
96
bool
isFinalBlock)>
DataSender
;
97
typedef
std::function<void(const ControlResponse& resp)>
NackSender
;
98
99
StatusDatasetContext
(
const
Interest
& interest,
100
const
DataSender& dataSender,
101
const
NackSender& nackSender);
102
103
private
:
104
friend
class
Dispatcher
;
105
106
const
Interest
& m_interest;
107
DataSender m_dataSender;
108
NackSender m_nackSender;
109
Name
m_prefix;
110
time::milliseconds m_expiry;
111
112
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
113
shared_ptr<EncodingBuffer> m_buffer;
114
uint64_t m_segmentNo;
115
116
enum class
State {
117
INITIAL,
118
RESPONDED,
119
FINALIZED
120
};
121
State m_state;
122
};
123
124
}
// namespace mgmt
125
}
// namespace ndn
126
127
#endif // NDN_MGMT_STATUS_DATASET_CONTEXT_HPP
ndn::mgmt::StatusDatasetContext::NackSender
std::function< void(const ControlResponse &resp)> NackSender
Definition:
status-dataset-context.hpp:97
ndn::mgmt::StatusDatasetContext::reject
void reject(const ControlResponse &resp=ControlResponse().setCode(400))
declare the non-existence of a response
Definition:
status-dataset-context.cpp:109
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::mgmt::StatusDatasetContext::setExpiry
StatusDatasetContext & setExpiry(const time::milliseconds &expiry)
set expiration duration
Definition:
status-dataset-context.cpp:62
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
Definition:
common.hpp:43
ndn::mgmt::Dispatcher
represents a dispatcher on server side of NFD Management protocol
Definition:
dispatcher.hpp:129
ndn::Block
Class representing a wire element of NDN-TLV packet format.
Definition:
block.hpp:43
ndn::Interest
represents an Interest packet
Definition:
interest.hpp:45
ndn::mgmt::StatusDatasetContext::imsFresh
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const Block time::milliseconds imsFresh
Definition:
status-dataset-context.hpp:95
control-response.hpp
ndn::nfd::ControlResponse
ndn::mgmt::ControlResponse ControlResponse
Definition:
nfd-control-response.hpp:30
ndn::mgmt::StatusDatasetContext::content
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const Block & content
Definition:
status-dataset-context.hpp:95
ndn::mgmt::StatusDatasetContext::end
void end()
end the response successfully after appending zero or more blocks
Definition:
status-dataset-context.cpp:95
ndn::mgmt::StatusDatasetContext::getExpiry
const time::milliseconds & getExpiry() const
Definition:
status-dataset-context.cpp:56
ndn::Name
Name abstraction to represent an absolute name.
Definition:
name.hpp:46
ndn::mgmt::StatusDatasetContext::StatusDatasetContext
StatusDatasetContext(const Interest &interest, const DataSender &dataSender, const NackSender &nackSender)
Definition:
status-dataset-context.cpp:120
ndn::mgmt::StatusDatasetContext::getPrefix
const Name & getPrefix() const
Definition:
status-dataset-context.cpp:30
ndn::mgmt::StatusDatasetContext::setPrefix
StatusDatasetContext & setPrefix(const Name &prefix)
change prefix of Data packets
Definition:
status-dataset-context.cpp:36
ndn::mgmt::StatusDatasetContext::append
void append(const Block &block)
append a Block to the response
Definition:
status-dataset-context.cpp:69
ndn::mgmt::StatusDatasetContext::DataSender
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const Block time::milliseconds bool isFinalBlock DataSender
Definition:
status-dataset-context.hpp:95
ndn::mgmt::ControlResponse
ControlCommand response.
Definition:
control-response.hpp:32
ndn::mgmt::StatusDatasetContext
provides a context for generating response to a StatusDataset request
Definition:
status-dataset-context.hpp:36
ndnSIM
ndn-cxx
src
mgmt
status-dataset-context.hpp
Generated on Sat Nov 12 2016 16:02:52 for ndnSIM by
1.8.12