|
Boost-Commit : |
From: asutton_at_[hidden]
Date: 2008-07-20 11:42:50
Author: asutton
Date: 2008-07-20 11:42:50 EDT (Sun, 20 Jul 2008)
New Revision: 47634
URL: http://svn.boost.org/trac/boost/changeset/47634
Log:
Renamed property map directory.
Added:
sandbox/SOC/2008/graphs/trunk/boost/graphs/properties/
- copied from r47212, /sandbox/SOC/2008/graphs/trunk/boost/graphs/property_map/
sandbox/SOC/2008/graphs/trunk/boost/graphs/properties/bundled_property_map.hpp
- copied unchanged from r47633, /sandbox/SOC/2008/graphs/trunk/boost/graphs/property_map/bundled_property_map.hpp
sandbox/SOC/2008/graphs/trunk/boost/graphs/properties/container_property_map.hpp
- copied unchanged from r47633, /sandbox/SOC/2008/graphs/trunk/boost/graphs/property_map/container_property_map.hpp
sandbox/SOC/2008/graphs/trunk/boost/graphs/properties/hashed_property_container.hpp
- copied unchanged from r47633, /sandbox/SOC/2008/graphs/trunk/boost/graphs/property_map/hashed_property_container.hpp
sandbox/SOC/2008/graphs/trunk/boost/graphs/properties/indexed_property_container.hpp
- copied unchanged from r47633, /sandbox/SOC/2008/graphs/trunk/boost/graphs/property_map/indexed_property_container.hpp
sandbox/SOC/2008/graphs/trunk/boost/graphs/properties/simple_property_map.hpp
- copied unchanged from r47633, /sandbox/SOC/2008/graphs/trunk/boost/graphs/property_map/simple_property_map.hpp
Removed:
sandbox/SOC/2008/graphs/trunk/boost/graphs/properties/bundled_properties.hpp
sandbox/SOC/2008/graphs/trunk/boost/graphs/properties/hashed_properties.hpp
sandbox/SOC/2008/graphs/trunk/boost/graphs/properties/indexed_properties.hpp
sandbox/SOC/2008/graphs/trunk/boost/graphs/properties/simple_properties.hpp
sandbox/SOC/2008/graphs/trunk/boost/graphs/property_map/
Text files modified:
sandbox/SOC/2008/graphs/trunk/boost/graphs/properties.hpp | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/properties.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/properties.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/properties.hpp 2008-07-20 11:42:50 EDT (Sun, 20 Jul 2008)
@@ -5,13 +5,13 @@
#include <boost/descriptors.hpp>
// Include associative adpaters for exterior properties.
-#include "property_map/hashed_property_container.hpp"
-#include "property_map/indexed_property_container.hpp"
+#include "properties/hashed_property_container.hpp"
+#include "properties/indexed_property_container.hpp"
// Include property map implementations.
-#include "property_map/container_property_map.hpp"
-#include "property_map/simple_property_map.hpp"
-#include "property_map/bundled_property_map.hpp"
+#include "properties/container_property_map.hpp"
+#include "properties/simple_property_map.hpp"
+#include "properties/bundled_property_map.hpp"
// TODO: We currently distinguish between exterior and interior using the names
// of the structures...
Deleted: /sandbox/SOC/2008/graphs/trunk/boost/graphs/property_map/bundled_properties.hpp
==============================================================================
--- /sandbox/SOC/2008/graphs/trunk/boost/graphs/property_map/bundled_properties.hpp 2008-07-20 11:42:50 EDT (Sun, 20 Jul 2008)
+++ (empty file)
@@ -1,69 +0,0 @@
-
-#ifndef BOOST_GRAPHS_PROPERTY_MAP_BUNDLED_PROPERTIES_HPP
-#define BOOST_GRAPHS_PROPERTY_MAP_BUNDLED_PROPERTIES_HPP
-
-namespace boost {
-namespace graphs {
-
-/**
- * A simple property map provides get/put functions for non-bundled or simple
- * vertex and edge properties. This is not called "simple" because it is
- * trivially implemented but because it return the properties assigned to the
- * vertex or edge (depending on the descriptor) without any indirection. To
- * build property maps over members or a structured (or bundled) property,
- * use the bundled property map.
- */
-template <typename Graph, typename Descriptor, typename Bundle, typename Property>
-struct bundled_property_map
-{
- typedef Descriptor key_type;
- typedef Property property_type;
-
- inline bundled_property_map(Graph& g, Property Bundle::* mem)
- : graph(g)
- , member(mem)
- { }
-
- inline bundled_property_map(bundled_property_map const& x)
- : graph(x.g)
- , member(x.mem)
- { }
-
- inline Bundle const& bundle(key_type const& k) const
- { return graph.properties(k); }
-
- inline Bundle& bundle(key_type const& k)
- { return graph.properties(k); }
-
-
- inline Property const& get(key_type const& k) const
- { return bundle(k).*member; }
-
- inline void put(key_type const& k, Property const& v)
- { bundle(k).*member = v; }
-
- Graph& graph;
- Property Bundle::* member;
-};
-
-template <typename G, typename D, typename B, typename P>
-typename bundled_property_map<G,D,B,P>::property_type const&
-get(bundled_property_map<G,D,B,P> const& pm,
- typename bundled_property_map<G,D,B,P>::key_type const& k)
-{
- return pm.get(k);
-}
-
-template <typename G, typename D, typename B, typename P>
-void
-put(bundled_property_map<G,D,B,P>& pm,
- typename bundled_property_map<G,D,B,P>::key_type const& k,
- typename bundled_property_map<G,D,B,P>::property_type const& v)
-{
- pm.put(k, v);
-}
-
-} /* namesapce graphs */
-} /* namespace boost */
-
-#endif
Deleted: /sandbox/SOC/2008/graphs/trunk/boost/graphs/property_map/hashed_properties.hpp
==============================================================================
--- /sandbox/SOC/2008/graphs/trunk/boost/graphs/property_map/hashed_properties.hpp 2008-07-20 11:42:50 EDT (Sun, 20 Jul 2008)
+++ (empty file)
@@ -1,126 +0,0 @@
-
-#ifndef HASHED_PROPERTIES_HPP
-#define HASHED_PROPERTIES_HPP
-
-#include <tr1/unordered_map>
-
-#include <boost/functional/hash.hpp>
-
-namespace detail {
-
-/**
- * Wrap an iterator with a default value so that it generates default values
- * over a range of keys.
- */
-template <typename Iter, typename Prop>
-struct key_value_iterator
-{
- typedef typename std::forward_iterator_tag iterator_category;
- typedef typename std::size_t difference_type;
-
- typedef std::pair<typename Iter::value_type, Prop> value_type;
- typedef value_type reference;
- typedef value_type pointer;
-
- key_value_iterator(Iter i)
- : iter(i)
- , value()
- { }
-
- key_value_iterator(Iter i, Prop const& p)
- : iter(i)
- , value(p)
- { }
-
- key_value_iterator& operator++()
- { ++iter; return *this; }
-
- reference operator*()
- { return make_pair(*iter, value); }
-
- bool operator==(key_value_iterator const& x) const
- { return iter == x.iter; }
-
- bool operator!=(key_value_iterator const& x) const
- { return iter != x.iter; }
-
- Iter iter;
- Prop value;
-};
-
-template <typename Iter, typename Prop>
-inline key_value_iterator<Iter, Prop>
-make_key_value_iterator(Iter i, Prop const& x)
-{ return key_value_iterator<Iter, Prop>(i, x); }
-
-} // namespace detail
-
-/**
- * A simple wrapper around an unordered map, this is used to map descriptors
- * to arbitrary property values. Note that the property type must be default
- * constructible.
- *
- * This may seem a little odd because we're passing an iterator and not the key
- * type. However, the key type is always the iterator's value type.
- */
-template <typename Descriptor, typename Property>
-class hashed_property_container
-{
-public:
- typedef Property value_type;
- typedef Descriptor key_type;
- typedef std::tr1::unordered_map<
- key_type, value_type, boost::hash<key_type>
- > container_type;
-
- /**
- * Construct the hashtable over n buckets. This may not actually allocate
- * n buckets, so we can't necessarily guarantee that memory will actually
- * be allocated for each element, much less what those default values would
- * actually be.
- */
- hashed_property_container(std::size_t n)
- : data(n)
- { }
-
- /**
- * Construct the hashtable over the keys in the iterator range [f, l) with
- * the default value x.
- */
- template <typename Iter>
- hashed_property_container(Iter f, Iter l, value_type const& x)
- : data(detail::make_key_value_iterator(f, x),
- detail::make_key_value_iterator(l, value_type()))
- { }
-
- // Get the property associated with the key k.
- inline value_type& operator[](key_type const& k)
- { return data[k]; }
-
- container_type data;
-};
-
-/**
- * The corresponding property map implements a lightweight, regular accessor
- * to a hashed property container.
- */
-template <typename Iterator, typename Property>
-class hashed_property_map
-{
- typedef hashed_property_container<Iterator, Property> container_type;
-public:
- typedef typename container_type::value_type property_type;
- typedef typename container_type::key_type key_type;
-
- hashed_property_map(container_type& cont)
- : data(cont)
- { }
-
- hashed_property_map(hashed_property_map const& x)
- : data(x.data)
- { }
-
- container_type& data;
-};
-
-#endif
Deleted: /sandbox/SOC/2008/graphs/trunk/boost/graphs/property_map/indexed_properties.hpp
==============================================================================
--- /sandbox/SOC/2008/graphs/trunk/boost/graphs/property_map/indexed_properties.hpp 2008-07-20 11:42:50 EDT (Sun, 20 Jul 2008)
+++ (empty file)
@@ -1,117 +0,0 @@
-
-#ifndef INDEXED_PROPERTIES_HPP
-#define INDEXED_PROPERTIES_HPP
-
-#include <iterator>
-#include <vector>
-
-namespace detail {
-
-/**
- * Wrap an iterator with a default value so that it generates default values
- * over a range of keys.
- */
-template <typename Iter, typename Prop>
-struct default_value_iterator
-{
- typedef typename std::forward_iterator_tag iterator_category;
- typedef std::size_t difference_type;
-
- typedef Prop value_type;
- typedef value_type const& reference;
- typedef value_type const* pointer;
-
- default_value_iterator(Iter i)
- : iter(i)
- , value()
- { }
-
- default_value_iterator(Iter i, Prop const& p)
- : iter(i)
- , value(p)
- { }
-
- default_value_iterator& operator++()
- { ++iter; return *this; }
-
- reference operator*()
- { return value; }
-
- bool operator==(default_value_iterator const& x) const
- { return iter == x.iter; }
-
- bool operator!=(default_value_iterator const& x) const
- { return iter != x.iter; }
-
- Iter iter;
- Prop value;
-};
-
-template <typename Iter, typename Prop>
-inline default_value_iterator<Iter, Prop>
-make_default_value_iterator(Iter i, Prop const&)
-{ return default_value_iterator<Iter, Prop>(i); }
-
-} // namespace detail
-
-
-/**
- * A simple wrapper around a vector. Because the "key" to this vector is
- * actually given as a descriptor, we have to get the underlying index that
- * allows us to map this value to a property.
- *
- * This definitely rquires that the descriptor values be continuous.
- */
-template <typename Descriptor, typename Property>
-struct indexed_property_container
-{
- typedef Property value_type;
- typedef Descriptor key_type;
- typedef std::vector<Property> container_type;
-
- inline indexed_property_container(std::size_t n)
- : data(n)
- { }
-
- /**
- * Construct the hashtable over the keys in the iterator range [f, l) with
- * the default value x.
- */
- template <typename Iter>
- inline indexed_property_container(Iter f, Iter l, value_type const& x)
- : data(detail::make_default_value_iterator(f, x),
- detail::make_default_value_iterator(l, value_type()))
- { }
-
- inline value_type& operator[](key_type const& k)
- { return data[k.get()]; }
-
- container_type data;
-};
-
-
-/**
- * The corresponding property map implements a lightweight, regular accessor
- * to a indexed property container.
- */
-template <typename Iterator, typename Property>
-struct indexed_property_map
-{
- typedef indexed_property_container<Iterator, Property> container_type;
-
- typedef typename container_type::value_type property_type;
- typedef typename container_type::key_type key_type;
-
- indexed_property_map(container_type& cont)
- : data(cont)
- { }
-
- indexed_property_map(indexed_property_map const& x)
- : data(x.data)
- { }
-
- container_type& data;
-};
-
-
-#endif
Deleted: /sandbox/SOC/2008/graphs/trunk/boost/graphs/property_map/simple_properties.hpp
==============================================================================
--- /sandbox/SOC/2008/graphs/trunk/boost/graphs/property_map/simple_properties.hpp 2008-07-20 11:42:50 EDT (Sun, 20 Jul 2008)
+++ (empty file)
@@ -1,53 +0,0 @@
-
-#ifndef BOOST_GRAPHS_PROPERTY_MAP_SIMPLE_PROPERTIES_HPP
-#define BOOST_GRAPHS_PROPERTY_MAP_SIMPLE_PROPERTIES_HPP
-
-namespace boost {
-namespace graphs {
-
-/**
- * A simple property map provides get/put functions for non-bundled or simple
- * vertex and edge properties. This is not called "simple" because it is
- * trivially implemented but because it return the properties assigned to the
- * vertex or edge (depending on the descriptor) without any indirection. To
- * build property maps over members or a structured (or bundled) property,
- * use the bundled property map.
- */
-template <typename Graph, typename Descriptor, typename Property>
-struct simple_property_map
-{
- typedef Descriptor key_type;
- typedef Property property_type;
-
- simple_property_map(Graph& g)
- : graph(g)
- { }
-
- simple_property_map(simple_property_map const& x)
- : graph(x.g)
- { }
-
- Graph& graph;
-};
-
-template <typename G, typename D, typename P>
-typename simple_property_map<G,D,P>::property_type const&
-get(simple_property_map<G,D,P> const& pm,
- typename simple_property_map<G,D,P>::key_type const& x)
-{
- return pm.graph.properties(x);
-}
-
-template <typename G, typename D, typename P>
-void
-put(simple_property_map<G,D,P>& pm,
- typename simple_property_map<G,D,P>::key_type const& x,
- typename simple_property_map<G,D,P>::property_type const& v)
-{
- pm.graph.properties(x) = v;
-}
-
-} /* namesapce graphs */
-} /* namespace boost */
-
-#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