Skip to content

Commit

Permalink
Merge pull request #1849
Browse files Browse the repository at this point in the history
add_actor_type cleanup
  • Loading branch information
Neverlord committed May 7, 2024
2 parents 3fcb5d9 + 69e2619 commit 83dc2f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Expand Up @@ -69,7 +69,7 @@ config = [
tags: ['docker'],
builds: ['release'],
extraBuildFlags: [
'CMAKE_CXX_FLAGS:STRING=-Werror -Wno-maybe-uninitialized',
'CMAKE_CXX_FLAGS:STRING=-Werror -Wno-maybe-uninitialized -Wno-deprecated-declarations',
],
]],
['fedora-38', [ // EOL June 2024
Expand Down
8 changes: 2 additions & 6 deletions libcaf_core/caf/actor_system_config.hpp
Expand Up @@ -85,14 +85,12 @@ class CAF_CORE_EXPORT actor_system_config {

/// Allows other nodes to spawn actors created by `fun`
/// dynamically by using `name` as identifier.
/// @experimental
actor_system_config& add_actor_factory(std::string name, actor_factory fun);

/// Allows other nodes to spawn actors of type `T`
/// dynamically by using `name` as identifier.
/// @experimental
template <class T, class... Ts>
actor_system_config& add_actor_type(std::string name) {
[[deprecated]] actor_system_config& add_actor_type(std::string name) {
using handle = infer_handle_from_class_t<T>;
static_assert(detail::is_complete<type_id<handle>>);
return add_actor_factory(std::move(name), make_actor_factory<T, Ts...>());
Expand All @@ -102,23 +100,21 @@ class CAF_CORE_EXPORT actor_system_config {
/// dynamically by using `name` as identifier.
/// @param t conveys the state constructor signature as a type list.
/// @param ts type lists conveying alternative constructor signatures.
/// @experimental
template <class F, class T, class... Ts>
actor_system_config& add_actor_type(std::string name, F f, T t, Ts... ts) {
return add_actor_factory(std::move(name), make_actor_factory(f, t, ts...));
}

/// Allows other nodes to spawn actors implemented by function `f`
/// dynamically by using `name` as identifier.
/// @experimental
template <class F>
actor_system_config& add_actor_type(std::string name, F f) {
if constexpr (detail::has_handle_type_alias_v<F>) {
// F represents an actor_from_state spawnable wrapper.
return add_actor_factory(std::move(name),
make_actor_factory(f, type_list<>{}));
} else {
// F represents a function based actor callable
// F represents a function based actor callable.
using handle = infer_handle_from_fun_t<F>;
static_assert(detail::is_complete<type_id<handle>>);
return add_actor_factory(std::move(name),
Expand Down

0 comments on commit 83dc2f2

Please sign in to comment.