A sink which outputs only one boolean value. More...
#include <ndn-cxx/security/transform/bool-sink.hpp>
Public Member Functions | |
BoolSink (bool &value) | |
Create a bool sink whose output will be stored in value . More... | |
void | end () |
Close the input interface of a module. More... | |
size_t | getIndex () const |
Get the module index. More... | |
bool | isEnd () const |
Check if the input interface of a module is closed. More... | |
void | setIndex (size_t index) |
Set the module index. More... | |
size_t | write (const uint8_t *buf, size_t size) |
Accept input data and perform transformation. More... | |
A sink which outputs only one boolean value.
It checks the first byte that is ever written into the sink, and set output true if the byte is non-zero, otherwise false.
Definition at line 37 of file bool-sink.hpp.
|
explicit |
Create a bool sink whose output will be stored in value
.
Definition at line 28 of file bool-sink.cpp.
|
inherited |
Close the input interface of a module.
This method will notify this module that there is no more input and that the module should finalize transformation.
Although end() can be invoked multiple times, only the first invocation takes effect.
Definition at line 52 of file transform-base.cpp.
|
inlineinherited |
Get the module index.
Definition at line 126 of file transform-base.hpp.
|
inlineinherited |
Check if the input interface of a module is closed.
Definition at line 108 of file transform-base.hpp.
|
inlineinherited |
Set the module index.
Definition at line 117 of file transform-base.hpp.
|
inherited |
Accept input data and perform transformation.
An upstream module should call this method to write data into this module. The written data will be transformed and the result will be written into the next downstream module.
An upstream module can keep calling this method to until end() is called, which indicates the end of input. After that, calling this method will cause Error.
If a Downstream implementation expects structured input (e.g., hex decoding requires byte-pair), it should not return less than size if final portion of input is not a complete record.
Error | if this module is closed or transformation error happens. |
Definition at line 41 of file transform-base.cpp.