Chris@16
|
1 // Copyright (C) 2004-2006 The Trustees of Indiana University.
|
Chris@16
|
2
|
Chris@16
|
3 // Use, modification and distribution is subject to the Boost Software
|
Chris@16
|
4 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
5 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
6
|
Chris@16
|
7 // Authors: Douglas Gregor
|
Chris@16
|
8 // Andrew Lumsdaine
|
Chris@16
|
9
|
Chris@16
|
10 //
|
Chris@16
|
11 // This file contains traits that describe
|
Chris@16
|
12 //
|
Chris@16
|
13 #ifndef BOOST_GRAPH_PARALLEL_CONTAINER_TRAITS_HPP
|
Chris@16
|
14 #define BOOST_GRAPH_PARALLEL_CONTAINER_TRAITS_HPP
|
Chris@16
|
15
|
Chris@16
|
16 #ifndef BOOST_GRAPH_USE_MPI
|
Chris@16
|
17 #error "Parallel BGL files should not be included unless <boost/graph/use_mpi.hpp> has been included"
|
Chris@16
|
18 #endif
|
Chris@16
|
19
|
Chris@16
|
20 namespace boost { namespace graph { namespace parallel {
|
Chris@16
|
21
|
Chris@16
|
22 template<typename T>
|
Chris@16
|
23 struct process_group_type
|
Chris@16
|
24 {
|
Chris@16
|
25 typedef typename T::process_group_type type;
|
Chris@16
|
26 };
|
Chris@16
|
27
|
Chris@16
|
28 template<typename T>
|
Chris@16
|
29 inline typename process_group_type<T>::type
|
Chris@16
|
30 process_group(const T& x)
|
Chris@16
|
31 { return x.process_group(); }
|
Chris@16
|
32
|
Chris@16
|
33 // Helper function that algorithms should use to get the process group
|
Chris@16
|
34 // out of a container.
|
Chris@16
|
35 template<typename Container>
|
Chris@16
|
36 inline typename process_group_type<Container>::type
|
Chris@16
|
37 process_group_adl(const Container& container)
|
Chris@16
|
38 {
|
Chris@16
|
39 return process_group(container);
|
Chris@16
|
40 }
|
Chris@16
|
41
|
Chris@16
|
42
|
Chris@16
|
43 } } } // end namespace boost::graph::parallel
|
Chris@16
|
44
|
Chris@16
|
45 #endif // BOOST_GRAPH_PARALLEL_CONTAINER_TRAITS_HPP
|