Libbarrett
1.2.4
|
00001 00033 #ifndef BARRETT_LOG_READER_H_ 00034 #define BARRETT_LOG_READER_H_ 00035 00036 00037 #include <fstream> 00038 #include <barrett/detail/ca_macro.h> 00039 #include <barrett/log/traits.h> 00040 00041 00042 namespace barrett { 00043 namespace log { 00044 00045 00046 template<typename T, typename Traits = Traits<T> > 00047 class Reader { 00048 public: 00049 typedef typename Traits::parameter_type parameter_type; 00053 Reader(const char* fileName); 00054 ~Reader(); 00055 00059 size_t numRecords() const; 00063 T getRecord(); 00067 void exportCSV(const char* outputFileName); 00071 void exportCSV(std::ostream& os); 00075 void close(); 00076 00077 protected: 00078 std::ifstream file; 00079 size_t recordLength, recordCount; 00080 char* buffer; 00081 00082 private: 00083 DISALLOW_COPY_AND_ASSIGN(Reader); 00084 }; 00085 00086 00087 } 00088 } 00089 00090 00091 // include template definitions 00092 #include <barrett/log/detail/reader-inl.h> 00093 00094 00095 #endif /* BARRETT_LOG_READER_H_ */