Homepage Demos Overview Downloads Tutorials Reference
Credits

DummySocket.h

Go to the documentation of this file.
00001 #ifndef DummySocket_h_DEFINED
00002 #define DummySocket_h_DEFINED
00003 
00004 #include <stdarg.h>
00005 
00006 class Wireless;
00007 
00008 //! Tekkotsu wireless DummySocket class
00009 /*! 
00010  * This class provides a DummySocket that doesn't really do anything
00011  * It exists to maintain code readability; while supporting dogs without
00012  * wireless
00013  * Of course, since it does nothing, it doesn't need documentation
00014  */
00015 
00016 class DummySocket : public Socket {
00017   friend class Wireless;
00018 
00019 public:
00020   //! constructor
00021   DummySocket (int sockn) : Socket (sockn) { }
00022   virtual ~DummySocket () { }
00023   byte* getWriteBuffer(int bytesreq) { return NULL; }
00024   void write(int size) { }
00025   int read() { return -1; }
00026   byte* getReadBuffer() { return NULL; };
00027   void init() { }
00028   int setFlushType(FlushType_t fType) { return 0; }
00029   void setTextForward() { }
00030   void setForward(DummySocket * forsock) { } //!< sets another socket to send data to if this one is not connected
00031   void setVerbosity(int verbose) { }
00032   int write(const byte *buf, int size) { return -1; }
00033   int read(byte *buf, int size) { return -1; }
00034   int printf(const char *fmt, ...) { return 0; }
00035   int vprintf(const char *fmt, va_list al) { return 0; }
00036   int pprintf(int vlevel, const char *fmt, ...) { return 0; }
00037   void flush() { }
00038 };
00039 
00040 /*! @file
00041  * @brief Defines Tekkotsu wireless DummySocket class
00042  * @author alokl (Creator)
00043  * 
00044  * $Author: ejt $
00045  * $Name: tekkotsu-2_2_2 $
00046  * $Revision: 1.3 $
00047  * $State: Exp $
00048  * $Date: 2004/01/18 10:16:59 $
00049  */
00050 
00051 #endif

Tekkotsu v2.2.2
Generated Tue Jan 4 15:43:13 2005 by Doxygen 1.4.0