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
59e2d5c4
Commit
59e2d5c4
authored
Sep 17, 2016
by
ufownl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate .unsafe functions of typed_actor
parent
66d9e98c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
15 deletions
+15
-15
libcaf_core/caf/function_view.hpp
libcaf_core/caf/function_view.hpp
+10
-7
libcaf_core/caf/typed_actor.hpp
libcaf_core/caf/typed_actor.hpp
+3
-4
libcaf_io/src/middleman.cpp
libcaf_io/src/middleman.cpp
+1
-3
libcaf_io/test/remote_spawn.cpp
libcaf_io/test/remote_spawn.cpp
+1
-1
No files found.
libcaf_core/caf/function_view.hpp
View file @
59e2d5c4
...
@@ -135,9 +135,7 @@ class function_view {
...
@@ -135,9 +135,7 @@ class function_view {
public:
public:
using
type
=
Actor
;
using
type
=
Actor
;
function_view
(
duration
rel_timeout
=
infinite
)
function_view
(
duration
rel_timeout
=
infinite
)
:
timeout
(
rel_timeout
)
{
:
timeout
(
rel_timeout
),
impl_
(
unsafe_actor_handle_init
)
{
// nop
// nop
}
}
...
@@ -164,7 +162,7 @@ public:
...
@@ -164,7 +162,7 @@ public:
function_view
&
operator
=
(
function_view
&&
x
)
{
function_view
&
operator
=
(
function_view
&&
x
)
{
timeout
=
x
.
timeout
;
timeout
=
x
.
timeout
;
assign
(
x
.
impl_
);
assign
(
x
.
impl_
);
x
.
assign
(
unsafe_actor_handle_init
);
x
.
reset
(
);
return
*
this
;
return
*
this
;
}
}
...
@@ -195,16 +193,21 @@ public:
...
@@ -195,16 +193,21 @@ public:
}
}
void
assign
(
type
x
)
{
void
assign
(
type
x
)
{
if
(
impl_
.
unsafe
()
&&
!
x
.
unsafe
()
)
if
(
!
impl_
&&
x
)
new_self
(
x
);
new_self
(
x
);
if
(
!
impl_
.
unsafe
()
&&
x
.
unsafe
()
)
if
(
impl_
&&
!
x
)
self_
.
~
scoped_actor
();
self_
.
~
scoped_actor
();
impl_
.
swap
(
x
);
impl_
.
swap
(
x
);
}
}
void
reset
()
{
self_
.
~
scoped_actor
();
impl_
=
type
();
}
/// Checks whether this function view has an actor assigned to it.
/// Checks whether this function view has an actor assigned to it.
explicit
operator
bool
()
const
{
explicit
operator
bool
()
const
{
return
!
impl_
.
unsafe
(
);
return
static_cast
<
bool
>
(
impl_
);
}
}
duration
timeout
;
duration
timeout
;
...
...
libcaf_core/caf/typed_actor.hpp
View file @
59e2d5c4
...
@@ -125,6 +125,7 @@ class typed_actor : detail::comparable<typed_actor<Sigs...>>,
...
@@ -125,6 +125,7 @@ class typed_actor : detail::comparable<typed_actor<Sigs...>>,
using
stateful_broker_pointer
=
using
stateful_broker_pointer
=
stateful_actor
<
State
,
broker_base
>*
;
stateful_actor
<
State
,
broker_base
>*
;
typed_actor
()
=
default
;
typed_actor
(
typed_actor
&&
)
=
default
;
typed_actor
(
typed_actor
&&
)
=
default
;
typed_actor
(
const
typed_actor
&
)
=
default
;
typed_actor
(
const
typed_actor
&
)
=
default
;
typed_actor
&
operator
=
(
typed_actor
&&
)
=
default
;
typed_actor
&
operator
=
(
typed_actor
&&
)
=
default
;
...
@@ -165,7 +166,7 @@ class typed_actor : detail::comparable<typed_actor<Sigs...>>,
...
@@ -165,7 +166,7 @@ class typed_actor : detail::comparable<typed_actor<Sigs...>>,
return
*
this
;
return
*
this
;
}
}
typed_actor
(
const
unsafe_actor_handle_init_t
&
)
{
explicit
typed_actor
(
const
unsafe_actor_handle_init_t
&
)
CAF_DEPRECATED
{
// nop
// nop
}
}
...
@@ -206,7 +207,7 @@ class typed_actor : detail::comparable<typed_actor<Sigs...>>,
...
@@ -206,7 +207,7 @@ class typed_actor : detail::comparable<typed_actor<Sigs...>>,
/// Queries whether this object was constructed using
/// Queries whether this object was constructed using
/// `unsafe_actor_handle_init` or is in moved-from state.
/// `unsafe_actor_handle_init` or is in moved-from state.
bool
unsafe
()
const
{
bool
unsafe
()
const
CAF_DEPRECATED
{
return
!
ptr_
;
return
!
ptr_
;
}
}
...
@@ -250,8 +251,6 @@ class typed_actor : detail::comparable<typed_actor<Sigs...>>,
...
@@ -250,8 +251,6 @@ class typed_actor : detail::comparable<typed_actor<Sigs...>>,
/// @endcond
/// @endcond
private:
private:
typed_actor
()
=
default
;
actor_control_block
*
get
()
const
noexcept
{
actor_control_block
*
get
()
const
noexcept
{
return
ptr_
.
get
();
return
ptr_
.
get
();
}
}
...
...
libcaf_io/src/middleman.cpp
View file @
59e2d5c4
...
@@ -101,9 +101,7 @@ actor_system::module* middleman::make(actor_system& sys, detail::type_list<>) {
...
@@ -101,9 +101,7 @@ actor_system::module* middleman::make(actor_system& sys, detail::type_list<>) {
return
new
impl
(
sys
);
return
new
impl
(
sys
);
}
}
middleman
::
middleman
(
actor_system
&
sys
)
middleman
::
middleman
(
actor_system
&
sys
)
:
system_
(
sys
)
{
:
system_
(
sys
),
manager_
(
unsafe_actor_handle_init
)
{
// nop
// nop
}
}
...
...
libcaf_io/test/remote_spawn.cpp
View file @
59e2d5c4
...
@@ -89,7 +89,7 @@ void run_client(int argc, char** argv, uint16_t port) {
...
@@ -89,7 +89,7 @@ void run_client(int argc, char** argv, uint16_t port) {
auto
f1
=
make_function_view
(
*
calc
);
auto
f1
=
make_function_view
(
*
calc
);
CAF_REQUIRE_EQUAL
(
f1
(
add_atom
::
value
,
10
,
20
),
30
);
CAF_REQUIRE_EQUAL
(
f1
(
add_atom
::
value
,
10
,
20
),
30
);
CAF_REQUIRE_EQUAL
(
f1
(
sub_atom
::
value
,
10
,
20
),
-
10
);
CAF_REQUIRE_EQUAL
(
f1
(
sub_atom
::
value
,
10
,
20
),
-
10
);
f1
.
assign
(
unsafe_actor_handle_init
);
f1
.
reset
(
);
anon_send_exit
(
*
calc
,
exit_reason
::
kill
);
anon_send_exit
(
*
calc
,
exit_reason
::
kill
);
mm
.
close
(
port
);
mm
.
close
(
port
);
}
}
...
...
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