equal
deleted
inserted
replaced
42 using namespace relpipe::reader::handlers; |
42 using namespace relpipe::reader::handlers; |
43 |
43 |
44 // TODO: use rather RelationalReaderValueHadler |
44 // TODO: use rather RelationalReaderValueHadler |
45 class PassthroughHandler : public RelationalReaderStringHadler { |
45 class PassthroughHandler : public RelationalReaderStringHadler { |
46 private: |
46 private: |
47 writer::RelationalWriter* relationalWriter; |
47 std::shared_ptr<writer::RelationalWriter> relationalWriter; |
48 public: |
48 public: |
49 |
49 |
50 PassthroughHandler(std::ostream& output) : relationalWriter(writer::Factory::create(output)) { |
50 PassthroughHandler(std::ostream& output) { |
51 } |
51 relationalWriter.reset(writer::Factory::create(output)); |
52 |
|
53 virtual ~PassthroughHandler() { |
|
54 delete relationalWriter; |
|
55 } |
52 } |
56 |
53 |
57 void startRelation(string_t name, std::vector<AttributeMetadata> attributes) override { |
54 void startRelation(string_t name, std::vector<AttributeMetadata> attributes) override { |
58 // TODO: move to a reusable method (or use same metadata on both reader and writer side?) |
55 // TODO: move to a reusable method (or use same metadata on both reader and writer side?) |
59 std::vector<writer::AttributeMetadata> writerMetadata; |
56 std::vector<writer::AttributeMetadata> writerMetadata; |