Commit e07934c8 authored by Dominik Charousset's avatar Dominik Charousset

Deprecate obsolete classes and functions

parent 6129cc74
......@@ -16,7 +16,6 @@
#include "caf/abstract_channel.hpp"
#include "caf/attachable.hpp"
#include "caf/detail/core_export.hpp"
#include "caf/detail/disposer.hpp"
#include "caf/detail/functor_attachable.hpp"
#include "caf/detail/type_traits.hpp"
#include "caf/execution_unit.hpp"
......
......@@ -8,7 +8,6 @@
#include <memory>
#include "caf/detail/core_export.hpp"
#include "caf/detail/disposer.hpp"
#include "caf/detail/shared_spinlock.hpp"
#include "caf/extend.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 @@
#include "caf/detail/token_based_credit_controller.hpp"
#include "caf/downstream_msg.hpp"
#include "caf/logger.hpp"
#include "caf/meta/type_name.hpp"
#include "caf/settings.hpp"
#include "caf/stream_aborter.hpp"
#include "caf/stream_priority.hpp"
......@@ -180,9 +179,12 @@ private:
/// @relates inbound_path
template <class Inspector>
typename Inspector::return_type inspect(Inspector& f, inbound_path& x) {
return f(meta::type_name("inbound_path"), x.hdl, x.slots, x.prio,
x.last_acked_batch_id, x.last_batch_id, x.assigned_credit);
bool inspect(Inspector& f, inbound_path& x) {
return f.object(x).fields(
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
......@@ -7,7 +7,6 @@
#include <type_traits>
#include "caf/fwd.hpp"
#include "caf/meta/type_name.hpp"
namespace caf::intrusive {
......
......@@ -10,7 +10,6 @@
#include "caf/detail/comparable.hpp"
#include "caf/detail/core_export.hpp"
#include "caf/ipv4_address.hpp"
#include "caf/meta/type_name.hpp"
namespace caf {
......
......@@ -11,7 +11,6 @@
#include "caf/detail/core_export.hpp"
#include "caf/fwd.hpp"
#include "caf/ipv6_address.hpp"
#include "caf/meta/type_name.hpp"
namespace caf {
......
......@@ -13,8 +13,6 @@
#include "caf/intrusive/singly_linked.hpp"
#include "caf/message.hpp"
#include "caf/message_id.hpp"
#include "caf/meta/omittable_if_empty.hpp"
#include "caf/meta/type_name.hpp"
#include "caf/tracing_data.hpp"
namespace caf {
......
......@@ -8,18 +8,8 @@
namespace caf {
/// This base enables derived classes to enforce a different
/// allocation strategy than new/delete by providing a virtual
/// protected `request_deletion()` function and non-public destructor.
class CAF_CORE_EXPORT memory_managed {
class CAF_CORE_EXPORT [[deprecated]] memory_managed {
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;
protected:
......
......@@ -14,7 +14,6 @@
#include "caf/error.hpp"
#include "caf/inspector_access.hpp"
#include "caf/message_priority.hpp"
#include "caf/meta/type_name.hpp"
namespace caf {
......
......@@ -8,7 +8,6 @@
namespace caf::meta {
/// Type tag for all meta annotations in CAF.
struct annotation {
constexpr annotation() {
// nop
......@@ -30,6 +29,6 @@ template <class T>
struct is_annotation<T&&> : is_annotation<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
......@@ -14,8 +14,7 @@ struct hex_formatted_t : annotation {
}
};
/// Advises the inspector to format the following data field in hex format.
constexpr hex_formatted_t hex_formatted() {
[[deprecated]] constexpr hex_formatted_t hex_formatted() {
return {};
}
......
......@@ -33,10 +33,8 @@ struct is_load_callback<load_callback_t<F>> : std::true_type {};
template <class F>
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>
load_callback_t<F> load_callback(F fun) {
[[deprecated]] load_callback_t<F> load_callback(F fun) {
return {std::move(fun)};
}
......
......@@ -14,9 +14,7 @@ struct omittable_t : annotation {
}
};
/// Allows an inspector to omit the following data field
/// unconditionally when producing human-friendly output.
constexpr omittable_t omittable() {
[[deprecated]] constexpr omittable_t omittable() {
return {};
}
......
......@@ -14,8 +14,7 @@ struct omittable_if_empty_t : annotation {
}
};
/// Allows an inspector to omit the following data field if it is empty.
constexpr omittable_if_empty_t omittable_if_empty() {
[[deprecated]] constexpr omittable_if_empty_t omittable_if_empty() {
return {};
}
......
......@@ -14,8 +14,7 @@ struct omittable_if_none_t : annotation {
}
};
/// Allows an inspector to omit the following data field if it is empty.
constexpr omittable_if_none_t omittable_if_none() {
[[deprecated]] constexpr omittable_if_none_t omittable_if_none() {
return {};
}
......
......@@ -32,10 +32,8 @@ struct is_save_callback<save_callback_t<F>> : std::true_type {};
template <class F>
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>
save_callback_t<F> save_callback(F fun) {
[[deprecated]] save_callback_t<F> save_callback(F fun) {
return {std::move(fun)};
}
......
......@@ -16,8 +16,7 @@ struct type_name_t : annotation {
const char* value;
};
/// Returns a type name annotation.
type_name_t constexpr type_name(const char* cstr) {
[[deprecated]] type_name_t constexpr type_name(const char* cstr) {
return {cstr};
}
} // namespace caf::meta
......@@ -15,7 +15,6 @@
#include "caf/downstream_msg.hpp"
#include "caf/fwd.hpp"
#include "caf/logger.hpp"
#include "caf/meta/type_name.hpp"
#include "caf/stream_aborter.hpp"
#include "caf/stream_slot.hpp"
#include "caf/system_messages.hpp"
......
......@@ -8,7 +8,6 @@
#include <cstddef>
#include "caf/detail/core_export.hpp"
#include "caf/memory_managed.hpp"
namespace caf {
......@@ -16,9 +15,9 @@ namespace caf {
/// Serves the requirements of {@link intrusive_ptr}.
/// @note *All* instances of `ref_counted` start with a reference count of 1.
/// @relates intrusive_ptr
class CAF_CORE_EXPORT ref_counted : public memory_managed {
class CAF_CORE_EXPORT ref_counted {
public:
~ref_counted() override;
virtual ~ref_counted();
ref_counted();
ref_counted(const ref_counted&);
......
......@@ -15,8 +15,6 @@
#include "caf/detail/core_export.hpp"
#include "caf/detail/squashed_int.hpp"
#include "caf/fwd.hpp"
#include "caf/meta/annotation.hpp"
#include "caf/meta/save_callback.hpp"
#include "caf/save_inspector_base.hpp"
#include "caf/sec.hpp"
#include "caf/span.hpp"
......
......@@ -5,7 +5,6 @@
#pragma once
#include "caf/fwd.hpp"
#include "caf/meta/type_name.hpp"
#include "caf/type_id.hpp"
namespace caf {
......
......@@ -12,7 +12,6 @@
#include "caf/deep_to_string.hpp"
#include "caf/fwd.hpp"
#include "caf/group.hpp"
#include "caf/meta/type_name.hpp"
#include "caf/stream_slot.hpp"
namespace caf {
......
......@@ -14,7 +14,6 @@
#include "caf/detail/pp.hpp"
#include "caf/detail/squashed_int.hpp"
#include "caf/fwd.hpp"
#include "caf/meta/type_name.hpp"
#include "caf/string_view.hpp"
#include "caf/timespan.hpp"
#include "caf/timestamp.hpp"
......
......@@ -17,7 +17,6 @@
#include "caf/actor_system.hpp"
#include "caf/config.hpp"
#include "caf/default_attachable.hpp"
#include "caf/detail/disposer.hpp"
#include "caf/detail/shared_spinlock.hpp"
#include "caf/execution_unit.hpp"
#include "caf/logger.hpp"
......
......@@ -6,7 +6,6 @@
#include "caf/abstract_actor.hpp"
#include "caf/actor_system.hpp"
#include "caf/detail/disposer.hpp"
#include "caf/mailbox_element.hpp"
#include "caf/message.hpp"
#include "caf/proxy_registry.hpp"
......
......@@ -6,8 +6,6 @@
#include "caf/actor_system.hpp"
#include "caf/default_attachable.hpp"
#include "caf/detail/disposer.hpp"
#include "caf/detail/sync_request_bouncer.hpp"
namespace caf::decorator {
......
......@@ -24,13 +24,8 @@ ref_counted& ref_counted::operator=(const ref_counted&) {
}
void ref_counted::deref() const noexcept {
if (unique()) {
request_deletion(false);
return;
}
if (rc_.fetch_sub(1, std::memory_order_acq_rel) == 1) {
request_deletion(true);
}
if (unique() || rc_.fetch_sub(1, std::memory_order_acq_rel) == 1)
delete this;
}
} // namespace caf
......@@ -7,11 +7,8 @@
#include <functional>
#include "caf/error.hpp"
#include "caf/io/handle.hpp"
#include "caf/meta/type_name.hpp"
namespace caf::io {
struct invalid_accept_handle_t {
......
......@@ -10,8 +10,6 @@
#include "caf/detail/io_export.hpp"
#include "caf/error.hpp"
#include "caf/io/basp/message_type.hpp"
#include "caf/meta/omittable.hpp"
#include "caf/meta/type_name.hpp"
#include "caf/node_id.hpp"
namespace caf::io::basp {
......
......@@ -7,11 +7,8 @@
#include <functional>
#include "caf/error.hpp"
#include "caf/io/handle.hpp"
#include "caf/meta/type_name.hpp"
namespace caf::io {
struct invalid_connection_handle_t {
......
......@@ -7,11 +7,8 @@
#include <functional>
#include "caf/error.hpp"
#include "caf/io/handle.hpp"
#include "caf/meta/type_name.hpp"
namespace caf::io {
struct invalid_datagram_handle_t {
......
......@@ -8,7 +8,6 @@
#include <string>
#include "caf/detail/io_export.hpp"
#include "caf/meta/type_name.hpp"
namespace caf::io::network {
......
......@@ -15,8 +15,6 @@
#include "caf/io/datagram_handle.hpp"
#include "caf/io/handle.hpp"
#include "caf/io/network/receive_buffer.hpp"
#include "caf/meta/hex_formatted.hpp"
#include "caf/meta/type_name.hpp"
namespace caf::io {
......
......@@ -12,7 +12,6 @@
#include "caf/config.hpp"
#include "caf/detail/gcd.hpp"
#include "caf/init_global_meta_objects.hpp"
#include "caf/meta/annotation.hpp"
#include "caf/test/unit_test.hpp"
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