Commit 0541cbae authored by Dominik Charousset's avatar Dominik Charousset

Remove all deprecated functionality

parent 035bfe0a
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include "caf/actor_marker.hpp" #include "caf/actor_marker.hpp"
#include "caf/abstract_actor.hpp" #include "caf/abstract_actor.hpp"
#include "caf/actor_control_block.hpp" #include "caf/actor_control_block.hpp"
#include "caf/unsafe_actor_handle_init.hpp"
#include "caf/detail/comparable.hpp" #include "caf/detail/comparable.hpp"
#include "caf/detail/type_traits.hpp" #include "caf/detail/type_traits.hpp"
...@@ -82,8 +81,6 @@ public: ...@@ -82,8 +81,6 @@ public:
actor(const scoped_actor&); actor(const scoped_actor&);
explicit actor(const unsafe_actor_handle_init_t&) CAF_DEPRECATED;
template <class T, template <class T,
class = typename std::enable_if< class = typename std::enable_if<
std::is_base_of<dynamically_typed_actor_base, T>::value std::is_base_of<dynamically_typed_actor_base, T>::value
...@@ -143,12 +140,6 @@ public: ...@@ -143,12 +140,6 @@ public:
/// Exchange content of `*this` and `other`. /// Exchange content of `*this` and `other`.
void swap(actor& other) noexcept; void swap(actor& other) noexcept;
/// Queries whether this object was constructed using
/// `unsafe_actor_handle_init` or is in moved-from state.
bool unsafe() const CAF_DEPRECATED {
return !ptr_;
}
/// @cond PRIVATE /// @cond PRIVATE
inline abstract_actor* operator->() const noexcept { inline abstract_actor* operator->() const noexcept {
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include "caf/fwd.hpp" #include "caf/fwd.hpp"
#include "caf/abstract_actor.hpp" #include "caf/abstract_actor.hpp"
#include "caf/actor_control_block.hpp" #include "caf/actor_control_block.hpp"
#include "caf/unsafe_actor_handle_init.hpp"
#include "caf/detail/comparable.hpp" #include "caf/detail/comparable.hpp"
...@@ -57,7 +56,6 @@ public: ...@@ -57,7 +56,6 @@ public:
actor_addr& operator=(const actor_addr&) = default; actor_addr& operator=(const actor_addr&) = default;
actor_addr(std::nullptr_t); actor_addr(std::nullptr_t);
actor_addr(const unsafe_actor_handle_init_t&);
actor_addr& operator=(std::nullptr_t); actor_addr& operator=(std::nullptr_t);
......
...@@ -133,11 +133,6 @@ public: ...@@ -133,11 +133,6 @@ public:
actor_system_config& parse(int argc, char** argv, actor_system_config& parse(int argc, char** argv,
const char* ini_file_cstr = nullptr); const char* ini_file_cstr = nullptr);
actor_system_config&
parse(message& args, const char* ini_file_cstr = nullptr) CAF_DEPRECATED;
actor_system_config& parse(message& args, std::istream& ini) CAF_DEPRECATED;
/// Allows other nodes to spawn actors created by `fun` /// Allows other nodes to spawn actors created by `fun`
/// dynamically by using `name` as identifier. /// dynamically by using `name` as identifier.
/// @experimental /// @experimental
...@@ -248,9 +243,6 @@ public: ...@@ -248,9 +243,6 @@ public:
/// and instead return from `main` immediately. /// and instead return from `main` immediately.
bool cli_helptext_printed; bool cli_helptext_printed;
/// Stores CLI arguments that were not consumed by CAF.
message args_remainder CAF_DEPRECATED;
/// Stores CLI arguments that were not consumed by CAF. /// Stores CLI arguments that were not consumed by CAF.
string_list remainder; string_list remainder;
...@@ -279,49 +271,6 @@ public: ...@@ -279,49 +271,6 @@ public:
/// @private /// @private
timespan stream_tick_duration() const noexcept; timespan stream_tick_duration() const noexcept;
timespan streaming_credit_round_interval() const noexcept CAF_DEPRECATED;
// -- scheduling parameters --------------------------------------------------
atom_value scheduler_policy CAF_DEPRECATED;
size_t scheduler_max_threads CAF_DEPRECATED;
size_t scheduler_max_throughput CAF_DEPRECATED;
bool scheduler_enable_profiling CAF_DEPRECATED;
size_t scheduler_profiling_ms_resolution CAF_DEPRECATED;
std::string scheduler_profiling_output_file CAF_DEPRECATED;
// -- work-stealing parameters -----------------------------------------------
size_t work_stealing_aggressive_poll_attempts CAF_DEPRECATED;
size_t work_stealing_aggressive_steal_interval CAF_DEPRECATED;
size_t work_stealing_moderate_poll_attempts CAF_DEPRECATED;
size_t work_stealing_moderate_steal_interval CAF_DEPRECATED;
size_t work_stealing_moderate_sleep_duration_us CAF_DEPRECATED;
size_t work_stealing_relaxed_steal_interval CAF_DEPRECATED;
size_t work_stealing_relaxed_sleep_duration_us CAF_DEPRECATED;
// -- logger parameters ------------------------------------------------------
std::string logger_file_name CAF_DEPRECATED;
std::string logger_file_format CAF_DEPRECATED;
atom_value logger_console CAF_DEPRECATED;
std::string logger_console_format CAF_DEPRECATED;
std::string logger_component_filter CAF_DEPRECATED;
atom_value logger_verbosity CAF_DEPRECATED;
bool logger_inline_output CAF_DEPRECATED;
// -- middleman parameters ---------------------------------------------------
atom_value middleman_network_backend CAF_DEPRECATED;
std::string middleman_app_identifier CAF_DEPRECATED;
bool middleman_enable_automatic_connections CAF_DEPRECATED;
size_t middleman_max_consecutive_reads CAF_DEPRECATED;
size_t middleman_heartbeat_interval CAF_DEPRECATED;
bool middleman_detach_utility_actors CAF_DEPRECATED;
bool middleman_detach_multiplexer CAF_DEPRECATED;
size_t middleman_cached_udp_buffers CAF_DEPRECATED;
size_t middleman_max_pending_msgs CAF_DEPRECATED;
// -- OpenCL parameters ------------------------------------------------------ // -- OpenCL parameters ------------------------------------------------------
std::string opencl_device_ids; std::string opencl_device_ids;
......
...@@ -122,7 +122,7 @@ struct function_view_result { ...@@ -122,7 +122,7 @@ struct function_view_result {
template <class... Ts> template <class... Ts>
struct function_view_result<typed_actor<Ts...>> { struct function_view_result<typed_actor<Ts...>> {
typed_actor<Ts...> value{unsafe_actor_handle_init}; typed_actor<Ts...> value{nullptr};
}; };
/// A function view for an actor hides any messaging from the caller. /// A function view for an actor hides any messaging from the caller.
......
...@@ -200,12 +200,6 @@ public: ...@@ -200,12 +200,6 @@ public:
return f(meta::type_name("message_id"), x.value_); return f(meta::type_name("message_id"), x.value_);
} }
// -- deprecated functions ---------------------------------------------------
template <class... Ts>
static message_id make(Ts&&... xs)
CAF_DEPRECATED_MSG("use make_message_id instead");
private: private:
// -- member variables ------------------------------------------------------- // -- member variables -------------------------------------------------------
...@@ -241,13 +235,6 @@ constexpr message_id make_message_id(message_priority p) { ...@@ -241,13 +235,6 @@ constexpr message_id make_message_id(message_priority p) {
return message_id{static_cast<uint64_t>(p) << message_id::category_offset}; return message_id{static_cast<uint64_t>(p) << message_id::category_offset};
} }
// -- deprecated functions -----------------------------------------------------
template <class... Ts>
message_id message_id::make(Ts&&... xs) {
return make_message_id(std::forward<Ts>(xs)...);
}
} // namespace caf } // namespace caf
namespace std { namespace std {
......
...@@ -142,10 +142,6 @@ public: ...@@ -142,10 +142,6 @@ public:
detail::test_actor_clock& clock() noexcept override; detail::test_actor_clock& clock() noexcept override;
std::pair<size_t, size_t>
run_dispatch_loop(timespan cycle_duration = timespan{1})
CAF_DEPRECATED_MSG("use the testing DSL's run() instead");
protected: protected:
void start() override; void start() override;
......
...@@ -63,10 +63,6 @@ constexpr spawn_options detached = spawn_options::detach_flag; ...@@ -63,10 +63,6 @@ constexpr spawn_options detached = spawn_options::detach_flag;
/// Causes the runtime to ignore the new actor in `await_all_actors_done()`. /// Causes the runtime to ignore the new actor in `await_all_actors_done()`.
constexpr spawn_options hidden = spawn_options::hide_flag; constexpr spawn_options hidden = spawn_options::hide_flag;
/// Causes the new actor to evaluate message priorities.
constexpr spawn_options priority_aware CAF_DEPRECATED =
spawn_options::priority_aware_flag;
/// Causes the new actor to delay its /// Causes the new actor to delay its
/// initialization until a message arrives. /// initialization until a message arrives.
constexpr spawn_options lazy_init = spawn_options::lazy_init_flag; constexpr spawn_options lazy_init = spawn_options::lazy_init_flag;
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include "caf/stateful_actor.hpp" #include "caf/stateful_actor.hpp"
#include "caf/typed_behavior.hpp" #include "caf/typed_behavior.hpp"
#include "caf/typed_response_promise.hpp" #include "caf/typed_response_promise.hpp"
#include "caf/unsafe_actor_handle_init.hpp"
#include "caf/detail/mpi_splice.hpp" #include "caf/detail/mpi_splice.hpp"
#include "caf/decorator/splitter.hpp" #include "caf/decorator/splitter.hpp"
...@@ -172,10 +171,6 @@ class typed_actor : detail::comparable<typed_actor<Sigs...>>, ...@@ -172,10 +171,6 @@ class typed_actor : detail::comparable<typed_actor<Sigs...>>,
return *this; return *this;
} }
explicit typed_actor(const unsafe_actor_handle_init_t&) CAF_DEPRECATED {
// nop
}
/// Queries whether this actor handle is valid. /// Queries whether this actor handle is valid.
inline explicit operator bool() const { inline explicit operator bool() const {
return static_cast<bool>(ptr_); return static_cast<bool>(ptr_);
...@@ -211,12 +206,6 @@ class typed_actor : detail::comparable<typed_actor<Sigs...>>, ...@@ -211,12 +206,6 @@ class typed_actor : detail::comparable<typed_actor<Sigs...>>,
ptr_.swap(other.ptr_); ptr_.swap(other.ptr_);
} }
/// Queries whether this object was constructed using
/// `unsafe_actor_handle_init` or is in moved-from state.
bool unsafe() const CAF_DEPRECATED {
return !ptr_;
}
/// @cond PRIVATE /// @cond PRIVATE
abstract_actor* operator->() const noexcept { abstract_actor* operator->() const noexcept {
......
...@@ -43,10 +43,6 @@ actor::actor(const scoped_actor& x) : ptr_(actor_cast<strong_actor_ptr>(x)) { ...@@ -43,10 +43,6 @@ actor::actor(const scoped_actor& x) : ptr_(actor_cast<strong_actor_ptr>(x)) {
// nop // nop
} }
actor::actor(const unsafe_actor_handle_init_t&) : ptr_(nullptr) {
// nop
}
actor::actor(actor_control_block* ptr) : ptr_(ptr) { actor::actor(actor_control_block* ptr) : ptr_(ptr) {
// nop // nop
} }
......
...@@ -31,10 +31,6 @@ actor_addr::actor_addr(std::nullptr_t) { ...@@ -31,10 +31,6 @@ actor_addr::actor_addr(std::nullptr_t) {
// nop // nop
} }
actor_addr::actor_addr(const unsafe_actor_handle_init_t&) {
// nop
}
actor_addr& actor_addr::operator=(std::nullptr_t) { actor_addr& actor_addr::operator=(std::nullptr_t) {
ptr_.reset(); ptr_.reset();
return *this; return *this;
......
This diff is collapsed.
...@@ -16,15 +16,56 @@ ...@@ -16,15 +16,56 @@
* http://www.boost.org/LICENSE_1_0.txt. * * http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/ ******************************************************************************/
#pragma once #include "caf/settings.hpp"
namespace caf { namespace caf {
/// Tag type to select the unsafe constructor of actor handles. std::string get_or(const settings& xs, string_view name,
struct unsafe_actor_handle_init_t { }; string_view default_value) {
auto result = get_if<std::string>(&xs, name);
if (result)
return std::move(*result);
return std::string{default_value.begin(), default_value.end()};
}
static constexpr unsafe_actor_handle_init_t unsafe_actor_handle_init void put_impl(settings& dict, const std::vector<string_view>& path,
= unsafe_actor_handle_init_t{}; config_value& value) {
// Sanity check.
if (path.empty())
return;
// Navigate path.
auto last = path.end();
auto back = last - 1;
auto current = &dict;
// Resolve path by navigating the map-of-maps of create the necessary layout
// when needed.
for (auto i = path.begin(); i != back; ++i) {
auto iter = current->emplace(*i, settings{}).first;
if (auto val = get_if<settings>(&iter->second)) {
current = val;
} else {
iter->second = settings{};
current = &get<settings>(iter->second);
}
}
// Set key-value pair on the leaf.
current->insert_or_assign(*back, std::move(value));
}
} // namespace caf void put_impl(settings& dict, string_view key, config_value& value) {
std::vector<string_view> path;
split(path, key, ".");
put_impl(dict, path, value);
}
config_value::list& put_list(settings& xs, std::string name) {
auto i = xs.insert_or_assign(std::move(name), config_value::list{});
return get<config_value::list>(i.first->second);
}
config_value::dictionary& put_dictionary(settings& xs, std::string name) {
auto i = xs.insert_or_assign(std::move(name), settings{});
return get<config_value::dictionary>(i.first->second);
}
} // namespace caf
...@@ -161,17 +161,6 @@ void test_coordinator::inline_all_enqueues_helper() { ...@@ -161,17 +161,6 @@ void test_coordinator::inline_all_enqueues_helper() {
after_next_enqueue([=] { inline_all_enqueues_helper(); }); after_next_enqueue([=] { inline_all_enqueues_helper(); });
} }
std::pair<size_t, size_t>
test_coordinator::run_dispatch_loop(timespan cycle_duration) {
size_t messages = 0;
size_t timeouts = 0;
while (has_job() || has_pending_timeout()) {
messages += run();
timeouts += advance_time(cycle_duration);
}
return {messages, timeouts};
}
} // namespace caf } // namespace caf
} // namespace scheduler } // namespace scheduler
...@@ -33,13 +33,18 @@ using atomic_count = std::atomic<size_t>; ...@@ -33,13 +33,18 @@ using atomic_count = std::atomic<size_t>;
size_t assumed_thread_count; size_t assumed_thread_count;
size_t assumed_init_calls; size_t assumed_init_calls;
std::mutex mx;
struct dummy_thread_hook : thread_hook { struct dummy_thread_hook : thread_hook {
void init(actor_system&) override { void init(actor_system&) override {
// nop // nop
} }
void thread_started() override { void thread_started() override {
// nop void* array[20]; \
auto caf_bt_size = ::backtrace(array, 20); \
std::unique_lock<std::mutex> guard{mx};
::backtrace_symbols_fd(array, caf_bt_size, 2); \
} }
void thread_terminates() override { void thread_terminates() override {
......
...@@ -570,7 +570,6 @@ public: ...@@ -570,7 +570,6 @@ public:
caf::timespan{1000}); caf::timespan{1000});
// Make sure the current time isn't 0. // Make sure the current time isn't 0.
sched.clock().current_time += std::chrono::hours(1); sched.clock().current_time += std::chrono::hours(1);
credit_round_interval = cfg.stream_credit_round_interval;
} }
virtual ~test_coordinator_fixture() { virtual ~test_coordinator_fixture() {
...@@ -741,36 +740,8 @@ public: ...@@ -741,36 +740,8 @@ public:
/// Deterministic scheduler. /// Deterministic scheduler.
scheduler_type& sched; scheduler_type& sched;
// -- deprecated functionality -----------------------------------------------
void run_exhaustively() CAF_DEPRECATED_MSG("use run() instead");
void run_exhaustively_until(std::function<bool()> f)
CAF_DEPRECATED_MSG("use run_until() instead");
void loop_after_next_enqueue()
CAF_DEPRECATED_MSG("use run_after_next_ready_event() instead");
caf::timespan credit_round_interval CAF_DEPRECATED;
}; };
template <class Config>
void test_coordinator_fixture<Config>::run_exhaustively() {
run();
}
template <class Config>
void test_coordinator_fixture<Config>::run_exhaustively_until(
std::function<bool()> f) {
run_until(std::move(f));
}
template <class Config>
void test_coordinator_fixture<Config>::loop_after_next_enqueue() {
sched.after_next_enqueue([=] { run(); });
}
/// Unboxes an expected value or fails the test if it doesn't exist. /// Unboxes an expected value or fails the test if it doesn't exist.
template <class T> template <class T>
T unbox(caf::expected<T> x) { T unbox(caf::expected<T> x) {
......
...@@ -104,12 +104,6 @@ public: ...@@ -104,12 +104,6 @@ public:
/// Callback for triggering all nodes when simulating a network of CAF nodes. /// Callback for triggering all nodes when simulating a network of CAF nodes.
run_all_nodes_fun run_all_nodes; run_all_nodes_fun run_all_nodes;
// -- deprecated functions ---------------------------------------------------
void exec_all() CAF_DEPRECATED_MSG("use run() instead") {
this->run();
}
// -- overriding member functions -------------------------------------------- // -- overriding member functions --------------------------------------------
bool consume_message() override { bool consume_message() override {
......
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