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