Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
ec3d1871
Commit
ec3d1871
authored
Oct 25, 2022
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate the actor composition operator
parent
ad218a35
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
69 deletions
+7
-69
libcaf_core/CMakeLists.txt
libcaf_core/CMakeLists.txt
+0
-1
libcaf_core/caf/actor.hpp
libcaf_core/caf/actor.hpp
+1
-1
libcaf_core/caf/typed_actor.hpp
libcaf_core/caf/typed_actor.hpp
+2
-1
libcaf_core/test/composition.cpp
libcaf_core/test/composition.cpp
+0
-66
libcaf_core/test/decorator/sequencer.cpp
libcaf_core/test/decorator/sequencer.cpp
+4
-0
No files found.
libcaf_core/CMakeLists.txt
View file @
ec3d1871
...
...
@@ -233,7 +233,6 @@ caf_add_component(
binary_deserializer
binary_serializer
blocking_actor
composition
config_option
config_option_set
config_value
...
...
libcaf_core/caf/actor.hpp
View file @
ec3d1871
...
...
@@ -158,7 +158,7 @@ private:
};
/// Combine `f` and `g` so that `(f*g)(x) = f(g(x))`.
CAF_CORE_EXPORT
actor
operator
*
(
actor
f
,
actor
g
);
[[
deprecated
]]
CAF_CORE_EXPORT
actor
operator
*
(
actor
f
,
actor
g
);
/// @relates actor
CAF_CORE_EXPORT
bool
operator
==
(
const
actor
&
lhs
,
abstract_actor
*
rhs
);
...
...
libcaf_core/caf/typed_actor.hpp
View file @
ec3d1871
...
...
@@ -301,7 +301,8 @@ bool operator!=(std::nullptr_t, const typed_actor<Xs...>& x) noexcept {
/// Returns a new actor that implements the composition `f.g(x) = f(g(x))`.
/// @relates typed_actor
template
<
class
...
Xs
,
class
...
Ys
>
composed_type_t
<
detail
::
type_list
<
Xs
...
>
,
detail
::
type_list
<
Ys
...
>>
[[
deprecated
]]
composed_type_t
<
detail
::
type_list
<
Xs
...
>
,
detail
::
type_list
<
Ys
...
>>
operator
*
(
typed_actor
<
Xs
...
>
f
,
typed_actor
<
Ys
...
>
g
)
{
using
result
=
composed_type_t
<
detail
::
type_list
<
Xs
...
>
,
detail
::
type_list
<
Ys
...
>>
;
...
...
libcaf_core/test/composition.cpp
deleted
100644 → 0
View file @
ad218a35
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#define CAF_SUITE composition
#include "caf/actor.hpp"
#include "core-test.hpp"
using
namespace
caf
;
namespace
{
behavior
multiplier
(
int
x
)
{
return
{[
=
](
int
y
)
{
return
x
*
y
;
},
[
=
](
int
y1
,
int
y2
)
{
return
x
*
y1
*
y2
;
}};
}
behavior
adder
(
int
x
)
{
return
{[
=
](
int
y
)
{
return
x
+
y
;
},
[
=
](
int
y1
,
int
y2
)
{
return
x
+
y1
+
y2
;
}};
}
behavior
float_adder
(
float
x
)
{
return
{[
=
](
float
y
)
{
return
x
+
y
;
}};
}
using
fixture
=
test_coordinator_fixture
<>
;
}
// namespace
BEGIN_FIXTURE_SCOPE
(
fixture
)
CAF_TEST
(
depth2
)
{
auto
stage1
=
sys
.
spawn
(
multiplier
,
4
);
auto
stage2
=
sys
.
spawn
(
adder
,
10
);
auto
testee
=
stage2
*
stage1
;
self
->
send
(
testee
,
1
);
expect
((
int
),
from
(
self
).
to
(
stage1
).
with
(
1
));
expect
((
int
),
from
(
self
).
to
(
stage2
).
with
(
4
));
expect
((
int
),
from
(
stage2
).
to
(
self
).
with
(
14
));
}
CAF_TEST
(
depth3
)
{
auto
stage1
=
sys
.
spawn
(
multiplier
,
4
);
auto
stage2
=
sys
.
spawn
(
adder
,
10
);
auto
testee
=
stage1
*
stage2
*
stage1
;
self
->
send
(
testee
,
1
);
expect
((
int
),
from
(
self
).
to
(
stage1
).
with
(
1
));
expect
((
int
),
from
(
self
).
to
(
stage2
).
with
(
4
));
expect
((
int
),
from
(
self
).
to
(
stage1
).
with
(
14
));
expect
((
int
),
from
(
stage1
).
to
(
self
).
with
(
56
));
}
CAF_TEST
(
depth2_type_mismatch
)
{
auto
stage1
=
sys
.
spawn
(
multiplier
,
4
);
auto
stage2
=
sys
.
spawn
(
float_adder
,
10
);
auto
testee
=
stage2
*
stage1
;
self
->
send
(
testee
,
1
);
expect
((
int
),
from
(
self
).
to
(
stage1
).
with
(
1
));
expect
((
int
),
from
(
self
).
to
(
stage2
).
with
(
4
));
expect
((
error
),
from
(
stage2
).
to
(
self
).
with
(
sec
::
unexpected_message
));
}
END_FIXTURE_SCOPE
()
libcaf_core/test/decorator/sequencer.cpp
View file @
ec3d1871
...
...
@@ -12,6 +12,8 @@
#define ERROR_HANDLER [&](error& err) { CAF_FAIL(err); }
CAF_PUSH_DEPRECATED_WARNING
using
namespace
caf
;
namespace
{
...
...
@@ -150,3 +152,5 @@ CAF_TEST(dot_composition_2) {
}
END_FIXTURE_SCOPE
()
CAF_POP_WARNINGS
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment