NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
+
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
+
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
+
Typedefs
a
b
c
d
e
f
h
i
l
m
n
o
p
q
r
s
t
u
v
Enumerations
+
Enumerator
a
b
c
d
e
f
h
i
k
l
m
n
o
p
q
r
s
u
v
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
+
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
~
+
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
w
+
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
+
Enumerator
a
d
e
f
i
k
l
n
p
r
s
u
w
+
Related Functions
b
c
d
e
f
g
i
k
l
m
n
o
p
s
v
+
Files
File List
+
File Members
+
All
a
b
c
d
e
f
g
h
i
k
l
m
n
p
r
s
u
v
w
+
Functions
c
f
h
m
r
s
u
w
+
Variables
a
c
d
g
k
l
n
p
r
s
Typedefs
+
Macros
b
d
e
f
i
l
m
n
p
r
s
u
v
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
stream-sink.cpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
#include "
stream-sink.hpp
"
23
24
namespace
ndn
{
25
namespace
security
{
26
namespace
transform {
27
28
StreamSink::StreamSink
(std::ostream& os)
29
: m_os(os)
30
{
31
}
32
33
size_t
34
StreamSink::doWrite(
const
uint8_t* buf,
size_t
size)
35
{
36
m_os.write(reinterpret_cast<const char*>(buf), size);
37
38
if
(m_os.bad())
39
BOOST_THROW_EXCEPTION(
Error
(
getIndex
(),
"Fail to write data into output stream"
));
40
41
return
size;
42
}
43
44
void
45
StreamSink::doEnd()
46
{
47
m_os.flush();
48
}
49
50
unique_ptr<Sink>
51
streamSink
(std::ostream& os)
52
{
53
return
make_unique<StreamSink>(os);
54
}
55
56
57
}
// namespace transform
58
}
// namespace security
59
}
// namespace ndn
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::security::transform::Downstream::getIndex
size_t getIndex() const
Get the module index.
Definition:
transform-base.hpp:125
ndn::security::transform::StreamSink::StreamSink
StreamSink(std::ostream &os)
Create a stream sink which outputs to os.
Definition:
stream-sink.cpp:28
stream-sink.hpp
ndn::security::transform::streamSink
unique_ptr< Sink > streamSink(std::ostream &os)
Definition:
stream-sink.cpp:51
ndn::security::transform::Error
Base class of transformation error.
Definition:
transform-base.hpp:47
security
ndnSIM
ndn-cxx
src
security
transform
stream-sink.cpp
Generated on Wed Jan 11 2017 18:17:14 for ndnSIM by
1.8.13