NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
buffer-stream.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
24
#ifndef NDN_ENCODING_BUFFER_STREAM_HPP
25
#define NDN_ENCODING_BUFFER_STREAM_HPP
26
27
#include "
buffer.hpp
"
28
29
#include <boost/iostreams/categories.hpp>
30
#include <boost/iostreams/stream.hpp>
31
32
namespace
ndn
{
33
34
namespace
detail {
35
38
class
BufferAppendDevice
39
{
40
public
:
41
typedef
char
char_type
;
42
typedef
boost::iostreams::sink_tag
category
;
43
44
explicit
45
BufferAppendDevice
(
Buffer
& container);
46
47
std::streamsize
48
write
(
const
char_type* s, std::streamsize n);
49
50
protected
:
51
Buffer
&
m_container
;
52
};
53
54
}
// namespace detail
55
70
class
OBufferStream
:
public
boost::iostreams::stream<detail::BufferAppendDevice>
71
{
72
public
:
73
OBufferStream
();
74
75
~
OBufferStream
();
76
80
shared_ptr<Buffer>
81
buf();
82
83
private
:
84
BufferPtr
m_buffer;
85
detail::BufferAppendDevice
m_device;
86
};
87
88
}
// namespace ndn
89
90
#endif // NDN_ENCODING_BUFFER_STREAM_HPP
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::BufferPtr
shared_ptr< Buffer > BufferPtr
Definition:
buffer.hpp:35
ndn::detail::BufferAppendDevice::BufferAppendDevice
BufferAppendDevice(Buffer &container)
Definition:
buffer-stream.cpp:27
ndn::detail::BufferAppendDevice
(implementation detail) a Boost.Iostreams.Sink which appends to an ndn::Buffer
Definition:
buffer-stream.hpp:38
ndn::detail::BufferAppendDevice::m_container
Buffer & m_container
Definition:
buffer-stream.hpp:51
ndn::detail::BufferAppendDevice::char_type
char char_type
Definition:
buffer-stream.hpp:41
buffer.hpp
ndn::OBufferStream
implements an output stream that constructs ndn::Buffer
Definition:
buffer-stream.hpp:70
ndn::detail::BufferAppendDevice::category
boost::iostreams::sink_tag category
Definition:
buffer-stream.hpp:42
ndn::detail::BufferAppendDevice::write
std::streamsize write(const char_type *s, std::streamsize n)
Definition:
buffer-stream.cpp:33
ndn::Buffer
Class representing a general-use automatically managed/resized buffer.
Definition:
buffer.hpp:44
ndnSIM
ndn-cxx
src
encoding
buffer-stream.hpp
Generated on Wed Jan 11 2017 18:17:13 for ndnSIM by
1.8.13