Abstraction of an intermediate transformation module.
More...
#include <ndn-cxx/security/transform/transform-base.hpp>
|
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) |
|
size_t | write (span< const uint8_t > buf) |
| Accept input data and perform transformation. More...
|
|
|
using | OBuffer = std::vector< uint8_t > |
|
Abstraction of an intermediate transformation module.
Definition at line 191 of file transform-base.hpp.
◆ OBuffer
◆ Transform()
ndn::security::transform::Transform::Transform |
( |
| ) |
|
|
protecteddefault |
◆ appendChain()
void ndn::security::transform::Upstream::appendChain |
( |
unique_ptr< Downstream > |
tail | ) |
|
|
protectedinherited |
◆ end()
void ndn::security::transform::Downstream::end |
( |
| ) |
|
|
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 46 of file transform-base.cpp.
◆ flushAllOutput()
void ndn::security::transform::Transform::flushAllOutput |
( |
| ) |
|
|
protected |
◆ flushOutputBuffer()
void ndn::security::transform::Transform::flushOutputBuffer |
( |
| ) |
|
|
protected |
Read the content from output buffer and write it into next module.
It is not guaranteed that all the content in output buffer will be flushed to next module.
Definition at line 68 of file transform-base.cpp.
◆ getIndex()
size_t ndn::security::transform::Downstream::getIndex |
( |
| ) |
const |
|
inlineinherited |
◆ getNext()
Downstream* ndn::security::transform::Upstream::getNext |
( |
| ) |
|
|
inlineprotectedinherited |
◆ isEnd()
bool ndn::security::transform::Downstream::isEnd |
( |
| ) |
const |
|
inlineinherited |
◆ isOutputBufferEmpty()
bool ndn::security::transform::Transform::isOutputBufferEmpty |
( |
| ) |
const |
|
protected |
◆ setIndex()
void ndn::security::transform::Downstream::setIndex |
( |
size_t |
index | ) |
|
|
inlineinherited |
◆ setOutputBuffer()
void ndn::security::transform::Transform::setOutputBuffer |
( |
unique_ptr< OBuffer > |
buffer | ) |
|
|
protected |
◆ write() [1/2]
size_t ndn::security::transform::Downstream::write |
( |
const uint8_t * |
buf, |
|
|
size_t |
size |
|
) |
| |
|
inlineinherited |
◆ write() [2/2]
size_t ndn::security::transform::Downstream::write |
( |
span< const uint8_t > |
buf | ) |
|
|
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.
- Returns
- number of bytes that has been written into this module
- Exceptions
-
Error | if this module is closed or transformation error happens. |
Definition at line 35 of file transform-base.cpp.
◆ m_next
unique_ptr<Downstream> ndn::security::transform::Upstream::m_next |
|
protectedinherited |