// -*- c++ -*-

#ifndef LEMON_CLEARABLE_GRAPH_EXTENDER_H
#define LEMON_CLEARABLE_GRAPH_EXTENDER_H

#include <lemon/invalid.h>


namespace lemon {

  template <typename _Base> 
  class ClearableGraphExtender : public _Base {
  public:

    typedef ClearableGraphExtender Graph;
    typedef _Base Parent;
    typedef typename Parent::Node Node;
    typedef typename Parent::Edge Edge;

    void clear() {
      Parent::getNotifier(Node()).clear();
      Parent::getNotifier(Edge()).clear();
      Parent::clear();
    }

  };

  template <typename _Base> 
  class ClearableUndirGraphExtender : public _Base {
  public:

    typedef ClearableUndirGraphExtender Graph;
    typedef _Base Parent;
    typedef typename Parent::Node Node;
    typedef typename Parent::UndirEdge UndirEdge;
    typedef typename Parent::Edge Edge;

    void clear() {
      Parent::getNotifier(Node()).clear();
      Parent::getNotifier(UndirEdge()).clear();
      Parent::getNotifier(Edge()).clear();
      Parent::clear();
    }

  };

}

#endif
