logwriterport.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef __LOGWRITERPORT_H
00030 #define __LOGWRITERPORT_H
00031
00032 #include <flexiport/port.h>
00033
00034 #include <map>
00035 #include <string>
00036
00041 namespace flexiport
00042 {
00043
00044 class LogFile;
00045
00072 class FLEXIPORT_EXPORT LogWriterPort : public Port
00073 {
00074 public:
00075 LogWriterPort (std::map<std::string, std::string> options);
00076 ~LogWriterPort ();
00077
00079 void Open ();
00081 void Close ();
00083 ssize_t Read (void * const buffer, size_t count);
00085 ssize_t ReadFull (void * const buffer, size_t count);
00087 ssize_t Skip (size_t count);
00090 ssize_t SkipUntil (uint8_t terminator, unsigned int count);
00092 ssize_t BytesAvailable ();
00094 ssize_t BytesAvailableWait ();
00096 ssize_t Write (const void * const buffer, size_t count);
00098 void Flush ();
00100 void Drain ();
00102 std::string GetStatus () const;
00104 void SetTimeout (Timeout timeout);
00106 void SetCanRead (bool canRead);
00108 void SetCanWrite (bool canWrite);
00110 bool IsOpen () const;
00111
00112 private:
00113 Port *_port;
00114 LogFile *_logFile;
00115 std::string _logFileName;
00116
00117 void CheckPort (bool read);
00118 };
00119
00120 }
00121
00124 #endif // __LOGWRITERPORT_H
00125