Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 20th, 2010 | Syntax: C++ | Size: 0.48 KB | Hits: 44 | Expires: Never
Copy text to clipboard
  1. #ifndef IOLINE_H
  2. #define IOLINE_H
  3.  
  4. #include <cstring>
  5. #include <stdexcept>
  6. #include <string>
  7. #include <stdint.h>
  8.  
  9. class IOLineError : public std::runtime_error
  10. {
  11. public:
  12.         IOLineError(std::string const& s);
  13. };
  14.  
  15. class IOLine
  16. {
  17. public:
  18.         IOLine();
  19.         virtual ~IOLine();
  20.  
  21.         virtual size_t read(int toread, uint8_t* buf) = 0;
  22.         virtual size_t write(int towrite, uint8_t* buf) = 0;
  23.         virtual void purge() = 0;
  24.  
  25.         virtual bool setSpeed(int speed) = 0;
  26. };
  27.  
  28. #endif // IOLINE_H