update boost
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#ifndef DYNAMIC_PROPERTY_MAP_RG09302004_HPP
|
||||
#define DYNAMIC_PROPERTY_MAP_RG09302004_HPP
|
||||
#ifndef BOOST_PROPERTY_MAP_DYNAMIC_PROPERTY_MAP_HPP
|
||||
#define BOOST_PROPERTY_MAP_DYNAMIC_PROPERTY_MAP_HPP
|
||||
|
||||
// Copyright 2004-5 The Trustees of Indiana University.
|
||||
|
||||
@@ -24,13 +24,16 @@
|
||||
#include <boost/any.hpp>
|
||||
#include <boost/function/function3.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <typeinfo>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <map>
|
||||
#include <boost/type.hpp>
|
||||
#include <boost/type_index.hpp>
|
||||
#include <boost/smart_ptr.hpp>
|
||||
#include <exception>
|
||||
#include <map>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <typeinfo>
|
||||
|
||||
namespace boost {
|
||||
|
||||
@@ -70,17 +73,17 @@ public:
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
struct dynamic_property_exception : public std::exception {
|
||||
virtual ~dynamic_property_exception() throw() {}
|
||||
virtual const char* what() const throw() = 0;
|
||||
~dynamic_property_exception() throw() BOOST_OVERRIDE {}
|
||||
const char* what() const throw() BOOST_OVERRIDE = 0;
|
||||
};
|
||||
|
||||
struct property_not_found : public dynamic_property_exception {
|
||||
std::string property;
|
||||
mutable std::string statement;
|
||||
property_not_found(const std::string& property) : property(property) {}
|
||||
virtual ~property_not_found() throw() {}
|
||||
~property_not_found() throw() BOOST_OVERRIDE {}
|
||||
|
||||
const char* what() const throw() {
|
||||
const char* what() const throw() BOOST_OVERRIDE {
|
||||
if(statement.empty())
|
||||
statement =
|
||||
std::string("Property not found: ") + property + ".";
|
||||
@@ -93,13 +96,13 @@ struct dynamic_get_failure : public dynamic_property_exception {
|
||||
std::string property;
|
||||
mutable std::string statement;
|
||||
dynamic_get_failure(const std::string& property) : property(property) {}
|
||||
virtual ~dynamic_get_failure() throw() {}
|
||||
~dynamic_get_failure() throw() BOOST_OVERRIDE {}
|
||||
|
||||
const char* what() const throw() {
|
||||
const char* what() const throw() BOOST_OVERRIDE {
|
||||
if(statement.empty())
|
||||
statement =
|
||||
std::string(
|
||||
"dynamic property get cannot retrieve value for property: ")
|
||||
"dynamic property get cannot retrieve value for property: ")
|
||||
+ property + ".";
|
||||
|
||||
return statement.c_str();
|
||||
@@ -107,9 +110,9 @@ struct dynamic_get_failure : public dynamic_property_exception {
|
||||
};
|
||||
|
||||
struct dynamic_const_put_error : public dynamic_property_exception {
|
||||
virtual ~dynamic_const_put_error() throw() {}
|
||||
~dynamic_const_put_error() throw() BOOST_OVERRIDE {}
|
||||
|
||||
const char* what() const throw() {
|
||||
const char* what() const throw() BOOST_OVERRIDE {
|
||||
return "Attempt to put a value into a const property map: ";
|
||||
}
|
||||
};
|
||||
@@ -147,7 +150,7 @@ class dynamic_property_map_adaptor : public dynamic_property_map
|
||||
using boost::put;
|
||||
|
||||
key_type key_ = any_cast<key_type>(in_key);
|
||||
if (in_value.type() == typeid(value_type)) {
|
||||
if (in_value.type() == boost::typeindex::type_id<value_type>()) {
|
||||
put(property_map_, key_, any_cast<value_type>(in_value));
|
||||
} else {
|
||||
// if in_value is an empty string, put a default constructed value_type.
|
||||
@@ -169,27 +172,27 @@ public:
|
||||
explicit dynamic_property_map_adaptor(const PropertyMap& property_map_)
|
||||
: property_map_(property_map_) { }
|
||||
|
||||
virtual boost::any get(const any& key_)
|
||||
boost::any get(const any& key_) BOOST_OVERRIDE
|
||||
{
|
||||
return get_wrapper_xxx(property_map_, any_cast<typename boost::property_traits<PropertyMap>::key_type>(key_));
|
||||
}
|
||||
|
||||
virtual std::string get_string(const any& key_)
|
||||
std::string get_string(const any& key_) BOOST_OVERRIDE
|
||||
{
|
||||
std::ostringstream out;
|
||||
out << get_wrapper_xxx(property_map_, any_cast<typename boost::property_traits<PropertyMap>::key_type>(key_));
|
||||
return out.str();
|
||||
}
|
||||
|
||||
virtual void put(const any& in_key, const any& in_value)
|
||||
void put(const any& in_key, const any& in_value) BOOST_OVERRIDE
|
||||
{
|
||||
do_put(in_key, in_value,
|
||||
mpl::bool_<(is_convertible<category*,
|
||||
writable_property_map_tag*>::value)>());
|
||||
}
|
||||
|
||||
virtual const std::type_info& key() const { return typeid(key_type); }
|
||||
virtual const std::type_info& value() const { return typeid(value_type); }
|
||||
const std::type_info& key() const BOOST_OVERRIDE { return typeid(key_type); }
|
||||
const std::type_info& value() const BOOST_OVERRIDE { return typeid(value_type); }
|
||||
|
||||
PropertyMap& base() { return property_map_; }
|
||||
const PropertyMap& base() const { return property_map_; }
|
||||
@@ -349,4 +352,4 @@ ignore_other_properties(const std::string&,
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // DYNAMIC_PROPERTY_MAP_RG09302004_HPP
|
||||
#endif // BOOST_PROPERTY_MAP_DYNAMIC_PROPERTY_MAP_HPP
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <boost/property_map/parallel/distributed_property_map.hpp>
|
||||
#include <boost/property_map/parallel/detail/untracked_pair.hpp>
|
||||
#include <boost/type_traits/is_base_and_derived.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/property_map/parallel/simple_trigger.hpp>
|
||||
|
||||
namespace boost { namespace parallel {
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <cstddef>
|
||||
#include <boost/detail/iterator.hpp>
|
||||
#include <boost/concept_archetype.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/or.hpp>
|
||||
@@ -222,11 +221,11 @@ public:
|
||||
const index_map_type& id)
|
||||
: inherited(id.process_group(), id.global(),
|
||||
local_iterator_map(cc, n, id.base())) { }
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#include <boost/property_map/vector_property_map.hpp>
|
||||
#include <boost/property_map/parallel/vector_property_map.hpp>
|
||||
|
||||
#endif /* BOOST_PROPERTY_MAP_PARALLEL_PROPERTY_MAPS_HPP */
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <cstddef>
|
||||
#include <boost/detail/iterator.hpp>
|
||||
#include <iterator>
|
||||
#include <boost/concept/assert.hpp>
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/concept_archetype.hpp>
|
||||
@@ -407,14 +407,14 @@ namespace boost {
|
||||
template <class RAIter, class ID>
|
||||
inline safe_iterator_property_map<
|
||||
RAIter, ID,
|
||||
typename boost::detail::iterator_traits<RAIter>::value_type,
|
||||
typename boost::detail::iterator_traits<RAIter>::reference>
|
||||
typename std::iterator_traits<RAIter>::value_type,
|
||||
typename std::iterator_traits<RAIter>::reference>
|
||||
make_safe_iterator_property_map(RAIter iter, std::size_t n, ID id) {
|
||||
BOOST_CONCEPT_ASSERT((RandomAccessIteratorConcept<RAIter>));
|
||||
typedef safe_iterator_property_map<
|
||||
RAIter, ID,
|
||||
typename boost::detail::iterator_traits<RAIter>::value_type,
|
||||
typename boost::detail::iterator_traits<RAIter>::reference> PA;
|
||||
typename std::iterator_traits<RAIter>::value_type,
|
||||
typename std::iterator_traits<RAIter>::reference> PA;
|
||||
return PA(iter, n, id);
|
||||
}
|
||||
template <class RAIter, class Value, class ID>
|
||||
@@ -595,10 +595,6 @@ namespace boost {
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#ifdef BOOST_GRAPH_USE_MPI
|
||||
#include <boost/property_map/parallel/parallel_property_maps.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/property_map/vector_property_map.hpp>
|
||||
|
||||
#endif /* BOOST_PROPERTY_MAP_HPP */
|
||||
|
||||
@@ -7,11 +7,12 @@
|
||||
// documentation.
|
||||
//
|
||||
|
||||
#ifndef VECTOR_PROPERTY_MAP_HPP_VP_2003_03_04
|
||||
#define VECTOR_PROPERTY_MAP_HPP_VP_2003_03_04
|
||||
#ifndef BOOST_PROPERTY_MAP_VECTOR_PROPERTY_MAP_HPP
|
||||
#define BOOST_PROPERTY_MAP_VECTOR_PROPERTY_MAP_HPP
|
||||
|
||||
#include <boost/property_map/property_map.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/smart_ptr/shared_ptr.hpp>
|
||||
#include <iterator>
|
||||
#include <vector>
|
||||
|
||||
namespace boost {
|
||||
@@ -28,7 +29,7 @@ namespace boost {
|
||||
typedef typename std::iterator_traits<
|
||||
typename std::vector<T>::iterator >::reference reference;
|
||||
typedef boost::lvalue_property_map_tag category;
|
||||
|
||||
|
||||
vector_property_map(const IndexMap& index = IndexMap())
|
||||
: store(new std::vector<T>()), index(index)
|
||||
{}
|
||||
@@ -57,15 +58,15 @@ namespace boost {
|
||||
{
|
||||
return store->end();
|
||||
}
|
||||
|
||||
|
||||
IndexMap& get_index_map() { return index; }
|
||||
const IndexMap& get_index_map() const { return index; }
|
||||
|
||||
|
||||
public:
|
||||
// Copy ctor absent, default semantics is OK.
|
||||
// Assignment operator absent, default semantics is OK.
|
||||
// CONSIDER: not sure that assignment to 'index' is correct.
|
||||
|
||||
|
||||
reference operator[](const key_type& v) const {
|
||||
typename property_traits<IndexMap>::value_type i = get(index, v);
|
||||
if (static_cast<unsigned>(i) >= store->size()) {
|
||||
@@ -80,10 +81,10 @@ namespace boost {
|
||||
// store pointer to data, because if copy of property map resizes
|
||||
// the vector, the pointer to data will be invalidated.
|
||||
// I wonder if class 'pmap_ref' is simply needed.
|
||||
shared_ptr< std::vector<T> > store;
|
||||
shared_ptr< std::vector<T> > store;
|
||||
IndexMap index;
|
||||
};
|
||||
|
||||
|
||||
template<typename T, typename IndexMap>
|
||||
vector_property_map<T, IndexMap>
|
||||
make_vector_property_map(IndexMap index)
|
||||
@@ -92,8 +93,4 @@ namespace boost {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef BOOST_GRAPH_USE_MPI
|
||||
#include <boost/property_map/parallel/vector_property_map.hpp>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user