6 #ifndef MYRAMATH_IO_READERWRITER_H 7 #define MYRAMATH_IO_READERWRITER_H 25 { out.write_binary(reinterpret_cast<const char*>(&pod),
sizeof(pod)); }
27 { POD pod; in.read_binary(reinterpret_cast<char*>(&pod),
sizeof(pod));
return pod; }
37 {
return read_pod<size_t>(in); }
39 { write_pod<size_t>(s,out); }
47 {
return read_pod<int>(in); }
49 { write_pod<int>(i,out); }
57 {
return read_pod<float>(in); }
59 { write_pod<float>(f,out); }
67 {
return read_pod<double>(in); }
69 { write_pod<double>(d,out); }
77 {
return read_pod<char>(in); }
79 { write_pod<char>(c,out); }
Abstraction layer, serializable objects write themselves to these.
Definition: Streams.h:39
Specialize this class liberally. See /detail for example specializations, for various std::containers...
Definition: ReaderWriter.h:21
static T read(InputStream &in)
.. read() should try to delegate to a stream constructor, return T(in)
Definition: Streams.h:29
static void write(const T &t, OutputStream &out)
.. and write() should try to delegate to a member function, T.write(out)
Definition: Streams.h:33