#ifndef __INC_RINGBUFFER_H__ #define __INC_RINGBUFFER_H__ #include class ringbuffer { public: ringbuffer(); int write(char); int read(char&); private: enum { MAX_BUFFER_SIZE = 2 }; std::array buffer; std::array::iterator head; std::array::iterator tail; }; #endif