BufferStream.hh

Go to the documentation of this file.
00001 
00019 #ifndef avro_BufferStream_hh__
00020 #define avro_BufferStream_hh__
00021 
00022 #include "BufferStreambuf.hh"
00023 
00030 namespace avro {
00031 
00038 class ostream : public std::ostream {
00039 
00040   public:
00041 
00043     ostream() : 
00044         std::ostream(&obuf_) 
00045     { }
00046 
00048     ostream(OutputBuffer &buf) : 
00049         std::ostream(&obuf_),
00050         obuf_(buf)
00051     { }
00052 
00054     const OutputBuffer &getBuffer() const {
00055         return obuf_.getBuffer();
00056     }
00057 
00058   protected:
00059 
00060     ostreambuf obuf_;
00061 };
00062 
00074 class istream : public std::istream {
00075 
00076   public:
00077 
00079     explicit istream(const InputBuffer &buf) : 
00080         std::istream(&ibuf_), ibuf_(buf)
00081     { }
00082 
00085     explicit istream(const OutputBuffer &buf) : 
00086         std::istream(&ibuf_), ibuf_(buf)
00087     { }
00088 
00090     const InputBuffer &getBuffer() const {
00091         return ibuf_.getBuffer();
00092     }
00093 
00094   protected:
00095 
00096     istreambuf ibuf_;
00097 };
00098 
00099 } // namespace avro
00100 
00101 #endif 
Generated on Thu Sep 2 18:40:54 2010 for Avro C++ by  doxygen 1.6.3