bitrl & cuberl Documentation
Simulation engine for reinforcement learning agents
Loading...
Searching...
No Matches
file_writer_base.h
Go to the documentation of this file.
1#ifndef FILE_WRITER_BASE_H
2#define FILE_WRITER_BASE_H
3
6
7#include "boost/noncopyable.hpp"
8#include <fstream>
9#include <string>
10
11namespace bitrl
12{
13namespace utils::io
14{
15
19class FileWriterBase : public FileHandlerBase<std::ofstream>
20{
21
22 public:
26 static char default_comment_mark() { return '#'; }
27
31 FileWriterBase() = default;
32
37 FileWriterBase(const std::string &file_name,
38 FileFormats::Type t); // const std::ios_base::openmode mode=std::ios_base::out);
39
43 virtual ~FileWriterBase();
44
48 virtual void open() override;
49
53 char get_comment_mark() const { return comment_mark_; }
54
59
64 virtual void write_header();
65
66 protected:
71};
72
73} // namespace utils::io
74} // namespace bitrl
75#endif // FILE_WRITER_BASE_H
Definition file_handler_base.h:22
The FileWriterBase class.
Definition file_writer_base.h:20
virtual void open() override
Open the file for writing.
Definition file_writer_base.cpp:21
virtual ~FileWriterBase()
Destructor.
Definition file_writer_base.cpp:19
char get_comment_mark() const
Return the mark that signifies the beginning of a comment line.
Definition file_writer_base.h:53
char comment_mark_
The mark that signifies the beginning of a comment line. The default is #.
Definition file_writer_base.h:70
virtual void write_header()
Write the header of the file. By default some information such as date and time the file was created ...
Definition file_writer_base.cpp:59
static char default_comment_mark()
The default comment mark.
Definition file_writer_base.h:26
void set_comment_mark(char mark)
Set the comment mark.
Definition file_writer_base.h:58
FileWriterBase()=default
Default ctor.
OutT resolve(const std::string &name, const std::map< std::string, std::any > &input)
Definition std_map_utils.h:25
Definition bitrl_consts.h:14
Type
Definition file_formats.h:24