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
8310bcd7
Commit
8310bcd7
authored
Jun 29, 2021
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make message view API more robust
parent
cff048a4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
8 deletions
+11
-8
CHANGELOG.md
CHANGELOG.md
+6
-0
libcaf_core/caf/const_typed_message_view.hpp
libcaf_core/caf/const_typed_message_view.hpp
+2
-4
libcaf_core/caf/typed_message_view.hpp
libcaf_core/caf/typed_message_view.hpp
+3
-4
No files found.
CHANGELOG.md
View file @
8310bcd7
...
...
@@ -5,6 +5,12 @@ is based on [Keep a Changelog](https://keepachangelog.com).
## [Unreleased]
### Changed
-
Message views now perform the type-check in their constructor. With this
change, the
`make_*`
utility functions are no longer mandatory and users may
instead simply construct the view directly.
## Fixed
-
Printing a
`config_value`
that contains a zero duration
`timespan`
now
...
...
libcaf_core/caf/const_typed_message_view.hpp
View file @
8310bcd7
...
...
@@ -21,7 +21,7 @@ public:
}
explicit
const_typed_message_view
(
const
message
&
msg
)
noexcept
:
ptr_
(
msg
.
cptr
()
)
{
:
ptr_
(
msg
.
types
()
==
make_type_id_list
<
Ts
...
>
()
?
msg
.
cptr
()
:
nullptr
)
{
// nop
}
...
...
@@ -63,9 +63,7 @@ auto to_tuple(const_typed_message_view<Ts...> xs) {
template
<
class
...
Ts
>
auto
make_const_typed_message_view
(
const
message
&
msg
)
{
if
(
msg
.
types
()
==
make_type_id_list
<
Ts
...
>
())
return
const_typed_message_view
<
Ts
...
>
{
msg
};
return
const_typed_message_view
<
Ts
...
>
{};
}
template
<
class
...
Ts
>
...
...
libcaf_core/caf/typed_message_view.hpp
View file @
8310bcd7
...
...
@@ -18,7 +18,8 @@ public:
// nop
}
explicit
typed_message_view
(
message
&
msg
)
:
ptr_
(
msg
.
ptr
())
{
explicit
typed_message_view
(
message
&
msg
)
:
ptr_
(
msg
.
types
()
==
make_type_id_list
<
Ts
...
>
()
?
msg
.
ptr
()
:
nullptr
)
{
// nop
}
...
...
@@ -48,9 +49,7 @@ auto& get(typed_message_view<Ts...> x) {
template
<
class
...
Ts
>
auto
make_typed_message_view
(
message
&
msg
)
{
if
(
msg
.
types
()
==
make_type_id_list
<
Ts
...
>
())
return
typed_message_view
<
Ts
...
>
{
msg
};
return
typed_message_view
<
Ts
...
>
{};
}
}
// namespace caf
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