SourceXtractorPlusPlus  0.19
SourceXtractor++, the next generation SExtractor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
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:
58 };
59 
60 }
61 
62 #endif /* _SEIMPLEMENTATION_OUTPUT_ASCIIOUTPUT_H_ */
STL class.
string filename
Definition: conf.py:65
std::shared_ptr< Euclid::Table::TableWriter > m_table_writer
Definition: AsciiOutput.h:57
void nextPart() override
Definition: AsciiOutput.h:46
void writeRows(const std::vector< Euclid::Table::Row > &rows) override
Definition: AsciiOutput.h:51
AsciiOutput(const std::string &filename, SourceToRowConverter source_to_row, size_t flush_size)
Definition: AsciiOutput.h:37