Commit e07934c8 authored by Dominik Charousset's avatar Dominik Charousset

Deprecate obsolete classes and functions

parent 6129cc74
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "caf/abstract_channel.hpp" #include "caf/abstract_channel.hpp"
#include "caf/attachable.hpp" #include "caf/attachable.hpp"
#include "caf/detail/core_export.hpp" #include "caf/detail/core_export.hpp"
#include "caf/detail/disposer.hpp"
#include "caf/detail/functor_attachable.hpp" #include "caf/detail/functor_attachable.hpp"
#include "caf/detail/type_traits.hpp" #include "caf/detail/type_traits.hpp"
#include "caf/execution_unit.hpp" #include "caf/execution_unit.hpp"
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <memory> #include <memory>
#include "caf/detail/core_export.hpp" #include "caf/detail/core_export.hpp"
#include "caf/detail/disposer.hpp"
#include "caf/detail/shared_spinlock.hpp" #include "caf/detail/shared_spinlock.hpp"
#include "caf/extend.hpp" #include "caf/extend.hpp"
#include "caf/fwd.hpp" #include "caf/fwd.hpp"
......
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
#include <type_traits>
#include "caf/memory_managed.hpp"
namespace caf::detail {
class disposer {
public:
void operator()(memory_managed* ptr) const noexcept {
ptr->request_deletion(false);
}
template <class T>
typename std::enable_if<!std::is_base_of<memory_managed, T>::value>::type
operator()(T* ptr) const noexcept {
delete ptr;
}
};
} // namespace caf::detail
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
#include "caf/intrusive_ptr.hpp"
#include "caf/ref_counted.hpp"
namespace caf::detail {
template <class Base>
class embedded final : public Base {
public:
template <class... Ts>
embedded(intrusive_ptr<ref_counted> storage, Ts&&... xs)
: Base(std::forward<Ts>(xs)...), storage_(std::move(storage)) {
// nop
}
~embedded() {
// nop
}
void request_deletion(bool) noexcept override {
intrusive_ptr<ref_counted> guard;
guard.swap(storage_);
// this code assumes that embedded is part of pair_storage<>,
// i.e., this object lives inside a union!
this->~embedded();
}
protected:
intrusive_ptr<ref_counted> storage_;
};
} // namespace caf::detail
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "caf/detail/token_based_credit_controller.hpp" #include "caf/detail/token_based_credit_controller.hpp"
#include "caf/downstream_msg.hpp" #include "caf/downstream_msg.hpp"
#include "caf/logger.hpp" #include "caf/logger.hpp"
#include "caf/meta/type_name.hpp"
#include "caf/settings.hpp" #include "caf/settings.hpp"
#include "caf/stream_aborter.hpp" #include "caf/stream_aborter.hpp"
#include "caf/stream_priority.hpp" #include "caf/stream_priority.hpp"
...@@ -180,9 +179,12 @@ private: ...@@ -180,9 +179,12 @@ private:
/// @relates inbound_path /// @relates inbound_path
template <class Inspector> template <class Inspector>
typename Inspector::return_type inspect(Inspector& f, inbound_path& x) { bool inspect(Inspector& f, inbound_path& x) {
return f(meta::type_name("inbound_path"), x.hdl, x.slots, x.prio, return f.object(x).fields(
x.last_acked_batch_id, x.last_batch_id, x.assigned_credit); f.field("hdl", x.hdl), f.field("slots", x.slots), f.field("prio", x.prio),
f.field("last_acked_batch_id", x.last_acked_batch_id),
f.field("last_batch_id", x.last_batch_id),
f.field("assigned_credit", x.assigned_credit));
} }
} // namespace caf } // namespace caf
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include <type_traits> #include <type_traits>
#include "caf/fwd.hpp" #include "caf/fwd.hpp"
#include "caf/meta/type_name.hpp"
namespace caf::intrusive { namespace caf::intrusive {
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "caf/detail/comparable.hpp" #include "caf/detail/comparable.hpp"
#include "caf/detail/core_export.hpp" #include "caf/detail/core_export.hpp"
#include "caf/ipv4_address.hpp" #include "caf/ipv4_address.hpp"
#include "caf/meta/type_name.hpp"
namespace caf { namespace caf {
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "caf/detail/core_export.hpp" #include "caf/detail/core_export.hpp"
#include "caf/fwd.hpp" #include "caf/fwd.hpp"
#include "caf/ipv6_address.hpp" #include "caf/ipv6_address.hpp"
#include "caf/meta/type_name.hpp"
namespace caf { namespace caf {
......
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
#include "caf/intrusive/singly_linked.hpp" #include "caf/intrusive/singly_linked.hpp"
#include "caf/message.hpp" #include "caf/message.hpp"
#include "caf/message_id.hpp" #include "caf/message_id.hpp"
#include "caf/meta/omittable_if_empty.hpp"
#include "caf/meta/type_name.hpp"
#include "caf/tracing_data.hpp" #include "caf/tracing_data.hpp"
namespace caf { namespace caf {
......
...@@ -8,18 +8,8 @@ ...@@ -8,18 +8,8 @@
namespace caf { namespace caf {
/// This base enables derived classes to enforce a different class CAF_CORE_EXPORT [[deprecated]] memory_managed {
/// allocation strategy than new/delete by providing a virtual
/// protected `request_deletion()` function and non-public destructor.
class CAF_CORE_EXPORT memory_managed {
public: public:
/// Default implementations calls `delete this, but can
/// be overridden in case deletion depends on some condition or
/// the class doesn't use default new/delete.
/// @param decremented_rc Indicates whether the caller did reduce the
/// reference of this object before calling this member
/// function. This information is important when
/// implementing a type with support for weak pointers.
virtual void request_deletion(bool decremented_rc) const noexcept; virtual void request_deletion(bool decremented_rc) const noexcept;
protected: protected:
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "caf/error.hpp" #include "caf/error.hpp"
#include "caf/inspector_access.hpp" #include "caf/inspector_access.hpp"
#include "caf/message_priority.hpp" #include "caf/message_priority.hpp"
#include "caf/meta/type_name.hpp"
namespace caf { namespace caf {
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
namespace caf::meta { namespace caf::meta {
/// Type tag for all meta annotations in CAF.
struct annotation { struct annotation {
constexpr annotation() { constexpr annotation() {
// nop // nop
...@@ -30,6 +29,6 @@ template <class T> ...@@ -30,6 +29,6 @@ template <class T>
struct is_annotation<T&&> : is_annotation<T> {}; struct is_annotation<T&&> : is_annotation<T> {};
template <class T> template <class T>
constexpr bool is_annotation_v = is_annotation<T>::value; [[deprecated]] constexpr bool is_annotation_v = is_annotation<T>::value;
} // namespace caf::meta } // namespace caf::meta
...@@ -14,8 +14,7 @@ struct hex_formatted_t : annotation { ...@@ -14,8 +14,7 @@ struct hex_formatted_t : annotation {
} }
}; };
/// Advises the inspector to format the following data field in hex format. [[deprecated]] constexpr hex_formatted_t hex_formatted() {
constexpr hex_formatted_t hex_formatted() {
return {}; return {};
} }
......
...@@ -33,10 +33,8 @@ struct is_load_callback<load_callback_t<F>> : std::true_type {}; ...@@ -33,10 +33,8 @@ struct is_load_callback<load_callback_t<F>> : std::true_type {};
template <class F> template <class F>
constexpr bool is_load_callback_v = is_load_callback<F>::value; constexpr bool is_load_callback_v = is_load_callback<F>::value;
/// Returns an annotation that allows inspectors to call
/// user-defined code after performing load operations.
template <class F> template <class F>
load_callback_t<F> load_callback(F fun) { [[deprecated]] load_callback_t<F> load_callback(F fun) {
return {std::move(fun)}; return {std::move(fun)};
} }
......
...@@ -14,9 +14,7 @@ struct omittable_t : annotation { ...@@ -14,9 +14,7 @@ struct omittable_t : annotation {
} }
}; };
/// Allows an inspector to omit the following data field [[deprecated]] constexpr omittable_t omittable() {
/// unconditionally when producing human-friendly output.
constexpr omittable_t omittable() {
return {}; return {};
} }
......
...@@ -14,8 +14,7 @@ struct omittable_if_empty_t : annotation { ...@@ -14,8 +14,7 @@ struct omittable_if_empty_t : annotation {
} }
}; };
/// Allows an inspector to omit the following data field if it is empty. [[deprecated]] constexpr omittable_if_empty_t omittable_if_empty() {
constexpr omittable_if_empty_t omittable_if_empty() {
return {}; return {};
} }
......
...@@ -14,8 +14,7 @@ struct omittable_if_none_t : annotation { ...@@ -14,8 +14,7 @@ struct omittable_if_none_t : annotation {
} }
}; };
/// Allows an inspector to omit the following data field if it is empty. [[deprecated]] constexpr omittable_if_none_t omittable_if_none() {
constexpr omittable_if_none_t omittable_if_none() {
return {}; return {};
} }
......
...@@ -32,10 +32,8 @@ struct is_save_callback<save_callback_t<F>> : std::true_type {}; ...@@ -32,10 +32,8 @@ struct is_save_callback<save_callback_t<F>> : std::true_type {};
template <class F> template <class F>
constexpr bool is_save_callback_v = is_save_callback<F>::value; constexpr bool is_save_callback_v = is_save_callback<F>::value;
/// Returns an annotation that allows inspectors to call
/// user-defined code after performing save operations.
template <class F> template <class F>
save_callback_t<F> save_callback(F fun) { [[deprecated]] save_callback_t<F> save_callback(F fun) {
return {std::move(fun)}; return {std::move(fun)};
} }
......
...@@ -16,8 +16,7 @@ struct type_name_t : annotation { ...@@ -16,8 +16,7 @@ struct type_name_t : annotation {
const char* value; const char* value;
}; };
/// Returns a type name annotation. [[deprecated]] type_name_t constexpr type_name(const char* cstr) {
type_name_t constexpr type_name(const char* cstr) {
return {cstr}; return {cstr};
} }
} // namespace caf::meta } // namespace caf::meta
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "caf/downstream_msg.hpp" #include "caf/downstream_msg.hpp"
#include "caf/fwd.hpp" #include "caf/fwd.hpp"
#include "caf/logger.hpp" #include "caf/logger.hpp"
#include "caf/meta/type_name.hpp"
#include "caf/stream_aborter.hpp" #include "caf/stream_aborter.hpp"
#include "caf/stream_slot.hpp" #include "caf/stream_slot.hpp"
#include "caf/system_messages.hpp" #include "caf/system_messages.hpp"
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <cstddef> #include <cstddef>
#include "caf/detail/core_export.hpp" #include "caf/detail/core_export.hpp"
#include "caf/memory_managed.hpp"
namespace caf { namespace caf {
...@@ -16,9 +15,9 @@ namespace caf { ...@@ -16,9 +15,9 @@ namespace caf {
/// Serves the requirements of {@link intrusive_ptr}. /// Serves the requirements of {@link intrusive_ptr}.
/// @note *All* instances of `ref_counted` start with a reference count of 1. /// @note *All* instances of `ref_counted` start with a reference count of 1.
/// @relates intrusive_ptr /// @relates intrusive_ptr
class CAF_CORE_EXPORT ref_counted : public memory_managed { class CAF_CORE_EXPORT ref_counted {
public: public:
~ref_counted() override; virtual ~ref_counted();
ref_counted(); ref_counted();
ref_counted(const ref_counted&); ref_counted(const ref_counted&);
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
#include "caf/detail/core_export.hpp" #include "caf/detail/core_export.hpp"
#include "caf/detail/squashed_int.hpp" #include "caf/detail/squashed_int.hpp"
#include "caf/fwd.hpp" #include "caf/fwd.hpp"
#include "caf/meta/annotation.hpp"
#include "caf/meta/save_callback.hpp"
#include "caf/save_inspector_base.hpp" #include "caf/save_inspector_base.hpp"
#include "caf/sec.hpp" #include "caf/sec.hpp"
#include "caf/span.hpp" #include "caf/span.hpp"
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#pragma once #pragma once
#include "caf/fwd.hpp" #include "caf/fwd.hpp"
#include "caf/meta/type_name.hpp"
#include "caf/type_id.hpp" #include "caf/type_id.hpp"
namespace caf { namespace caf {
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "caf/deep_to_string.hpp" #include "caf/deep_to_string.hpp"
#include "caf/fwd.hpp" #include "caf/fwd.hpp"
#include "caf/group.hpp" #include "caf/group.hpp"
#include "caf/meta/type_name.hpp"
#include "caf/stream_slot.hpp" #include "caf/stream_slot.hpp"
namespace caf { namespace caf {
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "caf/detail/pp.hpp" #include "caf/detail/pp.hpp"
#include "caf/detail/squashed_int.hpp" #include "caf/detail/squashed_int.hpp"
#include "caf/fwd.hpp" #include "caf/fwd.hpp"
#include "caf/meta/type_name.hpp"
#include "caf/string_view.hpp" #include "caf/string_view.hpp"
#include "caf/timespan.hpp" #include "caf/timespan.hpp"
#include "caf/timestamp.hpp" #include "caf/timestamp.hpp"
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include "caf/actor_system.hpp" #include "caf/actor_system.hpp"
#include "caf/config.hpp" #include "caf/config.hpp"
#include "caf/default_attachable.hpp" #include "caf/default_attachable.hpp"
#include "caf/detail/disposer.hpp"
#include "caf/detail/shared_spinlock.hpp" #include "caf/detail/shared_spinlock.hpp"
#include "caf/execution_unit.hpp" #include "caf/execution_unit.hpp"
#include "caf/logger.hpp" #include "caf/logger.hpp"
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "caf/abstract_actor.hpp" #include "caf/abstract_actor.hpp"
#include "caf/actor_system.hpp" #include "caf/actor_system.hpp"
#include "caf/detail/disposer.hpp"
#include "caf/mailbox_element.hpp" #include "caf/mailbox_element.hpp"
#include "caf/message.hpp" #include "caf/message.hpp"
#include "caf/proxy_registry.hpp" #include "caf/proxy_registry.hpp"
......
...@@ -6,8 +6,6 @@ ...@@ -6,8 +6,6 @@
#include "caf/actor_system.hpp" #include "caf/actor_system.hpp"
#include "caf/default_attachable.hpp" #include "caf/default_attachable.hpp"
#include "caf/detail/disposer.hpp"
#include "caf/detail/sync_request_bouncer.hpp" #include "caf/detail/sync_request_bouncer.hpp"
namespace caf::decorator { namespace caf::decorator {
......
...@@ -24,13 +24,8 @@ ref_counted& ref_counted::operator=(const ref_counted&) { ...@@ -24,13 +24,8 @@ ref_counted& ref_counted::operator=(const ref_counted&) {
} }
void ref_counted::deref() const noexcept { void ref_counted::deref() const noexcept {
if (unique()) { if (unique() || rc_.fetch_sub(1, std::memory_order_acq_rel) == 1)
request_deletion(false); delete this;
return;
}
if (rc_.fetch_sub(1, std::memory_order_acq_rel) == 1) {
request_deletion(true);
}
} }
} // namespace caf } // namespace caf
...@@ -7,11 +7,8 @@ ...@@ -7,11 +7,8 @@
#include <functional> #include <functional>
#include "caf/error.hpp" #include "caf/error.hpp"
#include "caf/io/handle.hpp" #include "caf/io/handle.hpp"
#include "caf/meta/type_name.hpp"
namespace caf::io { namespace caf::io {
struct invalid_accept_handle_t { struct invalid_accept_handle_t {
......
...@@ -10,8 +10,6 @@ ...@@ -10,8 +10,6 @@
#include "caf/detail/io_export.hpp" #include "caf/detail/io_export.hpp"
#include "caf/error.hpp" #include "caf/error.hpp"
#include "caf/io/basp/message_type.hpp" #include "caf/io/basp/message_type.hpp"
#include "caf/meta/omittable.hpp"
#include "caf/meta/type_name.hpp"
#include "caf/node_id.hpp" #include "caf/node_id.hpp"
namespace caf::io::basp { namespace caf::io::basp {
......
...@@ -7,11 +7,8 @@ ...@@ -7,11 +7,8 @@
#include <functional> #include <functional>
#include "caf/error.hpp" #include "caf/error.hpp"
#include "caf/io/handle.hpp" #include "caf/io/handle.hpp"
#include "caf/meta/type_name.hpp"
namespace caf::io { namespace caf::io {
struct invalid_connection_handle_t { struct invalid_connection_handle_t {
......
...@@ -7,11 +7,8 @@ ...@@ -7,11 +7,8 @@
#include <functional> #include <functional>
#include "caf/error.hpp" #include "caf/error.hpp"
#include "caf/io/handle.hpp" #include "caf/io/handle.hpp"
#include "caf/meta/type_name.hpp"
namespace caf::io { namespace caf::io {
struct invalid_datagram_handle_t { struct invalid_datagram_handle_t {
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <string> #include <string>
#include "caf/detail/io_export.hpp" #include "caf/detail/io_export.hpp"
#include "caf/meta/type_name.hpp"
namespace caf::io::network { namespace caf::io::network {
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
#include "caf/io/datagram_handle.hpp" #include "caf/io/datagram_handle.hpp"
#include "caf/io/handle.hpp" #include "caf/io/handle.hpp"
#include "caf/io/network/receive_buffer.hpp" #include "caf/io/network/receive_buffer.hpp"
#include "caf/meta/hex_formatted.hpp"
#include "caf/meta/type_name.hpp"
namespace caf::io { namespace caf::io {
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "caf/config.hpp" #include "caf/config.hpp"
#include "caf/detail/gcd.hpp" #include "caf/detail/gcd.hpp"
#include "caf/init_global_meta_objects.hpp" #include "caf/init_global_meta_objects.hpp"
#include "caf/meta/annotation.hpp"
#include "caf/test/unit_test.hpp" #include "caf/test/unit_test.hpp"
CAF_PUSH_WARNINGS CAF_PUSH_WARNINGS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment