Skip to content

Commit

Permalink
Removing hpx_fwd.hpp includes
Browse files Browse the repository at this point in the history
As a start, this patch removes hpx_fwd.hpp from all of hpx/util and deals with
the avalanche for the rest of the headers.
  • Loading branch information
sithhell committed Sep 15, 2015
1 parent 6110618 commit f36c291
Show file tree
Hide file tree
Showing 105 changed files with 495 additions and 337 deletions.
5 changes: 5 additions & 0 deletions docs/CMakeLists.txt
Expand Up @@ -51,6 +51,7 @@ set(doxygen_dependencies
"${PROJECT_SOURCE_DIR}/hpx/hpx_finalize.hpp"
"${PROJECT_SOURCE_DIR}/hpx/error.hpp"
"${PROJECT_SOURCE_DIR}/hpx/exception.hpp"
"${PROJECT_SOURCE_DIR}/hpx/exception_fwd.hpp"
"${PROJECT_SOURCE_DIR}/hpx/exception_list.hpp"
"${PROJECT_SOURCE_DIR}/hpx/lcos_fwd.hpp"
"${PROJECT_SOURCE_DIR}/hpx/components/component_storage/migrate_from_storage.hpp"
Expand Down Expand Up @@ -109,9 +110,13 @@ set(doxygen_dependencies
"${PROJECT_SOURCE_DIR}/hpx/runtime/basename_registration.hpp"
"${PROJECT_SOURCE_DIR}/hpx/runtime/get_ptr.hpp"
"${PROJECT_SOURCE_DIR}/hpx/runtime/get_locality_name.hpp"
"${PROJECT_SOURCE_DIR}/hpx/runtime/get_locality_id.hpp"
"${PROJECT_SOURCE_DIR}/hpx/runtime/get_os_thread_count.hpp"
"${PROJECT_SOURCE_DIR}/hpx/runtime/get_worker_thread_num.hpp"
"${PROJECT_SOURCE_DIR}/hpx/runtime/find_here.hpp"
"${PROJECT_SOURCE_DIR}/hpx/runtime/launch_policy.hpp"
"${PROJECT_SOURCE_DIR}/hpx/runtime/parcelset_fwd.hpp"
"${PROJECT_SOURCE_DIR}/hpx/runtime/runtime_mode.hpp"
"${PROJECT_SOURCE_DIR}/hpx/runtime/set_parcel_write_handler.hpp"
"${PROJECT_SOURCE_DIR}/hpx/runtime/trigger_lco.hpp"
"${PROJECT_SOURCE_DIR}/hpx/runtime/actions/basic_action.hpp"
Expand Down
13 changes: 13 additions & 0 deletions hpx/config/asio.hpp
@@ -0,0 +1,13 @@
// Copyright (c) 2015 Thomas Heller
//
// 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)

#if !defined(HPX_CONFIG_ASIO_HPP)
#define HPX_CONFIG_ASIO_HPP

#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
#include <winsock2.h>
#endif

#endif
29 changes: 1 addition & 28 deletions hpx/exception.hpp
Expand Up @@ -10,6 +10,7 @@
#define HPX_EXCEPTION_MAR_24_2008_0929AM

#include <hpx/config.hpp>
#include <hpx/exception_fwd.hpp>
#include <hpx/error.hpp>
#include <hpx/util/assert.hpp>
#include <hpx/util/logging.hpp>
Expand All @@ -36,12 +37,6 @@
///////////////////////////////////////////////////////////////////////////////
namespace hpx
{
/// \cond NOINTERNAL
// forward declaration
class error_code;
class exception;
/// \endcond

/// \cond NODETAIL
namespace detail
{
Expand Down Expand Up @@ -343,28 +338,6 @@ namespace hpx
boost::exception_ptr exception_;
};

/// \brief Predefined error_code object used as "throw on error" tag.
///
/// The predefined hpx::error_code object \a hpx::throws is supplied for use as
/// a "throw on error" tag.
///
/// Functions that specify an argument in the form 'error_code& ec=throws'
/// (with appropriate namespace qualifiers), have the following error
/// handling semantics:
///
/// If &ec != &throws and an error occurred: ec.value() returns the
/// implementation specific error number for the particular error that
/// occurred and ec.category() returns the error_category for ec.value().
///
/// If &ec != &throws and an error did not occur, ec.clear().
///
/// If an error occurs and &ec == &throws, the function throws an exception
/// of type \a hpx::exception or of a type derived from it. The exception's
/// \a get_errorcode() member function returns a reference to an
/// \a hpx::error_code object with the behavior as specified above.
///
HPX_EXCEPTION_EXPORT extern error_code throws;

/// @{
/// \brief Returns a new error_code constructed from the given parameters.
inline error_code
Expand Down
52 changes: 52 additions & 0 deletions hpx/exception_fwd.hpp
@@ -0,0 +1,52 @@
// Copyright (c) 2007-2014 Hartmut Kaiser
// Copyright (c) 2011 Bryce Lelbach
//
// 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)

/// \file exception_fwd.hpp

#ifndef HPX_EXCEPTION_FWD_HPP
#define HPX_EXCEPTION_FWD_HPP

#include <hpx/config/export_definitions.hpp>

/// \cond NOINTERNAL
namespace boost
{
class exception_ptr;
}
/// \endcond

namespace hpx
{
/// \cond NOINTERNAL
// forward declaration
class error_code;
class exception;
/// \endcond

/// \brief Predefined error_code object used as "throw on error" tag.
///
/// The predefined hpx::error_code object \a hpx::throws is supplied for use as
/// a "throw on error" tag.
///
/// Functions that specify an argument in the form 'error_code& ec=throws'
/// (with appropriate namespace qualifiers), have the following error
/// handling semantics:
///
/// If &ec != &throws and an error occurred: ec.value() returns the
/// implementation specific error number for the particular error that
/// occurred and ec.category() returns the error_category for ec.value().
///
/// If &ec != &throws and an error did not occur, ec.clear().
///
/// If an error occurs and &ec == &throws, the function throws an exception
/// of type \a hpx::exception or of a type derived from it. The exception's
/// \a get_errorcode() member function returns a reference to an
/// \a hpx::error_code object with the behavior as specified above.
///
HPX_EXCEPTION_EXPORT extern error_code throws;
}

#endif
129 changes: 6 additions & 123 deletions hpx/hpx_fwd.hpp
Expand Up @@ -38,6 +38,7 @@
#include <boost/type_traits/remove_reference.hpp>

#include <hpx/traits.hpp>
#include <hpx/exception_fwd.hpp>
#include <hpx/traits/component_type_database.hpp>
#include <hpx/lcos/local/once_fwd.hpp>
#include <hpx/lcos_fwd.hpp>
Expand All @@ -46,20 +47,17 @@
#include <hpx/util/move.hpp>
#include <hpx/util/unique_function.hpp>
#include <hpx/util/unused.hpp>
#include <hpx/runtime/agas_fwd.hpp>
#include <hpx/runtime/find_here.hpp>
#include <hpx/runtime/launch_policy.hpp>
#include <hpx/runtime/parcelset_fwd.hpp>
#include <hpx/runtime/runtime_mode.hpp>
#include <hpx/runtime/components/component_type.hpp>
#include <hpx/runtime/naming/id_type.hpp>
#include <hpx/runtime/threads_fwd.hpp>
#include <hpx/runtime/threads/detail/tagged_thread_state.hpp>
#include <hpx/runtime/threads/thread_enums.hpp>

/// \cond NOINTERNAL
namespace boost
{
class exception_ptr;
}
/// \endcond

/// \namespace hpx
///
/// The namespace \a hpx is the main namespace of the HPX library. All classes
Expand All @@ -86,18 +84,6 @@ namespace hpx
HPX_API_EXPORT applier* get_applier_ptr();
}

namespace agas
{
struct HPX_API_EXPORT addressing_service;

enum service_mode
{
service_mode_invalid = -1,
service_mode_bootstrap = 0,
service_mode_hosted = 1
};
}

/// \namespace naming
///
/// The namespace \a naming contains all definitions needed for the AGAS
Expand All @@ -117,61 +103,9 @@ namespace hpx
typedef boost::uint64_t address_type;
}

///////////////////////////////////////////////////////////////////////////
/// \namespace parcelset
namespace parcelset
{
class HPX_API_EXPORT locality;

class HPX_API_EXPORT parcel;
class HPX_API_EXPORT parcelport;
class HPX_API_EXPORT parcelhandler;

namespace server
{
class parcelport_queue;
}

struct parcelhandler_queue_base;

namespace policies
{
struct global_parcelhandler_queue;
typedef global_parcelhandler_queue parcelhandler_queue;

struct message_handler;
}

HPX_API_EXPORT policies::message_handler* get_message_handler(
parcelhandler* ph, char const* name, char const* type,
std::size_t num, std::size_t interval, locality const& l,
error_code& ec = throws);

HPX_API_EXPORT bool do_background_work(std::size_t num_thread = 0);
}

class HPX_API_EXPORT runtime;
class HPX_API_EXPORT thread;

/// A HPX runtime can be executed in two different modes: console mode
/// and worker mode.
enum runtime_mode
{
runtime_mode_invalid = -1,
runtime_mode_console = 0, ///< The runtime is the console locality
runtime_mode_worker = 1, ///< The runtime is a worker locality
runtime_mode_connect = 2, ///< The runtime is a worker locality
///< connecting late
runtime_mode_default = 3, ///< The runtime mode will be determined
///< based on the command line arguments
runtime_mode_last
};

/// Get the readable string representing the name of the given runtime_mode
/// constant.
HPX_API_EXPORT char const* get_runtime_mode_name(runtime_mode state);
HPX_API_EXPORT runtime_mode get_runtime_mode_from_name(std::string const& mode);

///////////////////////////////////////////////////////////////////////////
template <typename SchedulingPolicy>
class HPX_API_EXPORT runtime_impl;
Expand Down Expand Up @@ -315,34 +249,6 @@ namespace hpx

namespace hpx
{
///////////////////////////////////////////////////////////////////////////
/// \brief Return the global id representing this locality
///
/// The function \a find_here() can be used to retrieve the global id
/// usable to refer to the current locality.
///
/// \param ec [in,out] this represents the error status on exit, if this
/// is pre-initialized to \a hpx#throws the function will throw
/// on error instead.
///
/// \note Generally, the id of a locality can be used for instance to
/// create new instances of components and to invoke plain actions
/// (global functions).
///
/// \returns The global id representing the locality this function has
/// been called on.
///
/// \note As long as \a ec is not pre-initialized to \a hpx::throws this
/// function doesn't throw but returns the result code using the
/// parameter \a ec. Otherwise it throws an instance of
/// hpx::exception.
///
/// \note This function will return meaningful results only if called
/// from an HPX-thread. It will return \a hpx::naming::invalid_id
/// otherwise.
///
/// \see \a hpx::find_all_localities(), \a hpx::find_locality()
HPX_API_EXPORT naming::id_type find_here(error_code& ec = throws);

///////////////////////////////////////////////////////////////////////////
/// \brief Return the global id representing the root locality
Expand Down Expand Up @@ -729,30 +635,6 @@ namespace hpx
/// \see \a hpx::register_pre_shutdown_function()
HPX_API_EXPORT void register_shutdown_function(shutdown_function_type const& f);

///////////////////////////////////////////////////////////////////////////
/// \brief Return the number of the locality this function is being called
/// from.
///
/// This function returns the id of the current locality.
///
/// \param ec [in,out] this represents the error status on exit, if this
/// is pre-initialized to \a hpx#throws the function will throw
/// on error instead.
///
/// \note The returned value is zero based and its maximum value is
/// smaller than the overall number of localities the current
/// application is running on (as returned by
/// \a get_num_localities()).
///
/// \note As long as \a ec is not pre-initialized to \a hpx::throws this
/// function doesn't throw but returns the result code using the
/// parameter \a ec. Otherwise it throws an instance of
/// hpx::exception.
///
/// \note This function needs to be executed on a HPX-thread. It will
/// fail otherwise (it will return -1).
HPX_API_EXPORT boost::uint32_t get_locality_id(error_code& ec = throws);

///////////////////////////////////////////////////////////////////////////
/// \brief Test whether the runtime system is currently being started.
///
Expand Down Expand Up @@ -1012,6 +894,7 @@ namespace hpx
#include <hpx/runtime/basename_registration.hpp>
#include <hpx/runtime/trigger_lco.hpp>
#include <hpx/runtime/get_locality_name.hpp>
#include <hpx/runtime/get_locality_id.hpp>
#include <hpx/runtime/get_config_entry.hpp>
#include <hpx/runtime/set_parcel_write_handler.hpp>
#include <hpx/runtime/get_os_thread_count.hpp>
Expand Down
2 changes: 1 addition & 1 deletion hpx/lcos/base_lco.hpp
Expand Up @@ -6,7 +6,7 @@
#if !defined(HPX_LCOS_BASE_LCO_JUN_12_2008_0852PM)
#define HPX_LCOS_BASE_LCO_JUN_12_2008_0852PM

#include <hpx/hpx_fwd.hpp>
#include <hpx/config.hpp>
#include <hpx/exception.hpp>
#include <hpx/runtime/components/component_type.hpp>
#include <hpx/runtime/components/server/managed_component_base.hpp>
Expand Down
2 changes: 1 addition & 1 deletion hpx/lcos/base_lco_with_value.hpp
Expand Up @@ -6,7 +6,7 @@
#if !defined(HPX_LCOS_BASE_LCO_WITH_VALUE_HPP)
#define HPX_LCOS_BASE_LCO_WITH_VALUE_HPP

#include <hpx/hpx_fwd.hpp>
#include <hpx/config.hpp>
#include <hpx/exception.hpp>
#include <hpx/lcos/base_lco.hpp>
#include <hpx/runtime/components/component_type.hpp>
Expand Down
1 change: 1 addition & 0 deletions hpx/plugins/parcelport/tcp/connection_handler.hpp
Expand Up @@ -11,6 +11,7 @@
#define HPX_PARCELSET_POLICIES_TCP_CONNECTION_HANDLER_HPP

#include <hpx/config/warnings_prefix.hpp>
#include <hpx/config/asio.hpp>

#include <hpx/runtime/parcelset/locality.hpp>
#include <hpx/runtime/parcelset/parcelport_impl.hpp>
Expand Down
1 change: 1 addition & 0 deletions hpx/plugins/parcelport/tcp/locality.hpp
Expand Up @@ -10,6 +10,7 @@
#ifndef HPX_PARCELSET_POLICIES_TCP_LOCALITY_HPP
#define HPX_PARCELSET_POLICIES_TCP_LOCALITY_HPP

#include <hpx/config/asio.hpp>
#include <hpx/hpx_fwd.hpp>
#include <hpx/runtime/parcelset/locality.hpp>
#include <hpx/runtime/serialization/serialize.hpp>
Expand Down
1 change: 1 addition & 0 deletions hpx/plugins/parcelport/tcp/receiver.hpp
Expand Up @@ -12,6 +12,7 @@
#ifndef HPX_PARCELSET_POLICIES_TCP_RECEIVER_HPP
#define HPX_PARCELSET_POLICIES_TCP_RECEIVER_HPP

#include <hpx/config/asio.hpp>
#include <hpx/util/high_resolution_timer.hpp>
#include <hpx/runtime/parcelset/parcelport_connection.hpp>
#include <hpx/runtime/parcelset/decode_parcels.hpp>
Expand Down
1 change: 1 addition & 0 deletions hpx/plugins/parcelport/tcp/sender.hpp
Expand Up @@ -9,6 +9,7 @@
#ifndef HPX_PARCELSET_POLICIES_TCP_SENDER_HPP
#define HPX_PARCELSET_POLICIES_TCP_SENDER_HPP

#include <hpx/config/asio.hpp>
#include <hpx/runtime/parcelset/locality.hpp>
#include <hpx/runtime/parcelset/parcelport_connection.hpp>
#include <hpx/performance_counters/parcels/data_point.hpp>
Expand Down

0 comments on commit f36c291

Please sign in to comment.