OpenEV
Extending OpenCV to event-based vision
Loading...
Searching...
No Matches
plain-text-reader.hpp
Go to the documentation of this file.
1
6
#ifndef OPENEV_READERS_PLAIN_TEXT_READER_HPP
7
#define OPENEV_READERS_PLAIN_TEXT_READER_HPP
8
9
#include "
openev/core/types.hpp
"
10
#include "openev/readers/abstract-reader.hpp"
11
#include <fstream>
12
#include <regex>
13
#include <string>
14
15
namespace
ev {
16
17
enum
PlainTextReaderColumns : uint8_t {
18
TXYP,
19
XYTP,
20
PTXY,
21
PXYT
22
};
23
27
class
PlainTextReader
:
public
AbstractReader_
{
28
public
:
34
explicit
PlainTextReader
(
const
std::string &filename,
const
PlainTextReaderColumns columns = PlainTextReaderColumns::TXYP,
const
std::string &separator =
" "
);
35
37
~PlainTextReader
()
override
;
38
PlainTextReader
(
const
PlainTextReader
&) =
delete
;
39
PlainTextReader
(
PlainTextReader
&&)
noexcept
=
delete
;
40
PlainTextReader
&operator=(
const
PlainTextReader
&) =
delete
;
41
PlainTextReader
&operator=(
PlainTextReader
&&)
noexcept
=
delete
;
43
44
private
:
45
std::fstream file_;
46
std::regex separator_;
47
std::function<void(std::stringstream &,
ev::Event
&)> parser_;
48
bool
replace_;
49
void
reset_()
override
;
50
bool
read_(
Event
&e)
override
;
51
};
52
53
}
// namespace ev
54
55
#endif
// OPENEV_READERS_PLAIN_TEXT_READER_HPP
ev::AbstractReader_
This is an auxiliary class. This class cannot be instanced.
Definition
abstract-reader.hpp:20
ev::PlainTextReader::PlainTextReader
PlainTextReader(const std::string &filename, const PlainTextReaderColumns columns=PlainTextReaderColumns::TXYP, const std::string &separator=" ")
Definition
plain-text-reader.cpp:10
types.hpp
Basic event-based vision structures based on OpenCV components.
ev::Event
Eventi Event
Definition
types.hpp:242
modules
readers
include
openev
readers
plain-text-reader.hpp
Generated by
1.13.2