// -*- c++ -*- #ifndef LEMON_IDMAPPABLE_GRAPH_EXTENDER_H #define LEMON_IDMAPPABLE_GRAPH_EXTENDER_H namespace lemon { template class IdMappableGraphExtender : public Base { public: typedef IdMappableGraphExtender Graph; typedef Base Parent; typedef typename Parent::Node Node; typedef typename Parent::Edge Edge; public: class NodeIdMap { private: const Graph* graph; public: NodeIdMap(const Graph& g) : graph(&g) {} int operator[](const Node& node) const { return graph->id(node); } int maxId() const {return graph->maxNodeId(); } }; class EdgeIdMap { private: const Graph* graph; public: EdgeIdMap(const Graph& g) : graph(&g) {} int operator[](const Edge& edge) const { return graph->id(edge); } int maxId() const {return graph->maxEdgeId(); } }; }; } #endif