lemon/bits/clearable_graph_extender.h
author alpar
Mon, 20 Feb 2006 06:32:15 +0000
changeset 1969 68c2c1176e9e
parent 1910 f95eea8c34b0
permissions -rw-r--r--
One more step towards Undir -> U conversion...
alpar@1956
     1
/* -*- C++ -*-
alpar@1956
     2
 *
alpar@1956
     3
 * This file is a part of LEMON, a generic C++ optimization library
alpar@1956
     4
 *
alpar@1956
     5
 * Copyright (C) 2003-2006
alpar@1956
     6
 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
alpar@1956
     7
 * (Egervary Research Group on Combinatorial Optimization, EGRES).
alpar@1956
     8
 *
alpar@1956
     9
 * Permission to use, modify and distribute this software is granted
alpar@1956
    10
 * provided that this copyright notice appears in all copies. For
alpar@1956
    11
 * precise terms see the accompanying LICENSE file.
alpar@1956
    12
 *
alpar@1956
    13
 * This software is provided "AS IS" with no warranty of any kind,
alpar@1956
    14
 * express or implied, and with no claim as to its suitability for any
alpar@1956
    15
 * purpose.
alpar@1956
    16
 *
alpar@1956
    17
 */
klao@946
    18
klao@946
    19
#ifndef LEMON_CLEARABLE_GRAPH_EXTENDER_H
klao@946
    20
#define LEMON_CLEARABLE_GRAPH_EXTENDER_H
klao@946
    21
klao@946
    22
#include <lemon/invalid.h>
klao@946
    23
klao@946
    24
klao@946
    25
namespace lemon {
klao@946
    26
klao@946
    27
  template <typename _Base> 
klao@946
    28
  class ClearableGraphExtender : public _Base {
klao@946
    29
  public:
klao@946
    30
klao@946
    31
    typedef ClearableGraphExtender Graph;
klao@946
    32
    typedef _Base Parent;
deba@980
    33
    typedef typename Parent::Node Node;
deba@980
    34
    typedef typename Parent::Edge Edge;
klao@946
    35
klao@946
    36
    void clear() {
deba@1039
    37
      Parent::getNotifier(Node()).clear();
deba@1039
    38
      Parent::getNotifier(Edge()).clear();
klao@946
    39
      Parent::clear();
klao@946
    40
    }
klao@946
    41
klao@946
    42
  };
klao@946
    43
klao@1022
    44
  template <typename _Base> 
deba@1842
    45
  class ClearableEdgeSetExtender : public _Base {
deba@1842
    46
  public:
deba@1842
    47
deba@1842
    48
    typedef ClearableEdgeSetExtender Graph;
deba@1842
    49
    typedef _Base Parent;
deba@1842
    50
    typedef typename Parent::Node Node;
deba@1842
    51
    typedef typename Parent::Edge Edge;
deba@1842
    52
deba@1842
    53
    void clear() {
deba@1842
    54
      Parent::getNotifier(Edge()).clear();
deba@1842
    55
      Parent::clear();
deba@1842
    56
    }
deba@1842
    57
deba@1842
    58
  };
deba@1842
    59
deba@1842
    60
  template <typename _Base> 
klao@1909
    61
  class ClearableUGraphExtender : public _Base {
klao@1022
    62
  public:
klao@1022
    63
klao@1909
    64
    typedef ClearableUGraphExtender Graph;
klao@1022
    65
    typedef _Base Parent;
klao@1022
    66
    typedef typename Parent::Node Node;
klao@1909
    67
    typedef typename Parent::UEdge UEdge;
klao@1022
    68
    typedef typename Parent::Edge Edge;
klao@1022
    69
klao@1022
    70
    void clear() {
deba@1039
    71
      Parent::getNotifier(Node()).clear();
klao@1909
    72
      Parent::getNotifier(UEdge()).clear();
deba@1039
    73
      Parent::getNotifier(Edge()).clear();
klao@1022
    74
      Parent::clear();
klao@1022
    75
    }
deba@1842
    76
  };
deba@1842
    77
deba@1842
    78
  template <typename _Base> 
klao@1909
    79
  class ClearableUEdgeSetExtender : public _Base {
deba@1842
    80
  public:
deba@1842
    81
klao@1909
    82
    typedef ClearableUEdgeSetExtender Graph;
deba@1842
    83
    typedef _Base Parent;
deba@1842
    84
    typedef typename Parent::Node Node;
klao@1909
    85
    typedef typename Parent::UEdge UEdge;
deba@1842
    86
    typedef typename Parent::Edge Edge;
deba@1842
    87
deba@1842
    88
    void clear() {
klao@1909
    89
      Parent::getNotifier(UEdge()).clear();
deba@1842
    90
      Parent::getNotifier(Edge()).clear();
deba@1842
    91
      Parent::clear();
deba@1842
    92
    }
klao@1022
    93
klao@1022
    94
  };
klao@1022
    95
deba@1820
    96
deba@1820
    97
  template <typename _Base>
deba@1910
    98
  class ClearableBpUGraphExtender : public _Base {
deba@1820
    99
  public:
deba@1820
   100
deba@1820
   101
    typedef _Base Parent;
deba@1910
   102
    typedef ClearableBpUGraphExtender Graph;
deba@1820
   103
deba@1820
   104
    typedef typename Parent::Node Node;
deba@1910
   105
    typedef typename Parent::BNode BNode;
deba@1910
   106
    typedef typename Parent::ANode ANode;
deba@1820
   107
    typedef typename Parent::Edge Edge;
klao@1909
   108
    typedef typename Parent::UEdge UEdge;
deba@1820
   109
deba@1820
   110
    void clear() {
deba@1820
   111
      Parent::getNotifier(Edge()).clear();
klao@1909
   112
      Parent::getNotifier(UEdge()).clear();
deba@1820
   113
      Parent::getNotifier(Node()).clear();
deba@1910
   114
      Parent::getNotifier(BNode()).clear();
deba@1910
   115
      Parent::getNotifier(ANode()).clear();
deba@1820
   116
      Parent::clear();
deba@1820
   117
    }
deba@1820
   118
deba@1820
   119
  };
deba@1820
   120
klao@946
   121
}
klao@946
   122
klao@946
   123
#endif