Commit d0a0d62a authored by Jakob Otto's avatar Jakob Otto

Move basp_application_factory to own file

parent 9afbce9e
......@@ -90,25 +90,6 @@ public:
}
private:
class basp_application_factory {
public:
using application_type = basp::application;
basp_application_factory(proxy_registry& proxies);
template <class Parent>
error init(Parent&) {
return none;
}
application_type make() const {
return application_type{proxies_};
}
private:
proxy_registry& proxies_;
};
endpoint_manager_ptr get_peer(const node_id& id);
middleman& mm_;
......
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ Actor *
* | |___ / ___ \| _| Framework *
* \____/_/ \_|_| *
* *
* Copyright 2011-2019 Dominik Charousset *
* *
* Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software *
* License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE. *
* *
* If you did not receive a copy of the license files, see *
* http://opensource.org/licenses/BSD-3-Clause and *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#pragma once
#include "caf/error.hpp"
#include "caf/net/basp/application.hpp"
#include "caf/proxy_registry.hpp"
namespace caf::net::basp {
class CAF_NET_EXPORT application_factory {
public:
using application_type = basp::application;
application_factory(proxy_registry& proxies) : proxies_(proxies) {
// nop
}
template <class Parent>
error init(Parent&) {
return none;
}
application_type make() const {
return application_type{proxies_};
}
private:
proxy_registry& proxies_;
};
} // namespace caf::net::basp
......@@ -22,6 +22,7 @@
#include "caf/net/actor_proxy_impl.hpp"
#include "caf/net/basp/application.hpp"
#include "caf/net/basp/application_factory.hpp"
#include "caf/net/basp/ec.hpp"
#include "caf/net/doorman.hpp"
#include "caf/net/ip.hpp"
......@@ -65,9 +66,9 @@ error tcp::init() {
if (!doorman_uri)
return doorman_uri.error();
auto& mpx = mm_.mpx();
auto mgr = make_endpoint_manager(mpx, mm_.system(),
doorman{acc_guard.release(),
basp_application_factory{proxies_}});
auto mgr = make_endpoint_manager(
mpx, mm_.system(),
doorman{acc_guard.release(), basp::application_factory{proxies_}});
if (auto err = mgr->init()) {
CAF_LOG_ERROR("mgr->init() failed: " << err);
return err;
......@@ -138,9 +139,4 @@ endpoint_manager_ptr tcp::get_peer(const node_id& id) {
return nullptr;
}
tcp::basp_application_factory::basp_application_factory(proxy_registry& proxies)
: proxies_(proxies) {
// nop
}
} // namespace caf::net::backend
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