logreaderport.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 __LOGREADERPORT_H
00030 #define __LOGREADERPORT_H
00031
00032 #include <flexiport/port.h>
00033
00034 #include <map>
00035 #include <string>
00036
00041 namespace flexiport
00042 {
00043
00044 class LogFile;
00045
00082 class FLEXIPORT_EXPORT LogReaderPort : public Port
00083 {
00084 public:
00085 LogReaderPort (std::map<std::string, std::string> options);
00086 ~LogReaderPort ();
00087
00089 void Open ();
00091 void Close ();
00093 ssize_t Read (void * const buffer, size_t count);
00095 ssize_t ReadFull (void * const buffer, size_t count);
00097 ssize_t BytesAvailable ();
00099 ssize_t BytesAvailableWait ();
00101 ssize_t Write (const void * const buffer, size_t count);
00103 void Flush ();
00105 void Drain ();
00107 std::string GetStatus () const;
00109 void SetTimeout (Timeout timeout);
00111 void SetCanRead (bool canRead);
00113 void SetCanWrite (bool canWrite);
00115 bool IsOpen () const;
00116
00117 private:
00118 LogFile *_logFile;
00119 std::string _logFileName;
00120 unsigned int _strictness;
00121 int _jitter;
00122 bool _ignoreTimes;
00123 bool _open;
00124
00125 bool ProcessOption (const std::string &option, const std::string &value);
00126 void CheckPort (bool read);
00127 };
00128
00129 }
00130
00133 #endif // __LOGREADERPORT_H
00134