Open Babel: verbose_visitors.h Source File

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

# verbose_visitors.h

Go to the documentation of this file.

    00001 /**********************************************************************
    00002 verbose_visitors.h - visitor classes dumping a short text message for every visitor function.
    00003
    00004 Copyright (C) 2007 by Gerde Menche
    00005
    00006 This file is part of the Open Babel project.
    00007 For more information, see <http://openbabel.org/>
    00008
    00009 This program is free software; you can redistribute it and/or modify
    00010 it under the terms of the GNU General Public License as published by
    00011 the Free Software Foundation version 2 of the License.
    00012
    00013 This program is distributed in the hope that it will be useful,
    00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
    00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00016 GNU General Public License for more details.
    00017 ***********************************************************************/
    00018
    00019 #ifndef VERBOSE_VISITORS
    00020 #define VERBOSE_VISITORS
    00021
    00022 #include<ostream>
    00023
    00024 namespace OpenBabel {
    00025
    00026 class OBVerboseDFSVisitor {
    00027
    00028     std::ostream& os;
    00029
    00030     public:
    00031
    00032     OBVerboseDFSVisitor( std::ostream& o ) : os(o) {}
    00033
    00034     template <class Vertex, class Graph>
    00035     void initialize_vertex(Vertex u, const Graph& g)
    00036     {
    00037         os << "initialize_vertex() called on:     " << u->GetIdx() << "\n";
    00038     }
    00039
    00040     template <class Vertex, class Graph>
    00041     void start_vertex(Vertex u, const Graph& g)
    00042     {
    00043         os << "start_vertex() called on:          " << u->GetIdx() << "\n";
    00044     }
    00045     template <class Vertex, class Graph>
    00046     void discover_vertex(Vertex u, const Graph& g)
    00047     {
    00048         os << "discover_vertex() called on:       " << u->GetIdx() << "\n";
    00049     }
    00050     template <class Edge, class Graph>
    00051     void examine_edge(Edge u, const Graph& g)
    00052     {
    00053         os << "examine_edge() called on:          " << u->GetIdx() << "\n";
    00054     }
    00055     template <class Edge, class Graph>
    00056     void tree_edge(Edge u, const Graph& g)
    00057     {
    00058         os << "tree_edge() called on:             " << u->GetIdx() << "\n";
    00059     }
    00060     template <class Edge, class Graph>
    00061     void back_edge(Edge u, const Graph& g)
    00062     {
    00063         os << "back_edge() called on:             " << u->GetIdx() << "\n";
    00064     }
    00065     template <class Edge, class Graph>
    00066     void forward_or_cross_edge(Edge u, const Graph& g)
    00067     {
    00068         os << "forward_or_cross_edge() called on: " << u->GetIdx() << "\n";
    00069     }
    00070     template <class Vertex, class Graph>
    00071     void finish_vertex(Vertex u, const Graph& g)
    00072     {
    00073         os << "finish_vertex() called on:         " << u->GetIdx() << "\n";
    00074     }
    00075 };
    00076
    00077 class OBVerboseBFSVisitor
    00078 {
    00079     std::ostream& os;
    00080
    00081   public :
    00082
    00083     OBVerboseBFSVisitor( std::ostream& o ) : os(o) {}
    00084
    00085     template< typename vertex, typename graph >
    00086     void initialize_vertex( vertex e, const graph& g)
    00087     {
    00088         os << "initialize_vertex() called on: " << e->GetIdx() << "\n" ;
    00089     }
    00090     template< typename vertex, typename graph >
    00091     void discover_vertex( vertex e, const graph& g)
    00092     {
    00093         os << "discover_vertex() called on:   " << e->GetIdx() << "\n" ;
    00094     }
    00095     template< typename vertex, typename graph >
    00096     void examine_vertex( vertex e, const graph& g)
    00097     {
    00098         os << "examine_vertex() called on:    " << e->GetIdx() << "\n" ;
    00099     }
    00100     template< typename edge, typename graph >
    00101     void examine_edge( edge e, const graph& g)
    00102     {
    00103         os << "examine_edge() called on:      " << e->GetIdx() << "\n" ;
    00104     }
    00105     template< typename edge, typename graph >
    00106     void tree_edge( edge e, const graph& g)
    00107     {
    00108         os << "tree_edge() called on:         " << e->GetIdx() << "\n" ;
    00109     }
    00110     template< typename edge, typename graph >
    00111     void non_tree_edge( edge e, const graph& g)
    00112     {
    00113         os << "non_tree_edge() called on:     " << e->GetIdx() << "\n" ;
    00114     }
    00115     template< typename edge, typename graph >
    00116     void cycle_edge( edge e, const graph& g)
    00117     {
    00118         os << "cycle_edge() called on:        " << e->GetIdx() << "\n" ;
    00119     }
    00120     template< typename edge, typename graph >
    00121     void gray_target( edge e, const graph& g)
    00122     {
    00123         os << "gray_target() called on:       " << e->GetIdx() << "\n" ;
    00124     }
    00125     template< typename edge, typename graph >
    00126     void black_target( edge e, const graph& g)
    00127     {
    00128         os << "black_target() called on:      " << e->GetIdx() << "\n" ;
    00129     }
    00130     template< typename vertex, typename graph >
    00131     void finish_vertex( vertex e, const graph& g)
    00132     {
    00133         os << "finish_vertex() called on:     " << e->GetIdx() << "\n" ;
    00134     }
    00135 };
    00136
    00137 } // end namespace
    00138
    00139 #endif // VERBOSE_VISITORS

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

This file is part of the documentation for Open Babel, version 2.3.

Documentation copyright © 1998-2007, the Open Babel Developers.
Open Babel is hosted by:
Generated on Fri Oct 22 2010 14:36:02 by 1.7.2.