NIST Biometric Evaluation Framework
Software components for biometric technology evaluations
be_io_filelogsheet.h
Go to the documentation of this file.
1
11#ifndef __BE_IO_FILELOGSHEET_H__
12#define __BE_IO_FILELOGSHEET_H__
13
14#include <fstream>
15#include <vector>
16
17#include <be_io_logsheet.h>
18
19namespace BiometricEvaluation
20{
21 namespace IO
22 {
35 {
36 public:
37
62 const std::string &url,
63 const std::string &description);
64
87 const std::string &url);
88
91
107 static void
109 std::vector<std::shared_ptr<FileLogsheet>>
110 &logsheets);
111
113 static const int32_t BE_FILELOGSHEET_SEQ_START = 1;
115 static const int32_t BE_FILELOGSHEET_SEQ_NEXT = 2;
116
142 std::string
144 bool allEntries = false,
145 bool trim = true,
146 int32_t cursor = BE_FILELOGSHEET_SEQ_NEXT);
147
160 static std::string
162 const std::string &entry);
163
164
165 /* Declare implementations of parent interface */
166 void write(const std::string &entry);
167 void writeComment(const std::string &entry);
168 void writeDebug(const std::string &entry);
169 void sync();
170
171 protected:
176
178 std::unique_ptr<std::fstream> _theLogFile;
179
187 void
189
191 std::shared_ptr<std::fstream> _sequenceFile;
192
194 std::streamoff _cursor;
195 };
196 }
197}
198
199#endif /* __BE_IO_FILELOGSHEET_H__ */
A class to represent a single logging mechanism with a file as the backing store.
static const int32_t BE_FILELOGSHEET_SEQ_START
Sequence from beginning.
FileLogsheet & operator=(const FileLogsheet &)
Prevent copying of FileLogsheet objects.
void write(const std::string &entry)
Write a string as an entry to the backing store.
void updateCursor()
Update the cursor position of the sequence file.
FileLogsheet(const std::string &url, const std::string &description)
Create a new log sheet.
FileLogsheet(const FileLogsheet &)
Prevent copying of FileLogsheet objects.
std::streamoff _cursor
Position of the sequencer, relative to SOF.
static const int32_t BE_FILELOGSHEET_SEQ_NEXT
Sequence from current position.
void writeDebug(const std::string &entry)
Write a string as a debug entry to the backing store.
void writeComment(const std::string &entry)
Write a string as a comment to the backing store.
void sync()
Synchronize any buffered data to the underlying backing store.
std::string sequence(bool allEntries=false, bool trim=true, int32_t cursor=BE_FILELOGSHEET_SEQ_NEXT)
Sequence through a FileLogsheet, returning one entry per invocation.
std::shared_ptr< std::fstream > _sequenceFile
Stream used for sequencing.
static void mergeLogsheets(std::vector< std::shared_ptr< FileLogsheet > > &logsheets)
Merge multiple FileLogsheets into a single FileLogsheet.
static std::string trim(const std::string &entry)
Trim delimiters from FileLogsheet entries.
std::unique_ptr< std::fstream > _theLogFile
Stream used for writing the log file.
FileLogsheet(const std::string &url)
Open an existing log sheet for appending.
A class to represent a logging mechanism.
This software was developed at the National Institute of Standards and Technology (NIST) by employees...