00001 /* -*- C++ -*- 00002 * 00003 * This file is a part of LEMON, a generic C++ optimization library 00004 * 00005 * Copyright (C) 2003-2006 00006 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 00007 * (Egervary Research Group on Combinatorial Optimization, EGRES). 00008 * 00009 * Permission to use, modify and distribute this software is granted 00010 * provided that this copyright notice appears in all copies. For 00011 * precise terms see the accompanying LICENSE file. 00012 * 00013 * This software is provided "AS IS" with no warranty of any kind, 00014 * express or implied, and with no claim as to its suitability for any 00015 * purpose. 00016 * 00017 */ 00018 00024 00025 #ifndef LEMON_CONCEPT_PATH_H 00026 #define LEMON_CONCEPT_PATH_H 00027 00028 #include <lemon/invalid.h> 00029 #include <lemon/concept_check.h> 00030 00031 namespace lemon { 00032 namespace concept { 00035 00036 00045 template<typename GR> 00046 class Path { 00047 public: 00048 00050 typedef /*typename*/ GR Graph; 00052 typedef typename Graph::Edge GraphEdge; 00054 typedef typename Graph::Node GraphNode; 00055 class NodeIt; 00056 class EdgeIt; 00057 00060 Path(const Graph &_g) { 00061 ignore_unused_variable_warning(_g); 00062 } 00063 00065 int length() const {return 0;} 00067 bool empty() const { return true;} 00068 00070 void clear() {} 00071 00076 GraphNode/*It*/ target() const {return INVALID;} 00081 GraphNode/*It*/ source() const {return INVALID;} 00082 00087 template<typename It> 00088 It& first(It &i) const { return i=It(*this); } 00089 00094 NodeIt target(const EdgeIt&) const {return INVALID;} 00095 00100 NodeIt source(const EdgeIt&) const {return INVALID;} 00101 00102 00103 /* Iterator classes */ 00104 00113 class EdgeIt { 00114 public: 00116 EdgeIt() {} 00118 EdgeIt(Invalid) {} 00120 EdgeIt(const Path &) {} 00121 00122 operator GraphEdge () const {} 00123 00125 EdgeIt& operator++() {return *this;} 00126 00128 bool operator==(const EdgeIt&) const {return true;} 00130 bool operator!=(const EdgeIt&) const {return true;} 00131 // /// Comparison operator 00132 // /// \todo It is not clear what is the "natural" ordering. 00133 // bool operator<(const EdgeIt& e) const {} 00134 00135 }; 00136 00145 class NodeIt { 00146 public: 00148 NodeIt() {} 00150 NodeIt(Invalid) {} 00152 NodeIt(const Path &) {} 00153 00155 operator const GraphNode& () const {} 00157 NodeIt& operator++() {return *this;} 00158 00160 bool operator==(const NodeIt&) const {return true;} 00162 bool operator!=(const NodeIt&) const {return true;} 00163 // /// Comparison operator 00164 // /// \todo It is not clear what is the "natural" ordering. 00165 // bool operator<(const NodeIt& e) const {} 00166 00167 }; 00168 00169 friend class Builder; 00170 00184 class Builder { 00185 public: 00186 00187 Path &P; 00188 00191 00192 Builder(Path &_p) : P(_p) {} 00193 00195 00202 void setStartNode(const GraphNode &) {} 00203 00205 00209 void pushFront(const GraphEdge&) {} 00210 00212 00216 void pushBack(const GraphEdge&) {} 00217 00219 void commit() {} 00220 00222 00226 void reserveFront(size_t) {} 00228 00232 void reserveBack(size_t) {} 00233 }; 00234 }; 00235 00237 } 00238 00239 } // namespace lemon 00240 00241 #endif // LEMON_CONCEPT_PATH_H