00001 /* -*- C++ -*- 00002 * src/lemon/concept/path.h - Part of LEMON, a generic C++ optimization library 00003 * 00004 * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 00005 * (Egervary Combinatorial Optimization Research Group, EGRES). 00006 * 00007 * Permission to use, modify and distribute this software is granted 00008 * provided that this copyright notice appears in all copies. For 00009 * precise terms see the accompanying LICENSE file. 00010 * 00011 * This software is provided "AS IS" with no warranty of any kind, 00012 * express or implied, and with no claim as to its suitability for any 00013 * purpose. 00014 * 00015 */ 00016 00022 00023 #ifndef LEMON_CONCEPT_PATH_H 00024 #define LEMON_CONCEPT_PATH_H 00025 00026 #include <lemon/invalid.h> 00027 00028 namespace lemon { 00029 namespace concept { 00032 00033 00042 template<typename GR> 00043 class Path { 00044 public: 00045 00047 typedef /*typename*/ GR Graph; 00049 typedef typename Graph::Edge GraphEdge; 00051 typedef typename Graph::Node GraphNode; 00052 class NodeIt; 00053 class EdgeIt; 00054 00057 Path(const Graph &_G) {} 00058 00060 size_t length() const {return 0;} 00062 bool empty() const { return true;} 00063 00065 void clear() {} 00066 00071 GraphNode/*It*/ target() const {return INVALID;} 00076 GraphNode/*It*/ source() const {return INVALID;} 00077 00082 template<typename It> 00083 It& first(It &i) const { return i=It(*this); } 00084 00089 NodeIt target(const EdgeIt& e) const {return INVALID;} 00090 00095 NodeIt source(const EdgeIt& e) const {return INVALID;} 00096 00097 00098 /* Iterator classes */ 00099 00108 class EdgeIt { 00109 public: 00111 EdgeIt() {} 00113 EdgeIt(Invalid) {} 00115 EdgeIt(const Path &_p) {} 00116 00117 operator GraphEdge () const {} 00118 00120 EdgeIt& operator++() {return *this;} 00121 00123 bool operator==(const EdgeIt& e) const {return true;} 00125 bool operator!=(const EdgeIt& e) const {return true;} 00126 // /// Comparison operator 00127 // /// \todo It is not clear what is the "natural" ordering. 00128 // bool operator<(const EdgeIt& e) const {} 00129 00130 }; 00131 00140 class NodeIt { 00141 public: 00143 NodeIt() {} 00145 NodeIt(Invalid) {} 00147 NodeIt(const Path &_p) {} 00148 00150 operator const GraphNode& () const {} 00152 NodeIt& operator++() {return *this;} 00153 00155 bool operator==(const NodeIt& e) const {return true;} 00157 bool operator!=(const NodeIt& e) const {return true;} 00158 // /// Comparison operator 00159 // /// \todo It is not clear what is the "natural" ordering. 00160 // bool operator<(const NodeIt& e) const {} 00161 00162 }; 00163 00164 friend class Builder; 00165 00179 class Builder { 00180 public: 00181 00182 Path &P; 00183 00186 Builder(Path &_P) : P(_P) {} 00187 00189 00196 void setStartNode(const GraphNode &) {} 00197 00199 00203 void pushFront(const GraphEdge& e) {} 00204 00206 00210 void pushBack(const GraphEdge& e) {} 00211 00213 void commit() {} 00214 00216 00220 void reserveFront(size_t r) {} 00222 00226 void reserveBack(size_t r) {} 00227 }; 00228 }; 00229 00231 } 00232 00233 } // namespace lemon 00234 00235 #endif // LEMON_CONCEPT_PATH_H