MyraMath
Public Member Functions | List of all members
myra::VectorStream Class Reference

Wraps a std::vector<char>, presents it as both an InputStream and OutputStream. Useful for hygienic unit testing of classes that serialize. More...

#include <VectorStream.h>

Inheritance diagram for myra::VectorStream:
[legend]
Collaboration diagram for myra::VectorStream:
[legend]

Public Member Functions

 VectorStream ()
 Default constructs an empty VectorStream.
 
virtual void write_binary (const char *p, size_t n)
 Writes n bytes into buffer, using push_back()
 
virtual void read_binary (char *p, size_t n)
 Reads n bytes from buffer, writing into p.
 
void swap (std::vector< char > &that)
 Swap internal contents into that, overwriting it.
 
- Public Member Functions inherited from myra::InputStream
template<class T >
read ()
 
- Public Member Functions inherited from myra::OutputStream
template<class T >
void write (const T &t)
 

Detailed Description

Wraps a std::vector<char>, presents it as both an InputStream and OutputStream. Useful for hygienic unit testing of classes that serialize.


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