8 #ifndef Sawyer_NullBuffer_H
9 #define Sawyer_NullBuffer_H
11 #include <Sawyer/Buffer.h>
12 #include <Sawyer/Sawyer.h>
14 #include <boost/serialization/access.hpp>
15 #include <boost/serialization/base_object.hpp>
16 #include <boost/serialization/nvp.hpp>
25 template<
class A,
class T>
36 friend class boost::serialization::access;
41 void serialize(S &s,
const unsigned ) {
42 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Super);
43 s & BOOST_SERIALIZATION_NVP(size_);
63 return start < size_ ? size_ - start : 0;
Address available(Address start) const
Distance to end of buffer.
static Buffer< A, T >::Ptr instance(Address size)
Construct a new buffer.
Buffer< A, T >::Ptr copy() const
Create a new copy of buffer data.
SharedPointer< Buffer > Ptr
Reference counting smart pointer.
void resize(Address newSize)
Change the size of the buffer.
Buffer< A, T > Super
Type of base class.
Base class for all buffers.
Reference-counting intrusive smart pointer.
Name space for the entire library.
Address read(Value *buf, Address address, Address n) const
Reads data from a buffer.
A Address
Type of addresses.
const Value * data() const
Data for the buffer.
A Address
Key type for addressing data.
virtual Address size() const
Size of buffer.
T Value
Type of values stored in the buffer.
Address write(const Value *, Address, Address)
Writes data to a buffer.