Skip to content

Commit

Permalink
Merge pull request #2771 from STEllAR-GROUP/preprocessor
Browse files Browse the repository at this point in the history
Removing boost preprocessor dependency
  • Loading branch information
hkaiser committed Jul 23, 2017
2 parents 8c1b4aa + 8f16bce commit c63810a
Show file tree
Hide file tree
Showing 80 changed files with 1,120 additions and 842 deletions.
20 changes: 11 additions & 9 deletions examples/accumulators/server/template_accumulator.hpp
@@ -1,4 +1,4 @@
// Copyright (c) 2007-2016 Hartmut Kaiser
// Copyright (c) 2007-2017 Hartmut Kaiser
// Copyright (c) 2011 Bryce Adelstein-Lelbach
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
Expand All @@ -10,6 +10,8 @@
#include <hpx/include/components.hpp>
#include <hpx/include/actions.hpp>

#include <hpx/util/detail/pp/cat.hpp>

///////////////////////////////////////////////////////////////////////////////
namespace examples { namespace server
{
Expand Down Expand Up @@ -88,34 +90,34 @@ namespace examples { namespace server
#define REGISTER_TEMPLATE_ACCUMULATOR_DECLARATION(type) \
HPX_REGISTER_ACTION_DECLARATION( \
examples::server::template_accumulator<type>::reset_action, \
BOOST_PP_CAT(__template_accumulator_reset_action_, type)); \
HPX_PP_CAT(__template_accumulator_reset_action_, type)); \
\
HPX_REGISTER_ACTION_DECLARATION( \
examples::server::template_accumulator<type>::add_action, \
BOOST_PP_CAT(__template_accumulator_add_action_, type)); \
HPX_PP_CAT(__template_accumulator_add_action_, type)); \
\
HPX_REGISTER_ACTION_DECLARATION( \
examples::server::template_accumulator<type>::query_action, \
BOOST_PP_CAT(__template_accumulator_query_action_, type)); \
HPX_PP_CAT(__template_accumulator_query_action_, type)); \
/**/

#define REGISTER_TEMPLATE_ACCUMULATOR(type) \
HPX_REGISTER_ACTION( \
examples::server::template_accumulator<type>::reset_action, \
BOOST_PP_CAT(__template_accumulator_reset_action_, type)); \
HPX_PP_CAT(__template_accumulator_reset_action_, type)); \
\
HPX_REGISTER_ACTION( \
examples::server::template_accumulator<type>::add_action, \
BOOST_PP_CAT(__template_accumulator_add_action_, type)); \
HPX_PP_CAT(__template_accumulator_add_action_, type)); \
\
HPX_REGISTER_ACTION( \
examples::server::template_accumulator<type>::query_action, \
BOOST_PP_CAT(__template_accumulator_query_action_, type)); \
HPX_PP_CAT(__template_accumulator_query_action_, type)); \
\
typedef ::hpx::components::component< \
examples::server::template_accumulator<type> \
> BOOST_PP_CAT(__template_accumulator_, type); \
HPX_REGISTER_COMPONENT(BOOST_PP_CAT(__template_accumulator_, type)) \
> HPX_PP_CAT(__template_accumulator_, type); \
HPX_REGISTER_COMPONENT(HPX_PP_CAT(__template_accumulator_, type)) \
/**/

#endif
Expand Down
Expand Up @@ -24,11 +24,12 @@
#include <hpx/runtime/get_ptr.hpp>
#include <hpx/runtime/launch_policy.hpp>
#include <hpx/util/assert.hpp>
#include <hpx/util/detail/pp/cat.hpp>
#include <hpx/util/detail/pp/expand.hpp>
#include <hpx/util/detail/pp/nargs.hpp>

#include <hpx/components/containers/partitioned_vector/partitioned_vector_fwd.hpp>

#include <boost/preprocessor/cat.hpp>

#include <cstddef>
#include <iostream>
#include <memory>
Expand Down Expand Up @@ -406,28 +407,28 @@ namespace hpx { namespace server
HPX_REGISTER_VECTOR_DECLARATION_(__VA_ARGS__) \
/**/
#define HPX_REGISTER_VECTOR_DECLARATION_(...) \
HPX_UTIL_EXPAND_(BOOST_PP_CAT( \
HPX_REGISTER_VECTOR_DECLARATION_, HPX_UTIL_PP_NARG(__VA_ARGS__) \
HPX_PP_EXPAND(HPX_PP_CAT( \
HPX_REGISTER_VECTOR_DECLARATION_, HPX_PP_NARGS(__VA_ARGS__) \
)(__VA_ARGS__)) \
/**/

#define HPX_REGISTER_VECTOR_DECLARATION_IMPL(type, name) \
HPX_REGISTER_ACTION_DECLARATION(type::get_value_action, \
BOOST_PP_CAT(__vector_get_value_action_, name)); \
HPX_PP_CAT(__vector_get_value_action_, name)); \
HPX_REGISTER_ACTION_DECLARATION(type::get_values_action, \
BOOST_PP_CAT(__vector_get_values_action_, name)); \
HPX_PP_CAT(__vector_get_values_action_, name)); \
HPX_REGISTER_ACTION_DECLARATION(type::set_value_action, \
BOOST_PP_CAT(__vector_set_value_action_, name)); \
HPX_PP_CAT(__vector_set_value_action_, name)); \
HPX_REGISTER_ACTION_DECLARATION(type::set_values_action, \
BOOST_PP_CAT(__vector_set_values_action_, name)); \
HPX_PP_CAT(__vector_set_values_action_, name)); \
HPX_REGISTER_ACTION_DECLARATION(type::size_action, \
BOOST_PP_CAT(__vector_size_action_, name)); \
HPX_PP_CAT(__vector_size_action_, name)); \
HPX_REGISTER_ACTION_DECLARATION(type::resize_action, \
BOOST_PP_CAT(__vector_resize_action_, name)); \
HPX_PP_CAT(__vector_resize_action_, name)); \
HPX_REGISTER_ACTION_DECLARATION(type::get_copied_data_action, \
BOOST_PP_CAT(__vector_get_copied_data_action_, name)); \
HPX_PP_CAT(__vector_get_copied_data_action_, name)); \
HPX_REGISTER_ACTION_DECLARATION(type::set_data_action, \
BOOST_PP_CAT(__vector_set_data_action_, name)); \
HPX_PP_CAT(__vector_set_data_action_, name)); \
/**/

