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
1855e8e0
Unverified
Commit
1855e8e0
authored
Jul 01, 2021
by
Noir
Committed by
GitHub
Jul 01, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1279
Make message view API more robust
parents
3615a07f
cbe2b02f
Changes
3
Hide 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 @
1855e8e0
...
@@ -11,6 +11,12 @@ is based on [Keep a Changelog](https://keepachangelog.com).
...
@@ -11,6 +11,12 @@ is based on [Keep a Changelog](https://keepachangelog.com).
to process metrics even when not configuring CAF to export metrics to
to process metrics even when not configuring CAF to export metrics to
Prometheus via HTTP.
Prometheus via HTTP.
### 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
## Fixed
-
Printing a
`config_value`
that contains a zero duration
`timespan`
now
-
Printing a
`config_value`
that contains a zero duration
`timespan`
now
...
...
libcaf_core/caf/const_typed_message_view.hpp
View file @
1855e8e0
...
@@ -21,7 +21,7 @@ public:
...
@@ -21,7 +21,7 @@ public:
}
}
explicit
const_typed_message_view
(
const
message
&
msg
)
noexcept
explicit
const_typed_message_view
(
const
message
&
msg
)
noexcept
:
ptr_
(
msg
.
cptr
()
)
{
:
ptr_
(
msg
.
types
()
==
make_type_id_list
<
Ts
...
>
()
?
msg
.
cptr
()
:
nullptr
)
{
// nop
// nop
}
}
...
@@ -63,9 +63,7 @@ auto to_tuple(const_typed_message_view<Ts...> xs) {
...
@@ -63,9 +63,7 @@ auto to_tuple(const_typed_message_view<Ts...> xs) {
template
<
class
...
Ts
>
template
<
class
...
Ts
>
auto
make_const_typed_message_view
(
const
message
&
msg
)
{
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
...
>
{
msg
};
return
const_typed_message_view
<
Ts
...
>
{};
}
}
template
<
class
...
Ts
>
template
<
class
...
Ts
>
...
...
libcaf_core/caf/typed_message_view.hpp
View file @
1855e8e0
...
@@ -18,7 +18,8 @@ public:
...
@@ -18,7 +18,8 @@ public:
// nop
// 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
// nop
}
}
...
@@ -48,9 +49,7 @@ auto& get(typed_message_view<Ts...> x) {
...
@@ -48,9 +49,7 @@ auto& get(typed_message_view<Ts...> x) {
template
<
class
...
Ts
>
template
<
class
...
Ts
>
auto
make_typed_message_view
(
message
&
msg
)
{
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
...
>
{
msg
};
return
typed_message_view
<
Ts
...
>
{};
}
}
}
// namespace caf
}
// 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