Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
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 //! provides a no-op implementation of Socket for disabled operation
00017 class DummySocket : public Socket {
00018   friend class Wireless;
00019 
00020 public:
00021   //! constructor
00022   DummySocket (int sockn) : Socket (sockn) { }
00023   //! destructor
00024   virtual ~DummySocket () { }
00025   
00026   byte* getWriteBuffer(int /*bytesreq*/) { return NULL; } //!< returns NULL
00027   void write(int /*size*/) { } //!< no-op
00028   int read() { return -1; } //!< no-op (returns -1)
00029   byte* getReadBuffer() { return NULL; }; //!< no-op (returns NULL)
00030   void init() { } //!< no-op
00031   int setFlushType(FlushType_t /*fType*/) { return 0; } //!< no-op
00032   void setTextForward() { } //!< no-op
00033   void setForward(DummySocket * /*forsock*/) { } //!< sets another socket to send data to if this one is not connected
00034   void setVerbosity(int /*verbose*/) { } //!< no-op
00035   int write(const byte * /*buf*/, int /*size*/) { return -1; } //!< no-op (returns -1)
00036   int read(byte * /*buf*/, int /*size*/) { return -1; } //!< no-ip (returns -1)
00037   int printf(const char */*fmt*/, ...) { return 0; } //!< no-op
00038   int vprintf(const char */*fmt*/, va_list /*al*/) { return 0; } //!< no-op
00039   int pprintf(int /*vlevel*/, const char * /*fmt*/, ...) { return 0; } //!< no-op
00040   void flush() { } //!< no-op
00041 };
00042 
00043 /*! @file
00044  * @brief Defines Tekkotsu wireless DummySocket class
00045  * @author alokl (Creator)
00046  */
00047 
00048 #endif

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:37 2016 by Doxygen 1.6.3