container_traits.hpp 1.2 KB

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