Skip to content

Commit

Permalink
Improve uses of HPX_NON_COPYABLE
Browse files Browse the repository at this point in the history
Make public for better error messages. Remove from examples and tests.
  • Loading branch information
K-ballo committed May 28, 2017
1 parent 0c67109 commit 32bac50
Show file tree
Hide file tree
Showing 68 changed files with 108 additions and 42 deletions.
4 changes: 2 additions & 2 deletions hpx/components/iostreams/ostream.hpp
Expand Up @@ -153,6 +153,8 @@ namespace hpx { namespace iostreams
, detail::buffer
, detail::ostream_creator<Char, Sink>::stream_type
{
HPX_NON_COPYABLE(ostream);

private:
typedef components::client_base<ostream, server::output_stream> base_type;

Expand All @@ -164,8 +166,6 @@ namespace hpx { namespace iostreams
typedef BOOST_IOSTREAMS_BASIC_OSTREAM(Char, stream_traits_type) std_stream_type;
typedef detail::buffer::mutex_type mutex_type;

HPX_NON_COPYABLE(ostream);

private:
using detail::buffer::mtx_;
boost::atomic<std::uint64_t> generational_count_;
Expand Down
1 change: 1 addition & 0 deletions hpx/components/performance_counters/papi/server/papi.hpp
Expand Up @@ -126,6 +126,7 @@ namespace hpx { namespace performance_counters { namespace papi { namespace serv
///////////////////////////////////////////////////////////////////////////
class papi_counter_base
{
public:
HPX_NON_COPYABLE(papi_counter_base);

public:
Expand Down
1 change: 1 addition & 0 deletions hpx/lcos/detail/async_implementations.hpp
Expand Up @@ -39,6 +39,7 @@ namespace hpx { namespace detail
template <typename Result>
class handle_managed_target
{
public:
HPX_NON_COPYABLE(handle_managed_target);

public:
Expand Down
4 changes: 4 additions & 0 deletions hpx/lcos/local/channel.hpp
Expand Up @@ -90,6 +90,7 @@ namespace hpx { namespace lcos { namespace local
{
typedef hpx::lcos::local::spinlock mutex_type;

public:
HPX_NON_COPYABLE(unlimited_channel);

public:
Expand Down Expand Up @@ -228,8 +229,10 @@ namespace hpx { namespace lcos { namespace local
template <typename T>
class one_element_queue_async
{
public:
HPX_NON_COPYABLE(one_element_queue_async);

private:
template <typename T1>
void set(T1 && val)
{
Expand Down Expand Up @@ -368,6 +371,7 @@ namespace hpx { namespace lcos { namespace local
{
typedef hpx::lcos::local::spinlock mutex_type;

public:
HPX_NON_COPYABLE(one_element_channel);

public:
Expand Down
1 change: 1 addition & 0 deletions hpx/lcos/local/detail/condition_variable.hpp
Expand Up @@ -25,6 +25,7 @@ namespace hpx { namespace lcos { namespace local { namespace detail
{
class condition_variable
{
public:
HPX_NON_COPYABLE(condition_variable);

private:
Expand Down
1 change: 1 addition & 0 deletions hpx/lcos/local/latch.hpp
Expand Up @@ -38,6 +38,7 @@ namespace hpx { namespace lcos { namespace local
/// synchronize a given number of \a threads.
class latch
{
public:
HPX_NON_COPYABLE(latch);

private:
Expand Down
2 changes: 2 additions & 0 deletions hpx/lcos/local/mutex.hpp
Expand Up @@ -19,6 +19,7 @@ namespace hpx { namespace lcos { namespace local
///////////////////////////////////////////////////////////////////////////
class mutex
{
public:
HPX_NON_COPYABLE(mutex);

protected:
Expand Down Expand Up @@ -54,6 +55,7 @@ namespace hpx { namespace lcos { namespace local
///////////////////////////////////////////////////////////////////////////
class timed_mutex : private mutex
{
public:
HPX_NON_COPYABLE(timed_mutex);

public:
Expand Down
2 changes: 1 addition & 1 deletion hpx/lcos/local/once.hpp
Expand Up @@ -22,7 +22,7 @@ namespace hpx { namespace lcos { namespace local
{
struct once_flag
{
private:
public:
HPX_NON_COPYABLE(once_flag);

public:
Expand Down
4 changes: 2 additions & 2 deletions hpx/lcos/local/receive_buffer.hpp
Expand Up @@ -35,7 +35,7 @@ namespace hpx { namespace lcos { namespace local

struct entry_data
{
private:
public:
HPX_NON_COPYABLE(entry_data);

public:
Expand Down Expand Up @@ -249,7 +249,7 @@ namespace hpx { namespace lcos { namespace local

struct entry_data
{
private:
public:
HPX_NON_COPYABLE(entry_data);

public:
Expand Down
1 change: 1 addition & 0 deletions hpx/lcos/local/recursive_mutex.hpp
Expand Up @@ -60,6 +60,7 @@ namespace hpx { namespace lcos { namespace local
template <typename Mutex = local::spinlock>
struct recursive_mutex_impl
{
public:
HPX_NON_COPYABLE(recursive_mutex_impl);

private:
Expand Down
1 change: 1 addition & 0 deletions hpx/lcos/local/reinitializable_static.hpp
Expand Up @@ -44,6 +44,7 @@ namespace hpx { namespace lcos { namespace local
template <typename T, typename Tag, std::size_t N>
struct HPX_EXPORT_REINITIALIZABLE_STATIC reinitializable_static
{
public:
HPX_NON_COPYABLE(reinitializable_static);

public:
Expand Down
2 changes: 1 addition & 1 deletion hpx/lcos/local/spinlock.hpp
Expand Up @@ -49,7 +49,7 @@ namespace hpx { namespace lcos { namespace local
/// boost::mutex-compatible spinlock class
struct spinlock
{
private:
public:
HPX_NON_COPYABLE(spinlock);

private:
Expand Down
2 changes: 1 addition & 1 deletion hpx/lcos/local/spinlock_no_backoff.hpp
Expand Up @@ -39,7 +39,7 @@ namespace hpx { namespace lcos { namespace local
/// boost::mutex-compatible spinlock class
struct spinlock_no_backoff
{
private:
public:
HPX_NON_COPYABLE(spinlock_no_backoff);

private:
Expand Down
1 change: 1 addition & 0 deletions hpx/lcos/local/spinlock_pool.hpp
Expand Up @@ -54,6 +54,7 @@ namespace hpx { namespace lcos { namespace local
private:
hpx::lcos::local::spinlock & sp_;

public:
HPX_NON_COPYABLE(scoped_lock);

public:
Expand Down
1 change: 1 addition & 0 deletions hpx/plugins/parcel/coalescing_counter_registry.hpp
Expand Up @@ -29,6 +29,7 @@ namespace hpx { namespace plugins { namespace parcel
{
typedef hpx::lcos::local::spinlock mutex_type;

public:
HPX_NON_COPYABLE(coalescing_counter_registry);

public:
Expand Down
6 changes: 4 additions & 2 deletions hpx/plugins/parcelport/mpi/mpi_environment.hpp
Expand Up @@ -43,18 +43,20 @@ namespace hpx { namespace util
struct scoped_lock
{
scoped_lock();
scoped_lock(scoped_lock const&) = delete;
scoped_lock& operator=(scoped_lock const&) = delete;
~scoped_lock();
void unlock();
HPX_NON_COPYABLE(scoped_lock);
};

struct scoped_try_lock
{
scoped_try_lock();
scoped_try_lock(scoped_try_lock const&) = delete;
scoped_try_lock& operator=(scoped_try_lock const&) = delete;
~scoped_try_lock();
void unlock();
bool locked;
HPX_NON_COPYABLE(scoped_try_lock);
};

typedef hpx::lcos::local::spinlock mutex_type;
Expand Down
3 changes: 3 additions & 0 deletions hpx/runtime/actions/detail/action_factory.hpp
Expand Up @@ -20,6 +20,7 @@ namespace hpx { namespace actions { namespace detail
{
struct action_registry
{
public:
HPX_NON_COPYABLE(action_registry);

public:
Expand Down Expand Up @@ -55,6 +56,7 @@ namespace hpx { namespace actions { namespace detail
template <typename Action>
struct register_action
{
public:
HPX_NON_COPYABLE(register_action);

public:
Expand Down Expand Up @@ -97,6 +99,7 @@ namespace hpx { namespace actions { namespace detail
template <std::uint32_t Id>
struct add_constant_entry
{
public:
HPX_NON_COPYABLE(add_constant_entry);

public:
Expand Down
1 change: 1 addition & 0 deletions hpx/runtime/actions/detail/invocation_count_registry.hpp
Expand Up @@ -25,6 +25,7 @@ namespace hpx { namespace actions { namespace detail
{
class HPX_EXPORT invocation_count_registry
{
public:
HPX_NON_COPYABLE(invocation_count_registry);

public:
Expand Down
1 change: 1 addition & 0 deletions hpx/runtime/actions/transfer_action.hpp
Expand Up @@ -31,6 +31,7 @@ namespace hpx { namespace actions
template <typename Action>
struct transfer_action : transfer_base_action<Action>
{
public:
HPX_NON_COPYABLE(transfer_action);

typedef transfer_base_action<Action> base_type;
Expand Down
1 change: 1 addition & 0 deletions hpx/runtime/actions/transfer_base_action.hpp
Expand Up @@ -40,6 +40,7 @@ namespace hpx { namespace actions
template <typename Action>
struct transfer_base_action : base_action
{
public:
HPX_NON_COPYABLE(transfer_base_action);

public:
Expand Down
1 change: 1 addition & 0 deletions hpx/runtime/actions/transfer_continuation_action.hpp
Expand Up @@ -32,6 +32,7 @@ namespace hpx { namespace actions
template <typename Action>
struct transfer_continuation_action : transfer_base_action<Action>
{
public:
HPX_NON_COPYABLE(transfer_continuation_action);

typedef transfer_base_action<Action> base_type;
Expand Down
2 changes: 1 addition & 1 deletion hpx/runtime/agas/addressing_service.hpp
Expand Up @@ -54,7 +54,7 @@ HPX_EXPORT void destroy_big_boot_barrier();

struct HPX_EXPORT addressing_service
{
private:
public:
HPX_NON_COPYABLE(addressing_service);

public:
Expand Down
2 changes: 1 addition & 1 deletion hpx/runtime/agas/big_boot_barrier.hpp
Expand Up @@ -40,7 +40,7 @@ struct notification_header;

struct HPX_EXPORT big_boot_barrier
{
private:
public:
HPX_NON_COPYABLE(big_boot_barrier);

private:
Expand Down
2 changes: 1 addition & 1 deletion hpx/runtime/agas/server/component_namespace.hpp
Expand Up @@ -70,7 +70,7 @@ struct HPX_EXPORT component_namespace
// data structure holding all counters for the omponent_namespace component
struct counter_data
{
private:
public:
HPX_NON_COPYABLE(counter_data);

public:
Expand Down
2 changes: 1 addition & 1 deletion hpx/runtime/agas/server/locality_namespace.hpp
Expand Up @@ -73,7 +73,7 @@ struct HPX_EXPORT locality_namespace
// data structure holding all counters for the omponent_namespace component
struct counter_data
{
private:
public:
HPX_NON_COPYABLE(counter_data);

public:
Expand Down
2 changes: 1 addition & 1 deletion hpx/runtime/agas/server/primary_namespace.hpp
Expand Up @@ -154,7 +154,7 @@ struct HPX_EXPORT primary_namespace
// data structure holding all counters for the omponent_namespace component
struct counter_data
{
private:
public:
HPX_NON_COPYABLE(counter_data);

public:
Expand Down
2 changes: 1 addition & 1 deletion hpx/runtime/agas/server/symbol_namespace.hpp
Expand Up @@ -67,7 +67,7 @@ struct HPX_EXPORT symbol_namespace
// data structure holding all counters for the omponent_namespace component
struct counter_data
{
private:
public:
HPX_NON_COPYABLE(counter_data);

public:
Expand Down
1 change: 1 addition & 0 deletions hpx/runtime/applier/applier.hpp
Expand Up @@ -34,6 +34,7 @@ namespace hpx { namespace applier
/// remote a parcel will be sent.
class HPX_EXPORT applier
{
public:
HPX_NON_COPYABLE(applier);

public:
Expand Down
2 changes: 2 additions & 0 deletions hpx/runtime/components/pinned_ptr.hpp
Expand Up @@ -21,6 +21,7 @@ namespace hpx { namespace components
{
class pinned_ptr_base
{
public:
HPX_NON_COPYABLE(pinned_ptr_base);

public:
Expand All @@ -41,6 +42,7 @@ namespace hpx { namespace components
template <typename Component>
class pinned_ptr : public pinned_ptr_base
{
public:
HPX_NON_COPYABLE(pinned_ptr);

public:
Expand Down
Expand Up @@ -21,6 +21,7 @@ namespace hpx { namespace components { namespace server
///////////////////////////////////////////////////////////////////////////
class console_error_dispatcher
{
public:
HPX_NON_COPYABLE(console_error_dispatcher);

public:
Expand Down
2 changes: 2 additions & 0 deletions hpx/runtime/components/server/managed_component_base.hpp
Expand Up @@ -161,6 +161,7 @@ namespace hpx { namespace components
class managed_component_base
: public traits::detail::managed_component_tag
{
public:
HPX_NON_COPYABLE(managed_component_base);

private:
Expand Down Expand Up @@ -351,6 +352,7 @@ namespace hpx { namespace components
template <typename Component, typename Derived>
class managed_component
{
public:
HPX_NON_COPYABLE(managed_component);

public:
Expand Down
1 change: 1 addition & 0 deletions hpx/runtime/components/server/memory_block.hpp
Expand Up @@ -446,6 +446,7 @@ namespace hpx { namespace components { namespace server
///
class memory_block
{
public:
HPX_NON_COPYABLE(memory_block);

public:
Expand Down
1 change: 1 addition & 0 deletions hpx/runtime/components/server/wrapper_heap.hpp
Expand Up @@ -66,6 +66,7 @@ namespace hpx { namespace components { namespace detail
template<typename T, typename Allocator, typename Mutex = hpx::lcos::local::spinlock>
class wrapper_heap
{
public:
HPX_NON_COPYABLE(wrapper_heap);

public:
Expand Down
1 change: 1 addition & 0 deletions hpx/runtime/naming/name.hpp
Expand Up @@ -695,6 +695,7 @@ namespace hpx { namespace naming
///////////////////////////////////////////////////////////////////////
struct HPX_EXPORT id_type_impl : gid_type
{
public:
HPX_NON_COPYABLE(id_type_impl);

private:
Expand Down
Expand Up @@ -30,6 +30,7 @@ namespace hpx { namespace parcelset { namespace detail
{
class HPX_EXPORT per_action_data_counter_registry
{
public:
HPX_NON_COPYABLE(per_action_data_counter_registry);

public:
Expand Down
1 change: 1 addition & 0 deletions hpx/runtime/parcelset/parcelhandler.hpp
Expand Up @@ -50,6 +50,7 @@ namespace hpx { namespace parcelset
/// parcel-handlers may be connected to a single parcelport.
class HPX_EXPORT parcelhandler
{
public:
HPX_NON_COPYABLE(parcelhandler);

private:
Expand Down
1 change: 1 addition & 0 deletions hpx/runtime/parcelset/parcelport.hpp
Expand Up @@ -57,6 +57,7 @@ namespace hpx { namespace parcelset
class HPX_EXPORT parcelport
: public std::enable_shared_from_this<parcelport>
{
public:
HPX_NON_COPYABLE(parcelport);

private:
Expand Down

0 comments on commit 32bac50

Please sign in to comment.