SourceXtractorPlusPlus
1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SEImplementation
SEImplementation
Output
AsciiOutput.h
Go to the documentation of this file.
1
17
18
/*
19
* AsciiOutput.h
20
*
21
* Created on: Feb 8, 2022
22
* Author: mschefer
23
*/
24
25
#ifndef _SEIMPLEMENTATION_OUTPUT_ASCIIOUTPUT_H_
26
#define _SEIMPLEMENTATION_OUTPUT_ASCIIOUTPUT_H_
27
28
#include "Table/AsciiWriter.h"
29
30
#include "
SEImplementation/Output/FlushableOutput.h
"
31
32
namespace
SourceXtractor
{
33
34
class
AsciiOutput
:
public
FlushableOutput
{
35
36
public
:
37
AsciiOutput
(
const
std::string
& filename,
SourceToRowConverter
source_to_row,
size_t
flush_size)
38
:
FlushableOutput
(source_to_row, flush_size) {
39
if
(filename !=
""
) {
40
m_table_writer
=
std::make_shared<Euclid::Table::AsciiWriter>
(filename);
41
}
else
{
42
m_table_writer
=
std::make_shared<Euclid::Table::AsciiWriter>
(
std::cout
);
43
}
44
}
45
46
void
nextPart
()
override
{
47
// Do nothing
48
}
49
50
protected
:
51
void
writeRows
(
const
std::vector<Euclid::Table::Row>
& rows)
override
{
52
Euclid::Table::Table
table {rows};
53
m_table_writer
->addData(table);
54
}
55
56
private
:
57
std::shared_ptr<Euclid::Table::TableWriter>
m_table_writer
;
58
};
59
60
}
61
62
#endif
/* _SEIMPLEMENTATION_OUTPUT_ASCIIOUTPUT_H_ */
FlushableOutput.h
std::cout
std::string
Euclid::Table::Table
SourceXtractor::AsciiOutput::AsciiOutput
AsciiOutput(const std::string &filename, SourceToRowConverter source_to_row, size_t flush_size)
Definition
AsciiOutput.h:37
SourceXtractor::AsciiOutput::nextPart
void nextPart() override
Definition
AsciiOutput.h:46
SourceXtractor::AsciiOutput::m_table_writer
std::shared_ptr< Euclid::Table::TableWriter > m_table_writer
Definition
AsciiOutput.h:57
SourceXtractor::AsciiOutput::writeRows
void writeRows(const std::vector< Euclid::Table::Row > &rows) override
Definition
AsciiOutput.h:51
SourceXtractor::FlushableOutput::FlushableOutput
FlushableOutput(SourceToRowConverter source_to_row, size_t flush_size)
Definition
FlushableOutput.h:22
SourceXtractor::FlushableOutput::SourceToRowConverter
std::function< Euclid::Table::Row(const SourceInterface &)> SourceToRowConverter
Definition
FlushableOutput.h:20
std::make_shared
T make_shared(T... args)
SourceXtractor
Definition
Aperture.h:30
std::shared_ptr
std::vector
Generated by
1.15.0