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
c03e6b9f
Commit
c03e6b9f
authored
Jul 01, 2017
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a weak pointer for stream IDs
parent
0a66cc86
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
5 deletions
+26
-5
libcaf_core/caf/stream_id.hpp
libcaf_core/caf/stream_id.hpp
+10
-4
libcaf_core/src/stream_id.cpp
libcaf_core/src/stream_id.cpp
+16
-1
No files found.
libcaf_core/caf/stream_id.hpp
View file @
c03e6b9f
...
@@ -22,8 +22,9 @@
...
@@ -22,8 +22,9 @@
#include <cstdint>
#include <cstdint>
#include "caf/actor_addr.hpp"
#include "caf/meta/type_name.hpp"
#include "caf/meta/type_name.hpp"
#include "caf/actor_control_block.hpp"
#include "caf/detail/comparable.hpp"
#include "caf/detail/comparable.hpp"
...
@@ -31,17 +32,22 @@ namespace caf {
...
@@ -31,17 +32,22 @@ namespace caf {
class
stream_id
:
detail
::
comparable
<
stream_id
>
{
class
stream_id
:
detail
::
comparable
<
stream_id
>
{
public:
public:
stream_id
()
=
default
;
stream_id
(
stream_id
&&
)
=
default
;
stream_id
(
stream_id
&&
)
=
default
;
stream_id
(
const
stream_id
&
)
=
default
;
stream_id
(
const
stream_id
&
)
=
default
;
stream_id
&
operator
=
(
stream_id
&&
)
=
default
;
stream_id
&
operator
=
(
stream_id
&&
)
=
default
;
stream_id
&
operator
=
(
const
stream_id
&
)
=
default
;
stream_id
&
operator
=
(
const
stream_id
&
)
=
default
;
stream_id
(
strong_actor_ptr
origin_actor
,
uint64_t
origin_nr
);
stream_id
();
stream_id
(
actor_addr
origin_actor
,
uint64_t
origin_nr
);
stream_id
(
actor_control_block
*
origin_actor
,
uint64_t
origin_nr
);
stream_id
(
const
strong_actor_ptr
&
origin_actor
,
uint64_t
origin_nr
);
int64_t
compare
(
const
stream_id
&
other
)
const
;
int64_t
compare
(
const
stream_id
&
other
)
const
;
strong_actor_pt
r
origin
;
actor_add
r
origin
;
uint64_t
nr
;
uint64_t
nr
;
inline
bool
valid
()
const
{
inline
bool
valid
()
const
{
...
...
libcaf_core/src/stream_id.cpp
View file @
c03e6b9f
...
@@ -23,12 +23,27 @@
...
@@ -23,12 +23,27 @@
namespace
caf
{
namespace
caf
{
stream_id
::
stream_id
(
strong_actor_ptr
origin_actor
,
uint64_t
origin_nr
)
stream_id
::
stream_id
()
:
origin
(
nullptr
),
nr
(
0
)
{
// nop
}
stream_id
::
stream_id
(
actor_addr
origin_actor
,
uint64_t
origin_nr
)
:
origin
(
std
::
move
(
origin_actor
)),
:
origin
(
std
::
move
(
origin_actor
)),
nr
(
origin_nr
)
{
nr
(
origin_nr
)
{
// nop
// nop
}
}
stream_id
::
stream_id
(
actor_control_block
*
origin_actor
,
uint64_t
origin_nr
)
:
stream_id
(
origin_actor
->
address
(),
origin_nr
)
{
// nop
}
stream_id
::
stream_id
(
const
strong_actor_ptr
&
origin_actor
,
uint64_t
origin_nr
)
:
stream_id
(
origin_actor
->
address
(),
origin_nr
)
{
// nop
}
int64_t
stream_id
::
compare
(
const
stream_id
&
other
)
const
{
int64_t
stream_id
::
compare
(
const
stream_id
&
other
)
const
{
auto
r0
=
static_cast
<
ptrdiff_t
>
(
origin
.
get
()
-
other
.
origin
.
get
());
auto
r0
=
static_cast
<
ptrdiff_t
>
(
origin
.
get
()
-
other
.
origin
.
get
());
if
(
r0
!=
0
)
if
(
r0
!=
0
)
...
...
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