components.h

00001 //==========================================================================
00002 //
00003 //   components.h
00004 //
00005 //==========================================================================
00006 // $Id: components.h,v 1.5 2003/04/03 11:44:42 raitner Exp $
00007 
00008 #ifndef GTL_COMPONENTS_H
00009 #define GTL_COMPONENTS_H
00010 
00011 #include <GTL/GTL.h>
00012 #include <GTL/dfs.h>
00013 
00014 #include <list>
00015 
00016 __GTL_BEGIN_NAMESPACE
00020 class GTL_EXTERN components : public dfs 
00021 {
00022 public:
00028     components ();
00029 
00035     virtual ~components () {}
00036 
00049     virtual int check (graph& G);
00050 
00051     virtual void reset ();
00052 
00056     typedef list<pair<list<node>, list<edge> > >::iterator component_iterator;
00057 
00070     component_iterator components_begin ()
00071         { return comp.begin(); }
00072 
00073 
00080     component_iterator components_end ()
00081         { return comp.end(); }
00082 
00088     int number_of_components () const
00089         {return num_of_components; }
00090 
00091     //-----------------------------------------------------------------------
00092     //   Handler used to extend dfs to biconnectivity
00093     //-----------------------------------------------------------------------
00097     virtual void before_recursive_call_handler (graph&, edge&, node&);
00098 
00102     virtual void old_adj_node_handler (graph&, edge&, node&);
00103 
00107     virtual void new_start_handler (graph&, node&);    
00108 
00109 
00110 protected:
00111 
00115     int num_of_components;
00119     list<pair<list<node>, list<edge> > > comp;
00123     component_iterator li;
00124 };
00125 
00126 __GTL_END_NAMESPACE
00127 
00128 #endif // GTL_BICONNECTIVITY_H
00129 
00130 //--------------------------------------------------------------------------
00131 //   end of file
00132 //--------------------------------------------------------------------------