Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
DummySocket.hGo 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 * $Author: ejt $ 00048 * $Name: tekkotsu-2_4_1 $ 00049 * $Revision: 1.5 $ 00050 * $State: Exp $ 00051 * $Date: 2005/08/07 04:11:04 $ 00052 */ 00053 00054 #endif |
Tekkotsu v2.4.1 |
Generated Tue Aug 16 16:32:46 2005 by Doxygen 1.4.4 |