Add default index functor (an identity functor). You could use a
[oota-llvm.git] / include / llvm / ADT / GraphTraits.h
index 00973d59fab23cf68d64009e3c2ea05a3427591b..4ff74176a7a5877679170c334d529c24f09cb264 100644 (file)
@@ -1,4 +1,11 @@
-//===-- Support/GraphTraits.h - Graph traits template ------------*- C++ -*--=//
+//===-- Support/GraphTraits.h - Graph traits template -----------*- C++ -*-===//
+// 
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// 
+//===----------------------------------------------------------------------===//
 //
 // This file defines the little GraphTraits<X> template class that should be 
 // specialized by classes that want to be iteratable by generic graph iterators.
@@ -8,8 +15,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_SUPPORT_GRAPH_TRAITS_H
-#define LLVM_SUPPORT_GRAPH_TRAITS_H
+#ifndef SUPPORT_GRAPHTRAITS_H
+#define SUPPORT_GRAPHTRAITS_H
+
+namespace llvm {
 
 // GraphTraits - This class should be specialized by different graph types...
 // which is why the default version is empty.
@@ -31,6 +40,13 @@ struct GraphTraits {
   //  
 
 
+  // typedef  ...iterator nodes_iterator;
+  // static nodes_iterator nodes_begin(GraphType *G)
+  // static nodes_iterator nodes_end  (GraphType *G)
+  //
+  //    nodes_iterator/begin/end - Allow iteration over all nodes in the graph
+
+
   // If anyone tries to use this class without having an appropriate
   // specialization, make an error.  If you get this error, it's because you
   // need to include the appropriate specialization of GraphTraits<> for your
@@ -62,4 +78,6 @@ struct Inverse {
   inline Inverse(GraphType &G) : Graph(G) {}
 };
 
+} // End llvm namespace
+
 #endif