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
2aab0671
Commit
2aab0671
authored
Jul 01, 2017
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make actor_addr nullptr comparable/construbile
parent
c03e6b9f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
3 deletions
+31
-3
libcaf_core/caf/actor_addr.hpp
libcaf_core/caf/actor_addr.hpp
+22
-3
libcaf_core/src/actor_addr.cpp
libcaf_core/src/actor_addr.cpp
+9
-0
No files found.
libcaf_core/caf/actor_addr.hpp
View file @
2aab0671
...
@@ -58,8 +58,11 @@ public:
...
@@ -58,8 +58,11 @@ public:
actor_addr
&
operator
=
(
actor_addr
&&
)
=
default
;
actor_addr
&
operator
=
(
actor_addr
&&
)
=
default
;
actor_addr
&
operator
=
(
const
actor_addr
&
)
=
default
;
actor_addr
&
operator
=
(
const
actor_addr
&
)
=
default
;
actor_addr
(
std
::
nullptr_t
);
actor_addr
(
const
unsafe_actor_handle_init_t
&
);
actor_addr
(
const
unsafe_actor_handle_init_t
&
);
actor_addr
&
operator
=
(
std
::
nullptr_t
);
/// Returns the ID of this actor.
/// Returns the ID of this actor.
inline
actor_id
id
()
const
noexcept
{
inline
actor_id
id
()
const
noexcept
{
return
ptr_
->
id
();
return
ptr_
->
id
();
...
@@ -122,13 +125,13 @@ public:
...
@@ -122,13 +125,13 @@ public:
actor_addr
(
actor_control_block
*
,
bool
);
actor_addr
(
actor_control_block
*
,
bool
);
/// @endcond
private:
inline
actor_control_block
*
get
()
const
noexcept
{
inline
actor_control_block
*
get
()
const
noexcept
{
return
ptr_
.
get
();
return
ptr_
.
get
();
}
}
/// @endcond
private:
inline
actor_control_block
*
release
()
noexcept
{
inline
actor_control_block
*
release
()
noexcept
{
return
ptr_
.
release
();
return
ptr_
.
release
();
}
}
...
@@ -142,6 +145,22 @@ private:
...
@@ -142,6 +145,22 @@ private:
weak_actor_ptr
ptr_
;
weak_actor_ptr
ptr_
;
};
};
inline
bool
operator
==
(
const
actor_addr
&
x
,
std
::
nullptr_t
)
{
return
x
.
get
()
==
nullptr
;
}
inline
bool
operator
==
(
std
::
nullptr_t
,
const
actor_addr
&
x
)
{
return
x
.
get
()
==
nullptr
;
}
inline
bool
operator
!=
(
const
actor_addr
&
x
,
std
::
nullptr_t
)
{
return
x
.
get
()
!=
nullptr
;
}
inline
bool
operator
!=
(
std
::
nullptr_t
,
const
actor_addr
&
x
)
{
return
x
.
get
()
!=
nullptr
;
}
}
// namespace caf
}
// namespace caf
// allow actor_addr to be used in hash maps
// allow actor_addr to be used in hash maps
...
...
libcaf_core/src/actor_addr.cpp
View file @
2aab0671
...
@@ -28,10 +28,19 @@
...
@@ -28,10 +28,19 @@
namespace
caf
{
namespace
caf
{
actor_addr
::
actor_addr
(
std
::
nullptr_t
)
{
// nop
}
actor_addr
::
actor_addr
(
const
unsafe_actor_handle_init_t
&
)
{
actor_addr
::
actor_addr
(
const
unsafe_actor_handle_init_t
&
)
{
// nop
// nop
}
}
actor_addr
&
actor_addr
::
operator
=
(
std
::
nullptr_t
)
{
ptr_
.
reset
();
return
*
this
;
}
actor_addr
::
actor_addr
(
actor_control_block
*
ptr
)
:
ptr_
(
ptr
)
{
actor_addr
::
actor_addr
(
actor_control_block
*
ptr
)
:
ptr_
(
ptr
)
{
// nop
// nop
}
}
...
...
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