Main Page | Class Hierarchy | Class List | File List | Class Members

IOInterface.h

00001 // Copyright (c) 2004, Thomas Lochmatter, thl@lothosoft.ch 00002 00003 #ifndef classIOInterface 00004 #define classIOInterface 00005 00006 class IOInterface; 00007 00008 #include <string> 00009 #include <fstream> 00010 #include <iostream> 00011 #include "IOInterfaceList.h" 00012 00014 00025 class IOInterface { 00026 friend class IOInterfaceList; 00027 00028 protected: 00030 IOInterfaceList *mIOInterfaceList; 00032 IOInterface *mIOInterfaceNext; 00033 00035 int mFileHandle; 00036 00038 std::ofstream mLogInput; 00040 std::ofstream mLogOutput; 00041 00042 public: 00044 IOInterface(IOInterfaceList *iolist); 00046 ~IOInterface(); 00047 00049 IOInterfaceList *GetIOInterfaceList() {return mIOInterfaceList;} 00051 IOInterface *GetIOInterfaceNext() {return mIOInterfaceNext;} 00052 00054 virtual void OnInputAvailable(); 00056 virtual void OnDataArrival(unsigned char *data, int len) = 0; 00058 virtual void OnClose() = 0; 00059 00061 virtual bool Send(unsigned char *data, int len); 00063 virtual bool Send(const std::string &str); 00064 00066 int GetFileHandle() const {return mFileHandle;} 00068 int IsOpen() const {return (mFileHandle>=0);} 00069 00071 bool SetInputLogFile(const std::string &file, bool append=true); 00073 bool SetOutputLogFile(const std::string &file, bool append=true); 00074 }; 00075 00076 #endif

Generated on Wed Jun 1 09:19:07 2005 for libmip by doxygen 1.3.8