ndn-cxx: NDN C++ library with eXperimental eXtensions 0.6.0 documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
bool-sink.cpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
#include "
bool-sink.hpp
"
23
24
namespace
ndn
{
25
namespace
security {
26
namespace
transform
{
27
28
BoolSink::BoolSink
(
bool
& value)
29
: m_hasValue(false)
30
, m_value(value)
31
{
32
}
33
34
size_t
35
BoolSink::doWrite(
const
uint8_t* buf,
size_t
size)
36
{
37
if
(!m_hasValue && size > 0) {
38
m_value = (buf[0] != 0);
39
m_hasValue =
true
;
40
}
41
return
size;
42
}
43
44
void
45
BoolSink::doEnd()
46
{
47
// nothing to do.
48
}
49
50
unique_ptr<Sink>
51
boolSink
(
bool
& value)
52
{
53
return
make_unique<BoolSink>(value);
54
}
55
56
}
// namespace transform
57
}
// namespace security
58
}
// namespace ndn
ndn
Copyright (c) 2013-2017 Regents of the University of California.
Definition:
common.hpp:66
ndn::security::transform::BoolSink::BoolSink
BoolSink(bool &value)
Create a bool sink whose output will be stored in value.
Definition:
bool-sink.cpp:28
transform
ndn::security::transform::boolSink
unique_ptr< Sink > boolSink(bool &value)
Definition:
bool-sink.cpp:51
bool-sink.hpp
src
security
transform
bool-sink.cpp
Generated on Mon Oct 16 2017 13:31:24 for ndn-cxx: NDN C++ library with eXperimental eXtensions by
1.8.11