/* * Graph6Writer.hpp * * Created on: Apr 2, 2021 * Author: heber */ #ifndef GRAPH_GRAPH6WRITER_HPP_ #define GRAPH_GRAPH6WRITER_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include #include "types.hpp" class atom; /** This functor prints a set of atoms as a graph6 formatted strings and returns * all elements as a vector in the same order as the nodes in the graph6 * representation. * * This is inspired by https://github.com/adrianN/graph6/, only I found the code * there quite ugly and unnecessarily complicated: inheriting from std::iterator, * overriding all the operators (++, *, ...) for no apparent reason instead of * adding normal functions, ... * */ struct Graph6Writer { const std::vector _atoms; Graph6Writer(const std::vector atoms); void write_n(std::ostream& out); void write_graph6(std::ostream& out); void write_elementlist(std::ostream& out); void write_simple_elementlist(std::ostream& out); private: atomId_t getBoundaryNonHydrogen() const; }; #endif /* GRAPH_GRAPH6WRITER_HPP_ */