#define HPX_REGISTER_VECTOR_DECLARATION_1(type) \
Expand All @@ -438,39 +439,39 @@ namespace hpx { namespace server
/**/
#define HPX_REGISTER_VECTOR_DECLARATION_3(type, data, name) \
typedef ::hpx::server::partitioned_vector<type, data> \
BOOST_PP_CAT(__partitioned_vector_, BOOST_PP_CAT(type, name)); \
HPX_PP_CAT(__partitioned_vector_, HPX_PP_CAT(type, name)); \
HPX_REGISTER_VECTOR_DECLARATION_IMPL( \
BOOST_PP_CAT(__partitioned_vector_, BOOST_PP_CAT(type, name)), name) \
HPX_PP_CAT(__partitioned_vector_, HPX_PP_CAT(type, name)), name) \
/**/

#define HPX_REGISTER_PARTITIONED_VECTOR(...) \
HPX_REGISTER_VECTOR_(__VA_ARGS__) \
/**/
#define HPX_REGISTER_VECTOR_(...) \
HPX_UTIL_EXPAND_(BOOST_PP_CAT( \
HPX_REGISTER_VECTOR_, HPX_UTIL_PP_NARG(__VA_ARGS__) \
HPX_PP_EXPAND(HPX_PP_CAT( \
HPX_REGISTER_VECTOR_, HPX_PP_NARGS(__VA_ARGS__) \
)(__VA_ARGS__)) \
/**/

#define HPX_REGISTER_VECTOR_IMPL(type, name) \
HPX_REGISTER_ACTION(type::get_value_action, \
BOOST_PP_CAT(__vector_get_value_action_, name)); \
HPX_PP_CAT(__vector_get_value_action_, name)); \
HPX_REGISTER_ACTION(type::get_values_action, \
BOOST_PP_CAT(__vector_get_values_action_, name)); \
HPX_PP_CAT(__vector_get_values_action_, name)); \
HPX_REGISTER_ACTION(type::set_value_action, \
BOOST_PP_CAT(__vector_set_value_action_, name)); \
HPX_PP_CAT(__vector_set_value_action_, name)); \
HPX_REGISTER_ACTION(type::set_values_action, \
BOOST_PP_CAT(__vector_set_values_action_, name)); \
HPX_PP_CAT(__vector_set_values_action_, name)); \
HPX_REGISTER_ACTION(type::size_action, \
BOOST_PP_CAT(__vector_size_action_, name)); \
HPX_PP_CAT(__vector_size_action_, name)); \
HPX_REGISTER_ACTION(type::resize_action, \
BOOST_PP_CAT(__vector_resize_action_, name)); \
HPX_PP_CAT(__vector_resize_action_, name)); \
HPX_REGISTER_ACTION(type::get_copied_data_action, \
BOOST_PP_CAT(__vector_get_copied_data_action_, name)); \
HPX_PP_CAT(__vector_get_copied_data_action_, name)); \
HPX_REGISTER_ACTION(type::set_data_action, \
BOOST_PP_CAT(__vector_set_data_action_, name)); \
typedef ::hpx::components::component<type> BOOST_PP_CAT(__vector_, name); \
HPX_REGISTER_COMPONENT(BOOST_PP_CAT(__vector_, name)) \
HPX_PP_CAT(__vector_set_data_action_, name)); \
typedef ::hpx::components::component<type> HPX_PP_CAT(__vector_, name); \
HPX_REGISTER_COMPONENT(HPX_PP_CAT(__vector_, name)) \
/**/

#define HPX_REGISTER_VECTOR_1(type) \
Expand All @@ -481,9 +482,9 @@ namespace hpx { namespace server
/**/
#define HPX_REGISTER_VECTOR_3(type, data, name) \
typedef ::hpx::server::partitioned_vector<type, data> \
BOOST_PP_CAT(__partitioned_vector_, BOOST_PP_CAT(type, name)); \
HPX_PP_CAT(__partitioned_vector_, HPX_PP_CAT(type, name)); \
HPX_REGISTER_VECTOR_IMPL( \
BOOST_PP_CAT(__partitioned_vector_, BOOST_PP_CAT(type, name)), name) \
HPX_PP_CAT(__partitioned_vector_, HPX_PP_CAT(type, name)), name) \
/**/

///////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit c63810a

Please sign in to comment.