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
01b82717
Commit
01b82717
authored
Jan 16, 2021
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix build on GCC and fix warnings
parent
e07934c8
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
17 additions
and
14 deletions
+17
-14
libcaf_core/caf/detail/behavior_impl.hpp
libcaf_core/caf/detail/behavior_impl.hpp
+1
-1
libcaf_core/caf/detail/profiled_send.hpp
libcaf_core/caf/detail/profiled_send.hpp
+1
-1
libcaf_core/caf/inspector_access.hpp
libcaf_core/caf/inspector_access.hpp
+3
-3
libcaf_core/caf/memory_managed.hpp
libcaf_core/caf/memory_managed.hpp
+3
-1
libcaf_core/caf/meta/type_name.hpp
libcaf_core/caf/meta/type_name.hpp
+1
-0
libcaf_core/src/binary_serializer.cpp
libcaf_core/src/binary_serializer.cpp
+2
-2
libcaf_core/test/stateful_actor.cpp
libcaf_core/test/stateful_actor.cpp
+4
-4
manual/Actors.rst
manual/Actors.rst
+2
-2
No files found.
libcaf_core/caf/detail/behavior_impl.hpp
View file @
01b82717
...
...
@@ -114,7 +114,7 @@ public:
template
<
size_t
...
Is
>
bool
invoke_impl
(
detail
::
invoke_result_visitor
&
f
,
message
&
msg
,
std
::
index_sequence
<
Is
...
>
)
{
auto
dispatch
=
[
&
](
auto
&
fun
)
{
[[
maybe_unused
]]
auto
dispatch
=
[
&
](
auto
&
fun
)
{
using
fun_type
=
std
::
decay_t
<
decltype
(
fun
)
>
;
using
trait
=
get_callable_trait_t
<
fun_type
>
;
auto
arg_types
=
to_type_id_list
<
typename
trait
::
decayed_arg_types
>
();
...
...
libcaf_core/caf/detail/profiled_send.hpp
View file @
01b82717
...
...
@@ -35,7 +35,7 @@ void profiled_send(Self* self, SelfHandle&& src, const Handle& dst,
template
<
class
Self
,
class
SelfHandle
,
class
Handle
,
class
...
Ts
>
void
profiled_send
(
Self
*
self
,
SelfHandle
&&
src
,
const
Handle
&
dst
,
actor_clock
&
clock
,
actor_clock
::
time_point
timeout
,
message_id
msg_id
,
Ts
&&
...
xs
)
{
[[
maybe_unused
]]
message_id
msg_id
,
Ts
&&
...
xs
)
{
if
(
dst
)
{
if
constexpr
(
std
::
is_same
<
Handle
,
group
>::
value
)
{
clock
.
schedule_message
(
timeout
,
dst
,
std
::
forward
<
SelfHandle
>
(
src
),
...
...
libcaf_core/caf/inspector_access.hpp
View file @
01b82717
...
...
@@ -61,8 +61,7 @@ template <class T, class Inspector, class Obj>
class
has_static_apply
{
private:
template
<
class
U
>
static
auto
sfinae
(
Inspector
*
f
,
Obj
*
x
)
->
decltype
(
U
::
apply
(
*
f
,
*
x
),
std
::
true_type
());
static
auto
sfinae
(
Inspector
*
f
,
Obj
*
x
)
->
decltype
(
U
::
apply
(
*
f
,
*
x
));
template
<
class
U
>
static
auto
sfinae
(...)
->
std
::
false_type
;
...
...
@@ -70,7 +69,8 @@ private:
using
sfinae_type
=
decltype
(
sfinae
<
T
>
(
nullptr
,
nullptr
));
public:
static
constexpr
bool
value
=
sfinae_type
::
value
;
static
constexpr
bool
value
=
!
std
::
is_same
<
sfinae_type
,
std
::
false_type
>::
value
;
};
template
<
class
T
,
class
Inspector
,
class
Obj
>
...
...
libcaf_core/caf/memory_managed.hpp
View file @
01b82717
...
...
@@ -8,7 +8,9 @@
namespace
caf
{
class
CAF_CORE_EXPORT
[[
deprecated
]]
memory_managed
{
class
[[
deprecated
]]
memory_managed
;
class
CAF_CORE_EXPORT
memory_managed
{
public:
virtual
void
request_deletion
(
bool
decremented_rc
)
const
noexcept
;
...
...
libcaf_core/caf/meta/type_name.hpp
View file @
01b82717
...
...
@@ -19,4 +19,5 @@ struct type_name_t : annotation {
[[
deprecated
]]
type_name_t
constexpr
type_name
(
const
char
*
cstr
)
{
return
{
cstr
};
}
}
// namespace caf::meta
libcaf_core/src/binary_serializer.cpp
View file @
01b82717
...
...
@@ -66,7 +66,7 @@ constexpr size_t max_value = static_cast<size_t>(std::numeric_limits<T>::max());
bool
binary_serializer
::
begin_field
(
string_view
,
span
<
const
type_id_t
>
types
,
size_t
index
)
{
CAF_ASSERT
(
index
>=
0
&&
index
<
types
.
size
());
CAF_ASSERT
(
index
<
types
.
size
());
if
(
types
.
size
()
<
max_value
<
int8_t
>
)
{
return
value
(
static_cast
<
int8_t
>
(
index
));
}
else
if
(
types
.
size
()
<
max_value
<
int16_t
>
)
{
...
...
@@ -91,7 +91,7 @@ T compress_index(bool is_present, size_t value) {
bool
binary_serializer
::
begin_field
(
string_view
,
bool
is_present
,
span
<
const
type_id_t
>
types
,
size_t
index
)
{
CAF_ASSERT
(
!
is_present
||
(
index
>=
0
&&
index
<
types
.
size
()
));
CAF_ASSERT
(
!
is_present
||
index
<
types
.
size
(
));
if
(
types
.
size
()
<
max_value
<
int8_t
>
)
{
return
value
(
compress_index
<
int8_t
>
(
is_present
,
index
));
}
else
if
(
types
.
size
()
<
max_value
<
int16_t
>
)
{
...
...
libcaf_core/test/stateful_actor.cpp
View file @
01b82717
...
...
@@ -17,7 +17,7 @@ using namespace std::string_literals;
namespace
{
using
typed_adder_actor
=
typed_actor
<
re
acts_to
<
add_atom
,
int
>
,
replies_to
<
get_atom
>::
with
<
int
>
>
;
=
typed_actor
<
re
sult
<
void
>
(
add_atom
,
int
),
result
<
int
>
(
get_atom
)
>
;
struct
counter
{
int
value
=
0
;
...
...
@@ -49,9 +49,9 @@ typed_adder(typed_adder_actor::stateful_pointer<counter> self) {
};
}
class
typed_adder_class
:
public
typed_adder_actor
::
stateful_
base
<
counter
>
{
class
typed_adder_class
:
public
typed_adder_actor
::
stateful_
impl
<
counter
>
{
public:
using
super
=
typed_adder_actor
::
stateful_
base
<
counter
>
;
using
super
=
typed_adder_actor
::
stateful_
impl
<
counter
>
;
typed_adder_class
(
actor_config
&
cfg
)
:
super
(
cfg
)
{
// nop
...
...
@@ -185,7 +185,7 @@ CAF_TEST(typed actors can use typed_actor_pointer as self pointer) {
[
=
](
get_atom
)
{
return
value
;
});
}
};
using
actor_type
=
typed_adder_actor
::
stateful_
base
<
state_type
>
;
using
actor_type
=
typed_adder_actor
::
stateful_
impl
<
state_type
>
;
auto
testee
=
sys
.
spawn
<
actor_type
>
(
10
);
auto
&
state
=
deref
<
actor_type
>
(
testee
).
state
;
CAF_CHECK
(
state
.
self
==
&
deref
<
actor_type
>
(
testee
));
...
...
manual/Actors.rst
View file @
01b82717
...
...
@@ -280,9 +280,9 @@ types shown below to grant access to derived types.
+------------------------+---------------------------------------------------------------+
| ``pointer`` | A pointer of type ``base*``. |
+------------------------+---------------------------------------------------------------+
| ``stateful_
base
<T>`` | See stateful-actor_. |
| ``stateful_
impl
<T>`` | See stateful-actor_. |
+------------------------+---------------------------------------------------------------+
| ``stateful_pointer<T>``| A pointer of type ``stateful_
base
<T>*``. |
| ``stateful_pointer<T>``| A pointer of type ``stateful_
impl
<T>*``. |
+------------------------+---------------------------------------------------------------+
| ``extend<Ts...>`` | Extend this typed actor with ``Ts...``. |
+------------------------+---------------------------------------------------------------+
...
...
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