lemon/bits/clearable_graph_extender.h
author deba
Fri, 27 Jan 2006 08:19:42 +0000
changeset 1914 7ef30a71937f
parent 1909 2d806130e700
child 1956 a055123339d5
permissions -rw-r--r--
Doc bug fix
     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 ClearableUGraphExtender : public _Base {
    46   public:
    47 
    48     typedef ClearableUGraphExtender Graph;
    49     typedef _Base Parent;
    50     typedef typename Parent::Node Node;
    51     typedef typename Parent::UEdge UEdge;
    52     typedef typename Parent::Edge Edge;
    53 
    54     void clear() {
    55       Parent::getNotifier(Node()).clear();
    56       Parent::getNotifier(UEdge()).clear();
    57       Parent::getNotifier(Edge()).clear();
    58       Parent::clear();
    59     }
    60   };
    61 
    62   template <typename _Base> 
    63   class ClearableUEdgeSetExtender : public _Base {
    64   public:
    65 
    66     typedef ClearableUEdgeSetExtender Graph;
    67     typedef _Base Parent;
    68     typedef typename Parent::Node Node;
    69     typedef typename Parent::UEdge UEdge;
    70     typedef typename Parent::Edge Edge;
    71 
    72     void clear() {
    73       Parent::getNotifier(UEdge()).clear();
    74       Parent::getNotifier(Edge()).clear();
    75       Parent::clear();
    76     }
    77 
    78   };
    79 
    80 
    81   template <typename _Base>
    82   class ClearableBpUGraphExtender : public _Base {
    83   public:
    84 
    85     typedef _Base Parent;
    86     typedef ClearableBpUGraphExtender Graph;
    87 
    88     typedef typename Parent::Node Node;
    89     typedef typename Parent::BNode BNode;
    90     typedef typename Parent::ANode ANode;
    91     typedef typename Parent::Edge Edge;
    92     typedef typename Parent::UEdge UEdge;
    93 
    94     void clear() {
    95       Parent::getNotifier(Edge()).clear();
    96       Parent::getNotifier(UEdge()).clear();
    97       Parent::getNotifier(Node()).clear();
    98       Parent::getNotifier(BNode()).clear();
    99       Parent::getNotifier(ANode()).clear();
   100       Parent::clear();
   101     }
   102 
   103   };
   104 
   105 }
   106 
   107 #endif