src/lemon/concept/undir_graph.h
author deba
Sat, 13 Nov 2004 21:37:54 +0000
changeset 989 ca95f8b5c931
parent 986 e997802b855c
child 1021 fd1d073b6557
permissions -rw-r--r--
XyzConcept moved to Xyz::Constraints
use checkConcept in the next way:

checkConcept<ErasableGraph, ListGraph>();
checkConcept<ReadWriteMap<Node, Node>, PredMap>;
     1 /* -*- C++ -*-
     2  *
     3  * src/lemon/concept/undir_graph_component.h - Part of LEMON, a generic
     4  * C++ optimization library
     5  *
     6  * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi
     7  * Kutatocsoport (Egervary Combinatorial Optimization Research Group,
     8  * EGRES).
     9  *
    10  * Permission to use, modify and distribute this software is granted
    11  * provided that this copyright notice appears in all copies. For
    12  * precise terms see the accompanying LICENSE file.
    13  *
    14  * This software is provided "AS IS" with no warranty of any kind,
    15  * express or implied, and with no claim as to its suitability for any
    16  * purpose.
    17  *
    18  */
    19 
    20 ///\ingroup concept
    21 ///\file
    22 ///\brief Undirected graphs and components of.
    23 
    24 
    25 #ifndef LEMON_CONCEPT_UNDIR_GRAPH_H
    26 #define LEMON_CONCEPT_UNDIR_GRAPH_H
    27 
    28 #include <lemon/concept/graph_component.h>
    29 
    30 namespace lemon {
    31   namespace concept {
    32 
    33     /// \todo to be done
    34     class BaseIterableUndirGraph;
    35 
    36     template <typename Graph>
    37     struct BaseIterableUndirGraphConcept {
    38       typedef typename Graph::UndirEdge UndirEdge;
    39       typedef typename Graph::Edge Edge;
    40       typedef typename Graph::Node Node;
    41 
    42       void constraints() {
    43 	checkConcept<BaseIterableGraphComponent, Graph>();
    44 	checkConcept<GraphItem<'u'>, UndirEdge >();
    45 
    46 	/// \bug this should be base_and_derived:
    47 	UndirEdge ue = e;
    48 	ue = e;
    49 
    50 	Node n;
    51 	n = graph.target(ue);
    52 	n = graph.source(ue);
    53 
    54 	graph.first(ue);
    55 	graph.next(ue);
    56       }
    57       const Graph &graph;
    58       Edge e;
    59     };
    60 
    61     template <typename Graph>
    62     struct IterableUndirGraphConcept {
    63       void constraints() {
    64 	/// \todo we don't need the iterable component should base iterable	
    65 	//	checkConcept< BaseIterableUndirGraph, Graph > ();
    66 	checkConcept< IterableGraphComponent, Graph > ();
    67 
    68 	typedef typename Graph::UndirEdge UndirEdge;
    69 	typedef typename Graph::UndirEdgeIt UndirEdgeIt;
    70 
    71 	checkConcept< GraphIterator<Graph, UndirEdge>, UndirEdgeIt >();
    72       }
    73     };
    74 
    75   }
    76 
    77 }
    78 
    79 #endif