SourceXtractorPlusPlus 0.19.2
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
AsciiOutput.h
Go to the documentation of this file.
1
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
31
32namespace SourceXtractor {
33
35
36public:
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
50protected:
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
56private:
58};
59
60}
61
62#endif /* _SEIMPLEMENTATION_OUTPUT_ASCIIOUTPUT_H_ */
void addData(const Table &table)
AsciiOutput(const std::string &filename, SourceToRowConverter source_to_row, size_t flush_size)
Definition AsciiOutput.h:37
std::shared_ptr< Euclid::Table::TableWriter > m_table_writer
Definition AsciiOutput.h:57
void writeRows(const std::vector< Euclid::Table::Row > &rows) override
Definition AsciiOutput.h:51