ndn::security::transform::StreamSource Class Reference

A source taking an std::istream as input. More...

#include <ndn-cxx/security/transform/stream-source.hpp>

+ Inheritance diagram for ndn::security::transform::StreamSource:
+ Collaboration diagram for ndn::security::transform::StreamSource:

Public Member Functions

 StreamSource (std::istream &is, size_t bufLen=DEFAULT_BUFFER_LEN)
 Construst a source using is as input. More...
 
void operator>> (unique_ptr< Sink > sink)
 Connect to the last transformation module. More...
 
Sourceoperator>> (unique_ptr< Transform > transform)
 Connect to an intermediate transformation module. More...
 

Static Public Attributes

static const std::size_t DEFAULT_BUFFER_LEN = 1024
 

Protected Member Functions

void appendChain (unique_ptr< Downstream > tail)
 Connect to the next transformation module. More...
 
size_t getIndex () const
 Get the source module index (should always be 0). More...
 
DownstreamgetNext ()
 
void pump ()
 Pump all data into next transformation module. More...
 

Protected Attributes

unique_ptr< Downstreamm_next
 

Detailed Description

A source taking an std::istream as input.

Definition at line 34 of file stream-source.hpp.

Constructor & Destructor Documentation

◆ StreamSource()

ndn::security::transform::StreamSource::StreamSource ( std::istream &  is,
size_t  bufLen = DEFAULT_BUFFER_LEN 
)
explicit

Construst a source using is as input.

Parameters
isThe input stream
bufLenThe internal buffer size. The default size is 1024.
Precondition
bufLen must be larger than 0.

Definition at line 33 of file stream-source.cpp.

Member Function Documentation

◆ appendChain()

void ndn::security::transform::Upstream::appendChain ( unique_ptr< Downstream tail)
protectedinherited

Connect to the next transformation module.

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

◆ getIndex()

size_t ndn::security::transform::Source::getIndex ( ) const
inlineprotectedinherited

Get the source module index (should always be 0).

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

◆ getNext()

Downstream* ndn::security::transform::Upstream::getNext ( )
inlineprotectedinherited

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

◆ operator>>() [1/2]

void ndn::security::transform::Source::operator>> ( unique_ptr< Sink sink)
inherited

Connect to the last transformation module.

This method will trigger the source to pump data into the transformation pipeline.

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

◆ operator>>() [2/2]

Source & ndn::security::transform::Source::operator>> ( unique_ptr< Transform transform)
inherited

Connect to an intermediate transformation module.

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

◆ pump()

void ndn::security::transform::Source::pump ( )
protectedinherited

Pump all data into next transformation module.

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

Member Data Documentation

◆ DEFAULT_BUFFER_LEN

const std::size_t ndn::security::transform::StreamSource::DEFAULT_BUFFER_LEN = 1024
static

Definition at line 55 of file stream-source.hpp.

◆ m_next

unique_ptr<Downstream> ndn::security::transform::Upstream::m_next
protectedinherited

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