Commit f456a5da authored by Dominik Charousset's avatar Dominik Charousset

Remove unnecessary copy and move restrictions

parent 11c8986e
......@@ -30,8 +30,11 @@ class execution_unit {
public:
explicit execution_unit(actor_system* sys);
execution_unit(execution_unit&&) = delete;
execution_unit(const execution_unit&) = delete;
execution_unit() = default;
execution_unit(execution_unit&&) = default;
execution_unit& operator=(execution_unit&&) = default;
execution_unit(const execution_unit&) = default;
execution_unit& operator=(const execution_unit&) = default;
virtual ~execution_unit();
......@@ -58,8 +61,8 @@ public:
}
protected:
actor_system* system_;
proxy_registry* proxies_;
actor_system* system_ = nullptr;
proxy_registry* proxies_ = nullptr;
};
} // namespace caf
......
......@@ -26,11 +26,18 @@ namespace caf {
/// querying its execution unit, an actor can access other context information.
class scoped_execution_unit : public execution_unit {
public:
/// @pre `sys != nullptr`
explicit scoped_execution_unit(actor_system* sys = nullptr);
using super = execution_unit;
using super::super;
~scoped_execution_unit() override;
/// Delegates the resumable to the scheduler of `system()`.
void exec_later(resumable* ptr) override;
void system_ptr(actor_system* ptr) noexcept {
system_ = ptr;
}
};
} // namespace caf
......
......@@ -23,8 +23,7 @@
namespace caf {
scoped_execution_unit::scoped_execution_unit(actor_system* sys)
: execution_unit(sys){
scoped_execution_unit::~scoped_execution_unit() {
// nop
}
......
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