lemon/bits/clearable_graph_extender.h
author alpar
Thu, 26 Jan 2006 06:44:22 +0000
changeset 1908 e225719bde6b
parent 1820 22099ef840d7
child 1909 2d806130e700
permissions -rw-r--r--
Better doc.
     1 // -*- c++ -*-
     2 
     3 #ifndef LEMON_CLEARABLE_GRAPH_EXTENDER_H
     4 #define LEMON_CLEARABLE_GRAPH_EXTENDER_H
     5 
     6 #include <lemon/invalid.h>
     7 
     8 
     9 namespace lemon {
    10 
    11   template <typename _Base> 
    12   class ClearableGraphExtender : public _Base {
    13   public:
    14 
    15     typedef ClearableGraphExtender Graph;
    16     typedef _Base Parent;
    17     typedef typename Parent::Node Node;
    18     typedef typename Parent::Edge Edge;
    19 
    20     void clear() {
    21       Parent::getNotifier(Node()).clear();
    22       Parent::getNotifier(Edge()).clear();
    23       Parent::clear();
    24     }
    25 
    26   };
    27 
    28   template <typename _Base> 
    29   class ClearableEdgeSetExtender : public _Base {
    30   public:
    31 
    32     typedef ClearableEdgeSetExtender Graph;
    33     typedef _Base Parent;
    34     typedef typename Parent::Node Node;
    35     typedef typename Parent::Edge Edge;
    36 
    37     void clear() {
    38       Parent::getNotifier(Edge()).clear();
    39       Parent::clear();
    40     }
    41 
    42   };
    43 
    44   template <typename _Base> 
    45   class ClearableUndirGraphExtender : public _Base {
    46   public:
    47 
    48     typedef ClearableUndirGraphExtender Graph;
    49     typedef _Base Parent;
    50     typedef typename Parent::Node Node;
    51     typedef typename Parent::UndirEdge UndirEdge;
    52     typedef typename Parent::Edge Edge;
    53 
    54     void clear() {
    55       Parent::getNotifier(Node()).clear();
    56       Parent::getNotifier(UndirEdge()).clear();
    57       Parent::getNotifier(Edge()).clear();
    58       Parent::clear();
    59     }
    60   };
    61 
    62   template <typename _Base> 
    63   class ClearableUndirEdgeSetExtender : public _Base {
    64   public:
    65 
    66     typedef ClearableUndirEdgeSetExtender Graph;
    67     typedef _Base Parent;
    68     typedef typename Parent::Node Node;
    69     typedef typename Parent::UndirEdge UndirEdge;
    70     typedef typename Parent::Edge Edge;
    71 
    72     void clear() {
    73       Parent::getNotifier(UndirEdge()).clear();
    74       Parent::getNotifier(Edge()).clear();
    75       Parent::clear();
    76     }
    77 
    78   };
    79 
    80 
    81   template <typename _Base>
    82   class ClearableUndirBipartiteGraphExtender : public _Base {
    83   public:
    84 
    85     typedef _Base Parent;
    86     typedef ClearableUndirBipartiteGraphExtender Graph;
    87 
    88     typedef typename Parent::Node Node;
    89     typedef typename Parent::LowerNode LowerNode;
    90     typedef typename Parent::UpperNode UpperNode;
    91     typedef typename Parent::Edge Edge;
    92     typedef typename Parent::UndirEdge UndirEdge;
    93 
    94     void clear() {
    95       Parent::getNotifier(Edge()).clear();
    96       Parent::getNotifier(UndirEdge()).clear();
    97       Parent::getNotifier(Node()).clear();
    98       Parent::getNotifier(LowerNode()).clear();
    99       Parent::getNotifier(UpperNode()).clear();
   100       Parent::clear();
   101     }
   102 
   103   };
   104 
   105 }
   106 
   107 #endif