Go to the documentation of this file.00001
00012 #ifndef LGL_GRAPH_PATH_HPP
00013 #define LGL_GRAPH_PATH_HPP
00014
00015 #include <list>
00016 #include <iostream>
00017
00018 namespace jafar {
00019 namespace lgl {
00020
00021 template <typename Vertex>
00022 class GraphPath;
00023
00024 template <typename Vertex>
00025 std::ostream& operator<<(std::ostream&, const GraphPath<Vertex>&);
00026
00028 template <typename Vertex>
00029 class GraphPath : public std::list< Vertex > {
00030 public:
00031 GraphPath() {}
00032 ~GraphPath() {}
00033
00034 template <typename V>
00035 friend std::ostream operator<< (std::ostream& out, const GraphPath<V>& path);
00036
00037 };
00038
00039 template <typename Vertex>
00040 std::ostream& operator<<(std::ostream& out, const GraphPath<Vertex>& path)
00041 {
00042 typedef typename GraphPath<Vertex>::const_iterator path_iterator;
00043 for(path_iterator lit=path.begin(); lit!=path.end(); ++lit) {
00044
00045 out << (*lit) << std::endl;
00046
00047 }
00048 return out;
00049 }
00050 }}
00051 #endif //LGL_GRAPH_PATH_HPP