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

implements an output stream that constructs ndn::Buffer More...

#include <buffer-stream.hpp>

Inheritance diagram for ndn::OBufferStream:
Collaboration diagram for ndn::OBufferStream:

Public Member Functions

 OBufferStream ()
 
 ~OBufferStream ()
 
shared_ptr< Bufferbuf ()
 Flush written data to the stream and return shared pointer to the underlying buffer. More...
 

Detailed Description

implements an output stream that constructs ndn::Buffer

The benefit of using stream interface is that it provides automatic buffering of written data and eliminates (or reduces) overhead of resizing the underlying buffer when writing small pieces of data.

Usage example:

obuf.put(0);
obuf.write(anotherBuffer, anotherBufferSize);
shared_ptr<Buffer> buf = obuf.buf();

Definition at line 70 of file buffer-stream.hpp.

Constructor & Destructor Documentation

◆ OBufferStream()

ndn::OBufferStream::OBufferStream ( )

Definition at line 41 of file buffer-stream.cpp.

References websocketpp::session::state::open.

◆ ~OBufferStream()

ndn::OBufferStream::~OBufferStream ( )

Definition at line 48 of file buffer-stream.cpp.

References close().

Member Function Documentation

◆ buf()


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