Boost logo

Boost-Commit :

From: asutton_at_[hidden]
Date: 2008-05-30 17:10:26


Author: asutton
Date: 2008-05-30 17:10:25 EDT (Fri, 30 May 2008)
New Revision: 45965
URL: http://svn.boost.org/trac/boost/changeset/45965

Log:
Added the preliminary implementation of directed graphs as a copy
of undirected graphs.

Added:
   sandbox/SOC/2008/graphs/boost/graphs/adjacency_list/directed/
      - copied from r45963, /sandbox/SOC/2008/graphs/boost/graphs/adjacency_list/undirected/
Text files modified:
   sandbox/SOC/2008/graphs/boost/graphs/adjacency_list/directed/undirected.hpp | 35 ++++++++++++-----------------------
   1 files changed, 12 insertions(+), 23 deletions(-)

Modified: sandbox/SOC/2008/graphs/boost/graphs/adjacency_list/directed/undirected.hpp
==============================================================================
--- /sandbox/SOC/2008/graphs/boost/graphs/adjacency_list/undirected/undirected.hpp (original)
+++ sandbox/SOC/2008/graphs/boost/graphs/adjacency_list/directed/undirected.hpp 2008-05-30 17:10:25 EDT (Fri, 30 May 2008)
@@ -4,7 +4,7 @@
 
 #include <list>
 
-#include <boost/graphs/utility/unordered_pair.hpp>
+#include <boost/graphs/utility/ordered.hpp>
 #include <boost/graphs/adjacency_list/vertex.hpp>
 #include <boost/graphs/adjacency_list/edge.hpp>
 #include <boost/graphs/adjacency_list/storage_traits.hpp>
@@ -13,29 +13,18 @@
 namespace graphs {
 namespace adj_list {
 
-// Implementation of undirected adjacency lists.
+// Implementation of directed adjacency lists.
 
 // Forward declarations
-template <typename VP, typename EP, typename V, typename E, template <typename> class VES> struct undirected_vertex;
-template <typename VP, typename EP, typename V, typename E> struct undirected_edge;
+template <typename VP, typename EP, typename V, typename E, template <typename> class VES> struct directed_vertex;
+template <typename VP, typename EP, typename V, typename E> struct directed_edge;
 
 // Unfortunately, I have to hack out a little tag dispatch here... This will
 // go away with the concepts.
-struct undirected_tag { };
+struct directed_tag { };
 
 /**
- * The undirected template is essentially responsible for generating the types
- * of verties and edges. Note that the definition of these types also depends,
- * to some degree, on the underlying storage mechanisms. Specifically, these
- * stores contribute information about the specific types of descriptors
- * employed by the adjacency list type.
- *
- * @todo Unfortunately, we are actually instantiating these types over dummy
- * stores in order to access their storage traits - basically deciding whether
- * the descriptor will be an integer or a void ptr. There doesn't really seem
- * to be any other way to do this since we're actually passing the stores as
- * template template parameters - which have no type. Perhaps the new language
- * will offer better solutions.
+ * This is the metafunction for directed types.
  */
 template <
         typename VertexProps,
@@ -44,9 +33,9 @@
         typename EdgeStore,
         template <typename> class VertexEdgeStore
>
-struct undirected
+struct directed
 {
- typedef undirected_tag tag;
+ typedef directed_tag tag;
 
     typedef vertex_desc<
             typename storage_traits<VertexStore>::descriptor_type
@@ -56,11 +45,11 @@
             typename storage_traits<EdgeStore>::descriptor_type
> edge_descriptor;
 
- typedef undirected_vertex<
+ typedef directed_vertex<
             VertexProps, EdgeProps, vertex_descriptor, edge_descriptor, VertexEdgeStore
> vertex_type;
 
- typedef undirected_edge<
+ typedef directed_edge<
             VertexProps, EdgeProps, vertex_descriptor, edge_descriptor
> edge_type;
 };
@@ -69,7 +58,7 @@
 } /* namespace graphs */
 } /* namespace boost */
 
-#include <boost/graphs/adjacency_list/undirected/vertex.hpp>
-#include <boost/graphs/adjacency_list/undirected/edge.hpp>
+#include <boost/graphs/adjacency_list/directed/vertex.hpp>
+#include <boost/graphs/adjacency_list/directed/edge.hpp>
 
 #endif


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk