00001 #ifndef QRK_M_CONNECTION_H 00002 #define QRK_M_CONNECTION_H 00003 00013 #include "Connection.h" 00014 #include <memory> 00015 00016 00017 namespace qrk 00018 { 00022 class mConnection : public Connection 00023 { 00024 mConnection(void); 00025 mConnection(const mConnection& rhs); 00026 mConnection& operator = (const mConnection& rhs); 00027 00028 struct pImpl; 00029 const std::auto_ptr<pImpl> pimpl; 00030 00031 public: 00032 explicit mConnection(Connection* connection); 00033 ~mConnection(void); 00034 00035 const char* what(void) const; 00036 00037 bool connect(const char* device, long baudrate); 00038 void disconnect(void); 00039 bool setBaudrate(long baudrate); 00040 long baudrate(void) const; 00041 bool isConnected(void) const; 00042 int send(const char* data, size_t count); 00043 int receive(char* data, size_t count, int timeout); 00044 size_t size(void) const; 00045 void flush(void); 00046 void clear(void); 00047 void ungetc(const char ch); 00048 }; 00049 } 00050 00051 #endif /* !QRK_CONNECTION_H */