Graph.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2007 by Universidad Nacional de Colombia                *
00003  *   http://www.unal.edu.co                                                *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #ifndef GRAPH_H
00021 #define GRAPH_H
00022 
00023 #include <map>
00024 using namespace std ;
00025 
00026 #include <GTL/graph.h>
00027 
00028 #define Node node
00029 #define Edge edge
00030 
00038 template < class NODE_TYPE = int, class EDGE_TYPE = int, class GRAPH_TYPE = int >
00039 class Graph : public graph
00040 {
00041         public:
00042                 Graph();
00043                 Graph( const Graph& g );
00044                 Graph( const Graph& g, const list<Node>& listNode );
00045                 void operator = ( const Graph& g );
00046                 void copy( const Graph& g ) ;
00047                 ~Graph();
00048                 
00049                 void assign( const GRAPH_TYPE& x ) ;
00050                 const GRAPH_TYPE& inf() ;
00051                 
00052                 virtual Node newNode( const NODE_TYPE& x ) ;
00053                 void assign( Node n, const NODE_TYPE& x ) ;
00054                 NODE_TYPE& inf( Node n ) ;
00055                 NODE_TYPE inf( Node n ) const ;
00056                 virtual void removeNode( Node n ) ;
00057                 
00058                 virtual Edge newEdge( Node source, Node target, const EDGE_TYPE& x = 0 ) ;
00059                 void assign( Edge n, const EDGE_TYPE& x ) ;
00060                 EDGE_TYPE& inf( Edge n ) ;
00061                 EDGE_TYPE inf( Edge n ) const;
00062                 virtual void removeEdge( Edge e ) ;
00063                 
00064                 map< Node, NODE_TYPE > getNodeMap() const ;
00065                 map< Edge, EDGE_TYPE > getEdgeMap() const ;
00066                 
00067         protected:
00068                 map< Node, NODE_TYPE > nodeMap ;
00069                 map< Edge, EDGE_TYPE > edgeMap ;
00070                 
00071         private:
00072                 GRAPH_TYPE x ;
00073 };
00074 
00075 #include <Graph.cpp>
00076 
00077 #endif

Generated on Mon May 26 20:29:46 2008 for TARIS by  doxygen 1.5.4