NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::security::transform::Downstream Class Referenceabstract

The downstream interface of a transformation module. More...

#include <transform-base.hpp>

Inheritance diagram for ndn::security::transform::Downstream:
Collaboration diagram for ndn::security::transform::Downstream:

Public Member Functions

virtual ~Downstream ()=default
 
size_t write (span< const uint8_t > buf)
 Accept input data and perform transformation. More...
 
void end ()
 Close the input interface of a module. 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 getIndex () const
 Get the module index. More...
 

Protected Member Functions

 Downstream ()=default
 

Detailed Description

The downstream interface of a transformation module.

A module can accept input through this interface.

Definition at line 69 of file transform-base.hpp.

Constructor & Destructor Documentation

◆ ~Downstream()

virtual ndn::security::transform::Downstream::~Downstream ( )
virtualdefault

◆ Downstream()

ndn::security::transform::Downstream::Downstream ( )
protecteddefault

Member Function Documentation

◆ write()

size_t ndn::security::transform::Downstream::write ( span< const uint8_t >  buf)

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
Errorif this module is closed or transformation error happens.

Definition at line 35 of file transform-base.cpp.

References ndn::security::transform::Error::Error(), ndn::security::transform::Error::getIndex(), and NDN_THROW.

◆ end()

void ndn::security::transform::Downstream::end ( )

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.

◆ isEnd()

bool ndn::security::transform::Downstream::isEnd ( ) const
inline

Check if the input interface of a module is closed.

Definition at line 109 of file transform-base.hpp.

◆ setIndex()

void ndn::security::transform::Downstream::setIndex ( size_t  index)
inline

Set the module index.

Definition at line 118 of file transform-base.hpp.

◆ getIndex()


The documentation for this class was generated from the following files: