46 #define OGDF_CONTAINER_PRINTER(NAME) \
47 template<typename Container> \
49 const Container& container; \
50 explicit NAME(const Container& _container) : container(_container) { } \
51 template<typename ContainerT> \
52 friend std::ostream& operator<<(std::ostream& os, const NAME<ContainerT>& inst); \
60 const std::function<std::ostream&(std::ostream&)>& func);
62 template<
typename T1,
typename T2>
63 std::ostream&
operator<<(std::ostream& os,
const std::pair<T1, T2>& pair) {
64 return os <<
"(" << pair.first <<
", " << pair.second <<
")";
81 template<
typename Container>
82 std::ostream&
operator<<(std::ostream& os,
const printContainer<Container>& inst) {
84 for (
const auto& entry : inst.container) {
85 os << (first ?
"" :
", ") << entry;
91 template<
typename Container>
92 std::ostream&
operator<<(std::ostream& os,
const printIncidentEdges<Container>& inst) {
101 std::ostream&
operator<<(std::ostream& os,
const printIncidentEdges<PipeBij>& inst);
103 template<
typename Container>
104 std::ostream&
operator<<(std::ostream& os,
const printEdges<Container>& inst) {
113 std::ostream&
operator<<(std::ostream& os,
const printEdges<PipeBij>& inst);
115 template<
typename Container>
116 std::ostream&
operator<<(std::ostream& os,
const printBijection<Container>& inst) {
118 for (
const std::pair<ogdf::adjEntry, ogdf::adjEntry>& pair : inst.container) {
125 if (pair.first ==
nullptr) {
128 os <<
"n" << pair.first->twinNode()->index() << (pair.first->isSource() ?
"<" :
">")
129 <<
" e" << pair.first->theEdge()->index();
132 if (pair.second ==
nullptr) {
135 os <<
"e" << pair.second->theEdge()->index() <<
" "
136 << (pair.second->isSource() ?
">" :
"<") <<
"n" << pair.second->twinNode()->index();
143 template<
typename Container>
144 std::ostream&
operator<<(std::ostream& os,
const printFrozenBijection<Container>& inst) {
146 for (
const auto& pair : inst.container) {
147 os << (first ?
"" :
" ") <<
"(e" << pair.first <<
" = e" << pair.second <<
")";