Boost-Geometry-Utils
view release on metacpan or search on metacpan
src/boost/graph/named_function_params.hpp view on Meta::CPAN
//=======================================================================
// Copyright 1997, 1998, 1999, 2000 University of Notre Dame.
// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek
//
// 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)
//=======================================================================
#ifndef BOOST_GRAPH_NAMED_FUNCTION_PARAMS_HPP
#define BOOST_GRAPH_NAMED_FUNCTION_PARAMS_HPP
#include <functional>
#include <vector>
#include <boost/ref.hpp>
#include <boost/utility/result_of.hpp>
#include <boost/preprocessor.hpp>
#include <boost/parameter/name.hpp>
#include <boost/parameter/binding.hpp>
#include <boost/type_traits.hpp>
#include <boost/mpl/not.hpp>
#include <boost/graph/properties.hpp>
#include <boost/graph/detail/d_ary_heap.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/property_map/shared_array_property_map.hpp>
namespace boost {
struct parity_map_t { };
struct vertex_assignment_map_t { };
struct distance_compare_t { };
struct distance_combine_t { };
struct distance_inf_t { };
struct distance_zero_t { };
struct buffer_param_t { };
struct edge_copy_t { };
struct vertex_copy_t { };
struct vertex_isomorphism_t { };
struct vertex_invariant_t { };
struct vertex_invariant1_t { };
struct vertex_invariant2_t { };
struct edge_compare_t { };
struct vertex_max_invariant_t { };
struct orig_to_copy_t { };
struct root_vertex_t { };
struct polling_t { };
struct lookahead_t { };
struct in_parallel_t { };
struct attractive_force_t { };
struct repulsive_force_t { };
struct force_pairs_t { };
struct cooling_t { };
struct vertex_displacement_t { };
struct iterations_t { };
struct diameter_range_t { };
struct learning_constant_range_t { };
struct vertices_equivalent_t { };
struct edges_equivalent_t { };
struct index_in_heap_map_t { };
struct max_priority_queue_t { };
#define BOOST_BGL_DECLARE_NAMED_PARAMS \
BOOST_BGL_ONE_PARAM_CREF(weight_map, edge_weight) \
BOOST_BGL_ONE_PARAM_CREF(weight_map2, edge_weight2) \
BOOST_BGL_ONE_PARAM_CREF(distance_map, vertex_distance) \
BOOST_BGL_ONE_PARAM_CREF(predecessor_map, vertex_predecessor) \
BOOST_BGL_ONE_PARAM_CREF(rank_map, vertex_rank) \
BOOST_BGL_ONE_PARAM_CREF(root_map, vertex_root) \
BOOST_BGL_ONE_PARAM_CREF(root_vertex, root_vertex) \
BOOST_BGL_ONE_PARAM_CREF(edge_centrality_map, edge_centrality) \
BOOST_BGL_ONE_PARAM_CREF(centrality_map, vertex_centrality) \
BOOST_BGL_ONE_PARAM_CREF(parity_map, parity_map) \
BOOST_BGL_ONE_PARAM_CREF(color_map, vertex_color) \
BOOST_BGL_ONE_PARAM_CREF(edge_color_map, edge_color) \
BOOST_BGL_ONE_PARAM_CREF(capacity_map, edge_capacity) \
BOOST_BGL_ONE_PARAM_CREF(residual_capacity_map, edge_residual_capacity) \
BOOST_BGL_ONE_PARAM_CREF(reverse_edge_map, edge_reverse) \
BOOST_BGL_ONE_PARAM_CREF(discover_time_map, vertex_discover_time) \
BOOST_BGL_ONE_PARAM_CREF(lowpoint_map, vertex_lowpoint) \
BOOST_BGL_ONE_PARAM_CREF(vertex_index_map, vertex_index) \
BOOST_BGL_ONE_PARAM_CREF(vertex_index1_map, vertex_index1) \
BOOST_BGL_ONE_PARAM_CREF(vertex_index2_map, vertex_index2) \
BOOST_BGL_ONE_PARAM_CREF(vertex_assignment_map, vertex_assignment_map) \
BOOST_BGL_ONE_PARAM_CREF(visitor, graph_visitor) \
BOOST_BGL_ONE_PARAM_CREF(distance_compare, distance_compare) \
BOOST_BGL_ONE_PARAM_CREF(distance_combine, distance_combine) \
BOOST_BGL_ONE_PARAM_CREF(distance_inf, distance_inf) \
BOOST_BGL_ONE_PARAM_CREF(distance_zero, distance_zero) \
BOOST_BGL_ONE_PARAM_CREF(edge_copy, edge_copy) \
BOOST_BGL_ONE_PARAM_CREF(vertex_copy, vertex_copy) \
BOOST_BGL_ONE_PARAM_REF(buffer, buffer_param) \
BOOST_BGL_ONE_PARAM_CREF(orig_to_copy, orig_to_copy) \
BOOST_BGL_ONE_PARAM_CREF(isomorphism_map, vertex_isomorphism) \
BOOST_BGL_ONE_PARAM_CREF(vertex_invariant, vertex_invariant) \
BOOST_BGL_ONE_PARAM_CREF(vertex_invariant1, vertex_invariant1) \
BOOST_BGL_ONE_PARAM_CREF(vertex_invariant2, vertex_invariant2) \
BOOST_BGL_ONE_PARAM_CREF(vertex_max_invariant, vertex_max_invariant) \
BOOST_BGL_ONE_PARAM_CREF(polling, polling) \
BOOST_BGL_ONE_PARAM_CREF(lookahead, lookahead) \
BOOST_BGL_ONE_PARAM_CREF(in_parallel, in_parallel) \
BOOST_BGL_ONE_PARAM_CREF(displacement_map, vertex_displacement) \
BOOST_BGL_ONE_PARAM_CREF(attractive_force, attractive_force) \
BOOST_BGL_ONE_PARAM_CREF(repulsive_force, repulsive_force) \
BOOST_BGL_ONE_PARAM_CREF(force_pairs, force_pairs) \
BOOST_BGL_ONE_PARAM_CREF(cooling, cooling) \
BOOST_BGL_ONE_PARAM_CREF(iterations, iterations) \
BOOST_BGL_ONE_PARAM_CREF(diameter_range, diameter_range) \
BOOST_BGL_ONE_PARAM_CREF(learning_constant_range, learning_constant_range) \
BOOST_BGL_ONE_PARAM_CREF(vertices_equivalent, vertices_equivalent) \
BOOST_BGL_ONE_PARAM_CREF(edges_equivalent, edges_equivalent) \
BOOST_BGL_ONE_PARAM_CREF(index_in_heap_map, index_in_heap_map) \
BOOST_BGL_ONE_PARAM_REF(max_priority_queue, max_priority_queue)
template <typename T, typename Tag, typename Base = no_property>
struct bgl_named_params
{
typedef bgl_named_params self;
typedef Base next_type;
typedef Tag tag_type;
typedef T value_type;
bgl_named_params(T v = T()) : m_value(v) { }
bgl_named_params(T v, const Base& b) : m_value(v), m_base(b) { }
T m_value;
Base m_base;
#define BOOST_BGL_ONE_PARAM_REF(name, key) \
template <typename PType> \
bgl_named_params<boost::reference_wrapper<PType>, BOOST_PP_CAT(key, _t), self> \
name(PType& p) const { \
typedef bgl_named_params<boost::reference_wrapper<PType>, BOOST_PP_CAT(key, _t), self> Params; \
return Params(boost::ref(p), *this); \
} \
#define BOOST_BGL_ONE_PARAM_CREF(name, key) \
template <typename PType> \
bgl_named_params<PType, BOOST_PP_CAT(key, _t), self> \
name(const PType& p) const { \
typedef bgl_named_params<PType, BOOST_PP_CAT(key, _t), self> Params; \
return Params(p, *this); \
} \
BOOST_BGL_DECLARE_NAMED_PARAMS
#undef BOOST_BGL_ONE_PARAM_REF
#undef BOOST_BGL_ONE_PARAM_CREF
// Duplicate
template <typename PType>
bgl_named_params<PType, vertex_color_t, self>
vertex_color_map(const PType& p) const {return this->color_map(p);}
};
#define BOOST_BGL_ONE_PARAM_REF(name, key) \
template <typename PType> \
bgl_named_params<boost::reference_wrapper<PType>, BOOST_PP_CAT(key, _t)> \
name(PType& p) { \
typedef bgl_named_params<boost::reference_wrapper<PType>, BOOST_PP_CAT(key, _t)> Params; \
return Params(boost::ref(p)); \
} \
#define BOOST_BGL_ONE_PARAM_CREF(name, key) \
template <typename PType> \
bgl_named_params<PType, BOOST_PP_CAT(key, _t)> \
name(const PType& p) { \
typedef bgl_named_params<PType, BOOST_PP_CAT(key, _t)> Params; \
return Params(p); \
( run in 0.580 second using v1.01-cache-2.11-cpan-96521ef73a4 )