Commit 8c635fcd authored by Dominik Charousset's avatar Dominik Charousset

Add OpenSSL manager forward declarations

parent 30d50ed2
......@@ -165,6 +165,7 @@ public:
scheduler,
middleman,
opencl_manager,
openssl_manager,
num_ids
};
......@@ -287,12 +288,19 @@ public:
/// @throws `std::logic_error` if module is not loaded.
io::middleman& middleman();
/// Returns the opencl manager instance from opencl module.
/// Returns `true` if the opencl module is available, `false` otherwise.
bool has_opencl_manager() const;
/// Returns the manager instance from the OpenCL module.
/// @throws `std::logic_error` if module is not loaded.
opencl::manager& opencl_manager() const;
/// Returns `true` if the opencl module is available, `false` otherwise.
bool has_opencl_manager() const;
/// Returns `true` if the openssl module is available, `false` otherwise.
bool has_openssl_manager() const;
/// Returns the manager instance from the OpenSSL module.
/// @throws `std::logic_error` if module is not loaded.
openssl::manager& openssl_manager() const;
/// Returns a dummy execution unit that forwards
/// everything to the scheduler.
......@@ -558,9 +566,7 @@ private:
actor_registry registry_;
group_manager groups_;
module_array modules_;
io::middleman* middleman_;
scoped_execution_unit dummy_execution_unit_;
opencl::manager* opencl_manager_;
bool await_actors_before_shutdown_;
// Stores SpawnServ, ConfigServ, and StreamServ
std::array<strong_actor_ptr, num_internal_actors> internal_actors_;
......
......@@ -167,6 +167,15 @@ class abstract_coordinator;
} // namespace scheduler
// -- OpenSSL classes ----------------------------------------------------------
namespace openssl {
class manager;
} // namespace openssl
// -- detail classes -----------------------------------------------------------
namespace detail {
......
......@@ -209,7 +209,6 @@ actor_system::actor_system(actor_system_config& cfg)
logger_(new caf::logger(*this), false),
registry_(*this),
groups_(*this),
middleman_(nullptr),
dummy_execution_unit_(this),
await_actors_before_shutdown_(true),
detached(0),
......@@ -220,12 +219,6 @@ actor_system::actor_system(actor_system_config& cfg)
auto mod_ptr = f(*this);
modules_[mod_ptr->id()].reset(mod_ptr);
}
auto& mmptr = modules_[module::middleman];
if (mmptr)
middleman_ = reinterpret_cast<io::middleman*>(mmptr->subtype_ptr());
auto& clptr = modules_[module::opencl_manager];
if (clptr)
opencl_manager_ = reinterpret_cast<opencl::manager*>(clptr->subtype_ptr());
auto& sched = modules_[module::scheduler];
using test = scheduler::test_coordinator;
using share = scheduler::coordinator<policy::work_sharing>;
......@@ -359,23 +352,36 @@ group_manager& actor_system::groups() {
}
bool actor_system::has_middleman() const {
return middleman_ != nullptr;
return modules_[module::middleman] != nullptr;
}
io::middleman& actor_system::middleman() {
if (middleman_ == nullptr)
CAF_RAISE_ERROR("cannot access middleman: module not loaded");
return *middleman_;
auto& clptr = modules_[module::middleman];
if (!clptr)
CAF_RAISE_ERROR("cannot access opencl manager: module not loaded");
return *reinterpret_cast<io::middleman*>(clptr->subtype_ptr());
}
bool actor_system::has_opencl_manager() const {
return opencl_manager_ != nullptr;
return modules_[module::opencl_manager] != nullptr;
}
opencl::manager& actor_system::opencl_manager() const {
if (opencl_manager_ == nullptr)
auto& clptr = modules_[module::opencl_manager];
if (!clptr)
CAF_RAISE_ERROR("cannot access opencl manager: module not loaded");
return *opencl_manager_;
return *reinterpret_cast<opencl::manager*>(clptr->subtype_ptr());
}
bool actor_system::has_openssl_manager() const {
return modules_[module::openssl_manager] != nullptr;
}
openssl::manager& actor_system::openssl_manager() const {
auto& clptr = modules_[module::openssl_manager];
if (!clptr)
CAF_RAISE_ERROR("cannot access openssl manager: module not loaded");
return *reinterpret_cast<openssl::manager*>(clptr->subtype_ptr());
}
scoped_execution_unit* actor_system::dummy_execution_unit() {
......
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