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);
62template<
typename T1,
typename T2>
63std::ostream&
operator<<(std::ostream& os,
const std::pair<T1, T2>& pair) {
64 return os <<
"(" << pair.first <<
", " << pair.second <<
")";
81template<
typename Container>
82std::ostream&
operator<<(std::ostream& os,
const printContainer<Container>& inst) {
84 for (
const auto& entry : inst.container) {
85 os << (first ?
"" :
", ") << entry;
91template<
typename Container>
92std::ostream&
operator<<(std::ostream& os,
const printIncidentEdges<Container>& inst) {
94 os <<
"e" << adj->theEdge()->index() <<
" (" << (adj->isSource() ?
">" :
"<") <<
"n"
95 << adj->twinNode()->index() <<
"), ";
101std::ostream&
operator<<(std::ostream& os,
const printIncidentEdges<PipeBij>& inst);
103template<
typename Container>
104std::ostream&
operator<<(std::ostream& os,
const printEdges<Container>& inst) {
106 os <<
"e" << adj->theEdge()->index() <<
" (n" << adj->theNode()->index()
107 << (adj->isSource() ?
"->" :
"<-") <<
"n" << adj->twinNode()->index() <<
"), ";
113std::ostream&
operator<<(std::ostream& os,
const printEdges<PipeBij>& inst);
115template<
typename Container>
116std::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();
143template<
typename Container>
144std::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 <<
")";
Utilities for working with the bijections between the edges incident to the two endpoints of a Pipe.
Includes declaration of graph class.
#define OGDF_CONTAINER_PRINTER(NAME)
Basic declarations, included by all source files.
Class for adjacency list elements.
Representation of clustered graphs.
Data type for general directed graphs (adjacency list representation).
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
all operators will only be found when using sync_plan::internal, so no namespace pollution
std::ostream & operator<<(std::ostream &os, const std::function< std::ostream &(std::ostream &)> &func)
std::string to_string(const std::function< std::ostream &(std::ostream &)> &func)
The namespace for all OGDF objects.