bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
file_reader_base.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2024 <copyright holder> <email>
2// SPDX-License-Identifier: Apache-2.0
3
4#ifndef BITSIM_UTILS_IO_FILE_READER_BASE_H
5#define BITSIM_UTILS_IO_FILE_READER_BASE_H
6
9
10#include <fstream>
11#include <string>
12
13namespace bitsim
14{
15namespace utils
16{
17namespace io
18{
22class FileReaderBase : public FileHandlerBase<std::ifstream>
23{
24 public:
25 virtual ~FileReaderBase() = default;
26
30 virtual void open() override;
31
36 bool eof() const { return this->get_file_stream().eof(); }
37
38 protected:
42 FileReaderBase(const std::string &file_name, FileFormats::Type t);
43};
44
45} // namespace io
46} // namespace utils
47} // namespace bitsim
48#endif // BITSIM_UTILS_IO_FILE_READER_BASE_H
FileHandlerBase(const std::string &file_name, FileFormats::Type t)
Definition file_handler_base.h:181
handler_type & get_file_stream() noexcept
Definition file_handler_base.h:85
bool eof() const
Returns true if the underlying stream handler has reached the EOF.
Definition file_reader_base.h:36
virtual void open() override
Attempts to open the file for reading.
Definition file_reader_base.cpp:20
FileReaderBase(const std::string &file_name, FileFormats::Type t)
Constructor.
Definition file_reader_base.cpp:15
Definition csv_file_reader.cpp:12
Definition bitsim_utils.h:11
Definition dc_motor_backend_base.h:9
Type
Definition file_formats.h:24