Boost logo

Boost-Commit :

From: asutton_at_[hidden]
Date: 2007-09-06 10:12:04


Author: asutton
Date: 2007-09-06 10:12:02 EDT (Thu, 06 Sep 2007)
New Revision: 39141
URL: http://svn.boost.org/trac/boost/changeset/39141

Log:
Moving examples to example directory

Added:
   sandbox/graph-v2/libs/property_map/example/
   sandbox/graph-v2/libs/property_map/example/example1.cpp
      - copied unchanged from r39114, /sandbox/graph-v2/libs/property_map/example1.cpp
   sandbox/graph-v2/libs/property_map/example/example2.cpp
      - copied unchanged from r39114, /sandbox/graph-v2/libs/property_map/example2.cpp
   sandbox/graph-v2/libs/property_map/example/example3.cpp
      - copied unchanged from r39114, /sandbox/graph-v2/libs/property_map/example3.cpp
Removed:
   sandbox/graph-v2/libs/property_map/example1.cpp
   sandbox/graph-v2/libs/property_map/example2.cpp
   sandbox/graph-v2/libs/property_map/example3.cpp
Text files modified:
   sandbox/graph-v2/libs/property_map/ChangeLog | 22 ++++++++++++++++++++--
   1 files changed, 20 insertions(+), 2 deletions(-)

Modified: sandbox/graph-v2/libs/property_map/ChangeLog
==============================================================================
--- sandbox/graph-v2/libs/property_map/ChangeLog (original)
+++ sandbox/graph-v2/libs/property_map/ChangeLog 2007-09-06 10:12:02 EDT (Thu, 06 Sep 2007)
@@ -4,8 +4,10 @@
     the fact that this library is almost always wrapped for specific
     applications like Boost.Graph.
 
+* All code now goes into the property_map namespace.
+
 * Rewrote the concept classes to use BOOST_concept code.
- This brings it up to date with the Sgi and Boost.Graph concepts.
+ This brings it up to date with the SGI and Boost.Graph concepts.
 
 * Renamed make_assoc_property_map() to make_associative_property_map().
     I'm a big fan of long identifiers.
@@ -15,7 +17,10 @@
     this is actually used anywhere so it shouldn't affect too much code.
 
 * Ported constant_property_map from SoC code.
- Also upgraded this to use put_get_helper.
+ It's basically the same as reference_property_map but doesn't allow put()s,
+ and it can be constructed from an rvalue expression.
+
+ Added a no-op put() to make it work with dynamic_properties.
 
 * Templated the identity_property_map.
     There's no real reason why this shouldn't be templated (except perhaps
@@ -27,7 +32,20 @@
     like the uses of this class (in all of Boost), are read-only. It might be
     worth removing lvalue access and non-const get()s.
 
+ Actually a no-op put() back in place. This makes it work with the
+ dynamic_properties class.
+
 * Rewrote the dummy_property_map.
     This looks a lot nicer if the key and value type are explicitly given.
     The general behavior is a) to return an arbitrary value and b) ignore any
     writes.
+
+* Moved dynamic_property_map.hpp into the property_map library.
+ Made a couple of small changes - mostly cosmetic. Removed backwards
+ compatible support for GCC 2.95 (had to do with proper scoping).
+
+ The dynamic property map is kind of a strange thing, because it requires
+ that any maps it contains have to be models of both Readable and Writable
+ property maps - if it's read only, we can't instantiate the adaptor class.
+ As such, many of the property maps that wouldn't normally support put or
+ get functions, actually have them - even if they don't do anything.
\ No newline at end of file

Deleted: sandbox/graph-v2/libs/property_map/example1.cpp
==============================================================================
--- sandbox/graph-v2/libs/property_map/example1.cpp 2007-09-06 10:12:02 EDT (Thu, 06 Sep 2007)
+++ (empty file)
@@ -1,48 +0,0 @@
-// (C) Copyright Jeremy Siek 2002.
-// Distributed under the Boost Software License, Version 1.0. (See
-// accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <iostream>
-#include <map>
-#include <string>
-#include <boost/property_map.hpp>
-
-
-template <typename AddressMap>
-void foo(AddressMap address)
-{
- typedef typename boost::property_traits<AddressMap>::value_type value_type;
- typedef typename boost::property_traits<AddressMap>::key_type key_type;
-
- value_type old_address, new_address;
- key_type fred = "Fred";
- old_address = get(address, fred);
- new_address = "384 Fitzpatrick Street";
- put(address, fred, new_address);
-
- key_type joe = "Joe";
- value_type& joes_address = address[joe];
- joes_address = "325 Cushing Avenue";
-}
-
-int
-main()
-{
- std::map<std::string, std::string> name2address;
- boost::associative_property_map< std::map<std::string, std::string> >
- address_map(name2address);
-
- name2address.insert(make_pair(std::string("Fred"),
- std::string("710 West 13th Street")));
- name2address.insert(make_pair(std::string("Joe"),
- std::string("710 West 13th Street")));
-
- foo(address_map);
-
- for (std::map<std::string, std::string>::iterator i = name2address.begin();
- i != name2address.end(); ++i)
- std::cout << i->first << ": " << i->second << "\n";
-
- return EXIT_SUCCESS;
-}

Deleted: sandbox/graph-v2/libs/property_map/example2.cpp
==============================================================================
--- sandbox/graph-v2/libs/property_map/example2.cpp 2007-09-06 10:12:02 EDT (Thu, 06 Sep 2007)
+++ (empty file)
@@ -1,48 +0,0 @@
-// (C) Copyright Ronald Garcia, Jeremy Siek 2002.
-// Permission to copy, use, modify,
-// sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
-
-#include <iostream>
-#include <map>
-#include <string>
-#include <boost/property_map.hpp>
-
-
-template <typename ConstAddressMap>
-void display(ConstAddressMap address)
-{
- typedef typename boost::property_traits<ConstAddressMap>::value_type
- value_type;
- typedef typename boost::property_traits<ConstAddressMap>::key_type key_type;
-
- key_type fred = "Fred";
- key_type joe = "Joe";
-
- value_type freds_address = get(address, fred);
- value_type joes_address = get(address, joe);
-
- std::cout << fred << ": " << freds_address << "\n"
- << joe << ": " << joes_address << "\n";
-}
-
-int
-main()
-{
- std::map<std::string, std::string> name2address;
- boost::const_associative_property_map< std::map<std::string, std::string> >
- address_map(name2address);
-
- name2address.insert(make_pair(std::string("Fred"),
- std::string("710 West 13th Street")));
- name2address.insert(make_pair(std::string("Joe"),
- std::string("710 West 13th Street")));
-
- display(address_map);
-
- return EXIT_SUCCESS;
-}
-
-

Deleted: sandbox/graph-v2/libs/property_map/example3.cpp
==============================================================================
--- sandbox/graph-v2/libs/property_map/example3.cpp 2007-09-06 10:12:02 EDT (Thu, 06 Sep 2007)
+++ (empty file)
@@ -1,21 +0,0 @@
-// Copyright Vladimir Prus 2003.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt
-// or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#include <boost/vector_property_map.hpp>
-#include <string>
-#include <iostream>
-
-int main()
-{
- boost::vector_property_map<std::string> m;
-
- // Assign string to '4'.
- m[4] = "e";
- std::cout << "'" << m[4] << "'\n";
-
- // Grab string from '10'. Since none is associated,
- // "" will be returned.
- std::cout << "'" << m[10] << "'\n";
-}


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