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
9c66965e
Unverified
Commit
9c66965e
authored
Aug 05, 2021
by
Jakob Otto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include review feedback
parent
13274198
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
34 additions
and
34 deletions
+34
-34
libcaf_core/caf/actor_system.hpp
libcaf_core/caf/actor_system.hpp
+1
-1
libcaf_core/caf/behavior.hpp
libcaf_core/caf/behavior.hpp
+1
-1
libcaf_core/caf/detail/parser/read_floating_point.hpp
libcaf_core/caf/detail/parser/read_floating_point.hpp
+2
-2
libcaf_core/src/actor_system.cpp
libcaf_core/src/actor_system.cpp
+2
-2
libcaf_io/caf/io/abstract_broker.hpp
libcaf_io/caf/io/abstract_broker.hpp
+3
-3
libcaf_io/caf/io/middleman_actor_impl.hpp
libcaf_io/caf/io/middleman_actor_impl.hpp
+3
-3
libcaf_io/src/io/abstract_broker.cpp
libcaf_io/src/io/abstract_broker.cpp
+9
-9
libcaf_io/src/io/basp_broker.cpp
libcaf_io/src/io/basp_broker.cpp
+3
-3
libcaf_io/src/io/middleman_actor_impl.cpp
libcaf_io/src/io/middleman_actor_impl.cpp
+8
-8
libcaf_test/caf/test/dsl.hpp
libcaf_test/caf/test/dsl.hpp
+2
-2
No files found.
libcaf_core/caf/actor_system.hpp
View file @
9c66965e
...
@@ -660,7 +660,7 @@ private:
...
@@ -660,7 +660,7 @@ private:
expected
<
strong_actor_ptr
>
expected
<
strong_actor_ptr
>
dyn_spawn_impl
(
const
std
::
string
&
name
,
message
&
args
,
execution_unit
*
ctx
,
dyn_spawn_impl
(
const
std
::
string
&
name
,
message
&
args
,
execution_unit
*
ctx
,
bool
check_interface
,
std
::
optional
<
const
mpi
*>
expected_ifs
);
bool
check_interface
,
const
mpi
*
expected_ifs
);
/// Sets the internal actor for dynamic spawn operations.
/// Sets the internal actor for dynamic spawn operations.
void
spawn_serv
(
strong_actor_ptr
x
)
{
void
spawn_serv
(
strong_actor_ptr
x
)
{
...
...
libcaf_core/caf/behavior.hpp
View file @
9c66965e
...
@@ -21,7 +21,7 @@ namespace caf {
...
@@ -21,7 +21,7 @@ namespace caf {
class
message_handler
;
class
message_handler
;
/// Describes the behavior of an actor, i.e., provides a message
/// Describes the behavior of an actor, i.e., provides a message
/// handler and an
std::
optional timeout.
/// handler and an optional timeout.
class
CAF_CORE_EXPORT
behavior
{
class
CAF_CORE_EXPORT
behavior
{
public:
public:
friend
class
message_handler
;
friend
class
message_handler
;
...
...
libcaf_core/caf/detail/parser/read_floating_point.hpp
View file @
9c66965e
...
@@ -38,7 +38,7 @@ void read_floating_point(State& ps, Consumer&& consumer,
...
@@ -38,7 +38,7 @@ void read_floating_point(State& ps, Consumer&& consumer,
enum
sign_t
{
plus
,
minus
};
enum
sign_t
{
plus
,
minus
};
sign_t
sign
;
sign_t
sign
;
ValueType
result
;
ValueType
result
;
if
(
start_value
==
std
::
nullopt
)
{
if
(
!
start_value
)
{
sign
=
plus
;
sign
=
plus
;
result
=
0
;
result
=
0
;
}
else
if
(
*
start_value
<
0
)
{
}
else
if
(
*
start_value
<
0
)
{
...
@@ -97,7 +97,7 @@ void read_floating_point(State& ps, Consumer&& consumer,
...
@@ -97,7 +97,7 @@ void read_floating_point(State& ps, Consumer&& consumer,
// Definition of our parser FSM.
// Definition of our parser FSM.
start
();
start
();
unstable_state
(
init
)
{
unstable_state
(
init
)
{
epsilon_if
(
start_value
==
std
::
nullopt
,
regular_init
)
epsilon_if
(
!
start_value
,
regular_init
)
epsilon
(
after_dec
,
"eE."
)
epsilon
(
after_dec
,
"eE."
)
epsilon
(
after_dot
,
any_char
)
epsilon
(
after_dot
,
any_char
)
}
}
...
...
libcaf_core/src/actor_system.cpp
View file @
9c66965e
...
@@ -516,7 +516,7 @@ void actor_system::thread_terminates() {
...
@@ -516,7 +516,7 @@ void actor_system::thread_terminates() {
expected
<
strong_actor_ptr
>
expected
<
strong_actor_ptr
>
actor_system
::
dyn_spawn_impl
(
const
std
::
string
&
name
,
message
&
args
,
actor_system
::
dyn_spawn_impl
(
const
std
::
string
&
name
,
message
&
args
,
execution_unit
*
ctx
,
bool
check_interface
,
execution_unit
*
ctx
,
bool
check_interface
,
std
::
optional
<
const
mpi
*>
expected_ifs
)
{
const
mpi
*
expected_ifs
)
{
CAF_LOG_TRACE
(
CAF_ARG
(
name
)
<<
CAF_ARG
(
args
)
<<
CAF_ARG
(
check_interface
)
CAF_LOG_TRACE
(
CAF_ARG
(
name
)
<<
CAF_ARG
(
args
)
<<
CAF_ARG
(
check_interface
)
<<
CAF_ARG
(
expected_ifs
));
<<
CAF_ARG
(
expected_ifs
));
if
(
name
.
empty
())
if
(
name
.
empty
())
...
@@ -529,7 +529,7 @@ actor_system::dyn_spawn_impl(const std::string& name, message& args,
...
@@ -529,7 +529,7 @@ actor_system::dyn_spawn_impl(const std::string& name, message& args,
auto
res
=
i
->
second
(
cfg
,
args
);
auto
res
=
i
->
second
(
cfg
,
args
);
if
(
!
res
.
first
)
if
(
!
res
.
first
)
return
sec
::
cannot_spawn_actor_from_arguments
;
return
sec
::
cannot_spawn_actor_from_arguments
;
if
(
check_interface
&&
!
assignable
(
res
.
second
,
*
*
expected_ifs
))
if
(
check_interface
&&
!
assignable
(
res
.
second
,
*
expected_ifs
))
return
sec
::
unexpected_actor_messaging_interface
;
return
sec
::
unexpected_actor_messaging_interface
;
return
std
::
move
(
res
.
first
);
return
std
::
move
(
res
.
first
);
}
}
...
...
libcaf_io/caf/io/abstract_broker.hpp
View file @
9c66965e
...
@@ -283,7 +283,7 @@ public:
...
@@ -283,7 +283,7 @@ public:
auto
x
=
by_id
(
hdl
);
auto
x
=
by_id
(
hdl
);
if
(
!
x
)
if
(
!
x
)
return
false
;
return
false
;
(
*
x
)
->
graceful_shutdown
();
x
->
graceful_shutdown
();
return
true
;
return
true
;
}
}
...
@@ -386,11 +386,11 @@ protected:
...
@@ -386,11 +386,11 @@ protected:
/// Returns a `scribe` or `doorman` identified by `hdl`.
/// Returns a `scribe` or `doorman` identified by `hdl`.
template
<
class
Handle
>
template
<
class
Handle
>
auto
by_id
(
Handle
hdl
)
->
std
::
optional
<
decltype
(
ptr_of
(
hdl
))
>
{
auto
by_id
(
Handle
hdl
)
->
decltype
(
ptr_of
(
hdl
))
{
auto
&
elements
=
get_map
(
hdl
);
auto
&
elements
=
get_map
(
hdl
);
auto
i
=
elements
.
find
(
hdl
);
auto
i
=
elements
.
find
(
hdl
);
if
(
i
==
elements
.
end
())
if
(
i
==
elements
.
end
())
return
std
::
nullopt
;
return
nullptr
;
return
std
::
addressof
(
*
(
i
->
second
));
return
std
::
addressof
(
*
(
i
->
second
));
}
}
...
...
libcaf_io/caf/io/middleman_actor_impl.hpp
View file @
9c66965e
...
@@ -73,10 +73,10 @@ private:
...
@@ -73,10 +73,10 @@ private:
put_res
put_udp
(
uint16_t
port
,
strong_actor_ptr
&
whom
,
mpi_set
&
sigs
,
put_res
put_udp
(
uint16_t
port
,
strong_actor_ptr
&
whom
,
mpi_set
&
sigs
,
const
char
*
in
=
nullptr
,
bool
reuse_addr
=
false
);
const
char
*
in
=
nullptr
,
bool
reuse_addr
=
false
);
std
::
optional
<
endpoint_data
*>
cached_tcp
(
const
endpoint
&
ep
);
endpoint_data
*
cached_tcp
(
const
endpoint
&
ep
);
std
::
optional
<
endpoint_data
*>
cached_udp
(
const
endpoint
&
ep
);
endpoint_data
*
cached_udp
(
const
endpoint
&
ep
);
std
::
optional
<
std
::
vector
<
response_promise
>*>
pending
(
const
endpoint
&
ep
);
std
::
vector
<
response_promise
>*
pending
(
const
endpoint
&
ep
);
actor
broker_
;
actor
broker_
;
std
::
map
<
endpoint
,
endpoint_data
>
cached_tcp_
;
std
::
map
<
endpoint
,
endpoint_data
>
cached_tcp_
;
...
...
libcaf_io/src/io/abstract_broker.cpp
View file @
9c66965e
...
@@ -59,19 +59,19 @@ void abstract_broker::configure_read(connection_handle hdl,
...
@@ -59,19 +59,19 @@ void abstract_broker::configure_read(connection_handle hdl,
receive_policy
::
config
cfg
)
{
receive_policy
::
config
cfg
)
{
CAF_LOG_TRACE
(
CAF_ARG
(
hdl
)
<<
CAF_ARG
(
cfg
));
CAF_LOG_TRACE
(
CAF_ARG
(
hdl
)
<<
CAF_ARG
(
cfg
));
if
(
auto
x
=
by_id
(
hdl
))
if
(
auto
x
=
by_id
(
hdl
))
(
*
x
)
->
configure_read
(
cfg
);
x
->
configure_read
(
cfg
);
}
}
void
abstract_broker
::
ack_writes
(
connection_handle
hdl
,
bool
enable
)
{
void
abstract_broker
::
ack_writes
(
connection_handle
hdl
,
bool
enable
)
{
CAF_LOG_TRACE
(
CAF_ARG
(
hdl
)
<<
CAF_ARG
(
enable
));
CAF_LOG_TRACE
(
CAF_ARG
(
hdl
)
<<
CAF_ARG
(
enable
));
if
(
auto
x
=
by_id
(
hdl
))
if
(
auto
x
=
by_id
(
hdl
))
(
*
x
)
->
ack_writes
(
enable
);
x
->
ack_writes
(
enable
);
}
}
byte_buffer
&
abstract_broker
::
wr_buf
(
connection_handle
hdl
)
{
byte_buffer
&
abstract_broker
::
wr_buf
(
connection_handle
hdl
)
{
CAF_ASSERT
(
hdl
!=
invalid_connection_handle
);
CAF_ASSERT
(
hdl
!=
invalid_connection_handle
);
if
(
auto
x
=
by_id
(
hdl
))
{
if
(
auto
x
=
by_id
(
hdl
))
{
return
(
*
x
)
->
wr_buf
();
return
x
->
wr_buf
();
}
else
{
}
else
{
CAF_LOG_ERROR
(
"tried to access wr_buf() of an unknown connection_handle:"
CAF_LOG_ERROR
(
"tried to access wr_buf() of an unknown connection_handle:"
<<
CAF_ARG
(
hdl
));
<<
CAF_ARG
(
hdl
));
...
@@ -92,18 +92,18 @@ void abstract_broker::write(connection_handle hdl, span<const byte> buf) {
...
@@ -92,18 +92,18 @@ void abstract_broker::write(connection_handle hdl, span<const byte> buf) {
void
abstract_broker
::
flush
(
connection_handle
hdl
)
{
void
abstract_broker
::
flush
(
connection_handle
hdl
)
{
if
(
auto
x
=
by_id
(
hdl
))
if
(
auto
x
=
by_id
(
hdl
))
(
*
x
)
->
flush
();
x
->
flush
();
}
}
void
abstract_broker
::
ack_writes
(
datagram_handle
hdl
,
bool
enable
)
{
void
abstract_broker
::
ack_writes
(
datagram_handle
hdl
,
bool
enable
)
{
CAF_LOG_TRACE
(
CAF_ARG
(
hdl
)
<<
CAF_ARG
(
enable
));
CAF_LOG_TRACE
(
CAF_ARG
(
hdl
)
<<
CAF_ARG
(
enable
));
if
(
auto
x
=
by_id
(
hdl
))
if
(
auto
x
=
by_id
(
hdl
))
(
*
x
)
->
ack_writes
(
enable
);
x
->
ack_writes
(
enable
);
}
}
byte_buffer
&
abstract_broker
::
wr_buf
(
datagram_handle
hdl
)
{
byte_buffer
&
abstract_broker
::
wr_buf
(
datagram_handle
hdl
)
{
if
(
auto
x
=
by_id
(
hdl
))
{
if
(
auto
x
=
by_id
(
hdl
))
{
return
(
*
x
)
->
wr_buf
(
hdl
);
return
x
->
wr_buf
(
hdl
);
}
else
{
}
else
{
CAF_LOG_ERROR
(
"tried to access wr_buf() of an unknown"
CAF_LOG_ERROR
(
"tried to access wr_buf() of an unknown"
"datagram_handle"
);
"datagram_handle"
);
...
@@ -113,7 +113,7 @@ byte_buffer& abstract_broker::wr_buf(datagram_handle hdl) {
...
@@ -113,7 +113,7 @@ byte_buffer& abstract_broker::wr_buf(datagram_handle hdl) {
void
abstract_broker
::
enqueue_datagram
(
datagram_handle
hdl
,
byte_buffer
buf
)
{
void
abstract_broker
::
enqueue_datagram
(
datagram_handle
hdl
,
byte_buffer
buf
)
{
if
(
auto
x
=
by_id
(
hdl
))
if
(
auto
x
=
by_id
(
hdl
))
(
*
x
)
->
enqueue_datagram
(
hdl
,
std
::
move
(
buf
));
x
->
enqueue_datagram
(
hdl
,
std
::
move
(
buf
));
else
else
CAF_LOG_ERROR
(
"tried to access datagram_buffer() of an unknown"
CAF_LOG_ERROR
(
"tried to access datagram_buffer() of an unknown"
"datagram_handle"
);
"datagram_handle"
);
...
@@ -128,7 +128,7 @@ void abstract_broker::write(datagram_handle hdl, size_t bs, const void* buf) {
...
@@ -128,7 +128,7 @@ void abstract_broker::write(datagram_handle hdl, size_t bs, const void* buf) {
void
abstract_broker
::
flush
(
datagram_handle
hdl
)
{
void
abstract_broker
::
flush
(
datagram_handle
hdl
)
{
if
(
auto
x
=
by_id
(
hdl
))
if
(
auto
x
=
by_id
(
hdl
))
(
*
x
)
->
flush
();
x
->
flush
();
}
}
std
::
vector
<
connection_handle
>
abstract_broker
::
connections
()
const
{
std
::
vector
<
connection_handle
>
abstract_broker
::
connections
()
const
{
...
@@ -316,7 +316,7 @@ uint16_t abstract_broker::local_port(datagram_handle hdl) {
...
@@ -316,7 +316,7 @@ uint16_t abstract_broker::local_port(datagram_handle hdl) {
bool
abstract_broker
::
remove_endpoint
(
datagram_handle
hdl
)
{
bool
abstract_broker
::
remove_endpoint
(
datagram_handle
hdl
)
{
if
(
auto
x
=
by_id
(
hdl
))
{
if
(
auto
x
=
by_id
(
hdl
))
{
(
*
x
)
->
remove_endpoint
(
hdl
);
x
->
remove_endpoint
(
hdl
);
return
true
;
return
true
;
}
else
{
}
else
{
return
false
;
return
false
;
...
...
libcaf_io/src/io/basp_broker.cpp
View file @
9c66965e
...
@@ -191,7 +191,7 @@ behavior basp_broker::make_behavior() {
...
@@ -191,7 +191,7 @@ behavior basp_broker::make_behavior() {
return
;
return
;
}
}
auto
route
=
instance
.
tbl
().
lookup
(
proxy
->
node
());
auto
route
=
instance
.
tbl
().
lookup
(
proxy
->
node
());
if
(
route
==
std
::
nullopt
)
{
if
(
!
route
)
{
CAF_LOG_DEBUG
(
"connection to origin already lost, kill proxy"
);
CAF_LOG_DEBUG
(
"connection to origin already lost, kill proxy"
);
instance
.
proxies
().
erase
(
proxy
->
node
(),
proxy
->
id
());
instance
.
proxies
().
erase
(
proxy
->
node
(),
proxy
->
id
());
return
;
return
;
...
@@ -217,7 +217,7 @@ behavior basp_broker::make_behavior() {
...
@@ -217,7 +217,7 @@ behavior basp_broker::make_behavior() {
}
}
// Check whether the node is still connected at the moment and send the
// Check whether the node is still connected at the moment and send the
// observer a message immediately otherwise.
// observer a message immediately otherwise.
if
(
instance
.
tbl
().
lookup
(
node
)
==
std
::
nullopt
)
{
if
(
!
instance
.
tbl
().
lookup
(
node
)
)
{
if
(
auto
hdl
=
actor_cast
<
actor
>
(
observer
))
{
if
(
auto
hdl
=
actor_cast
<
actor
>
(
observer
))
{
// TODO: we might want to consider keeping the exit reason for nodes,
// TODO: we might want to consider keeping the exit reason for nodes,
// at least for some time. Otherwise, we'll have to send a
// at least for some time. Otherwise, we'll have to send a
...
@@ -472,7 +472,7 @@ void basp_broker::finalize_handshake(const node_id& nid, actor_id aid,
...
@@ -472,7 +472,7 @@ void basp_broker::finalize_handshake(const node_id& nid, actor_id aid,
CAF_ASSERT
(
this_context
!=
nullptr
);
CAF_ASSERT
(
this_context
!=
nullptr
);
this_context
->
id
=
nid
;
this_context
->
id
=
nid
;
auto
&
cb
=
this_context
->
callback
;
auto
&
cb
=
this_context
->
callback
;
if
(
cb
==
std
::
nullopt
)
if
(
!
cb
)
return
;
return
;
strong_actor_ptr
ptr
;
strong_actor_ptr
ptr
;
// aid can be invalid when connecting to the default port of a node
// aid can be invalid when connecting to the default port of a node
...
...
libcaf_io/src/io/middleman_actor_impl.cpp
View file @
9c66965e
...
@@ -79,14 +79,14 @@ auto middleman_actor_impl::make_behavior() -> behavior_type {
...
@@ -79,14 +79,14 @@ auto middleman_actor_impl::make_behavior() -> behavior_type {
auto
x
=
cached_tcp
(
key
);
auto
x
=
cached_tcp
(
key
);
if
(
x
)
{
if
(
x
)
{
CAF_LOG_DEBUG
(
"found cached entry"
<<
CAF_ARG
(
*
x
));
CAF_LOG_DEBUG
(
"found cached entry"
<<
CAF_ARG
(
*
x
));
rp
.
deliver
(
get
<
0
>
(
*
*
x
),
get
<
1
>
(
**
x
),
get
<
2
>
(
*
*
x
));
rp
.
deliver
(
get
<
0
>
(
*
x
),
get
<
1
>
(
*
x
),
get
<
2
>
(
*
x
));
return
get_delegated
{};
return
get_delegated
{};
}
}
// attach this promise to a pending request if possible
// attach this promise to a pending request if possible
auto
rps
=
pending
(
key
);
auto
rps
=
pending
(
key
);
if
(
rps
)
{
if
(
rps
)
{
CAF_LOG_DEBUG
(
"attach to pending request"
);
CAF_LOG_DEBUG
(
"attach to pending request"
);
(
*
rps
)
->
emplace_back
(
std
::
move
(
rp
));
rps
->
emplace_back
(
std
::
move
(
rp
));
return
get_delegated
{};
return
get_delegated
{};
}
}
// connect to endpoint and initiate handhsake etc.
// connect to endpoint and initiate handhsake etc.
...
@@ -216,28 +216,28 @@ middleman_actor_impl::put_udp(uint16_t port, strong_actor_ptr& whom,
...
@@ -216,28 +216,28 @@ middleman_actor_impl::put_udp(uint16_t port, strong_actor_ptr& whom,
return
actual_port
;
return
actual_port
;
}
}
std
::
optional
<
middleman_actor_impl
::
endpoint_data
*>
middleman_actor_impl
::
endpoint_data
*
middleman_actor_impl
::
cached_tcp
(
const
endpoint
&
ep
)
{
middleman_actor_impl
::
cached_tcp
(
const
endpoint
&
ep
)
{
auto
i
=
cached_tcp_
.
find
(
ep
);
auto
i
=
cached_tcp_
.
find
(
ep
);
if
(
i
!=
cached_tcp_
.
end
())
if
(
i
!=
cached_tcp_
.
end
())
return
std
::
addressof
(
i
->
second
);
return
std
::
addressof
(
i
->
second
);
return
std
::
nullopt
;
return
nullptr
;
}
}
std
::
optional
<
middleman_actor_impl
::
endpoint_data
*>
middleman_actor_impl
::
endpoint_data
*
middleman_actor_impl
::
cached_udp
(
const
endpoint
&
ep
)
{
middleman_actor_impl
::
cached_udp
(
const
endpoint
&
ep
)
{
auto
i
=
cached_udp_
.
find
(
ep
);
auto
i
=
cached_udp_
.
find
(
ep
);
if
(
i
!=
cached_udp_
.
end
())
if
(
i
!=
cached_udp_
.
end
())
return
std
::
addressof
(
i
->
second
);
return
std
::
addressof
(
i
->
second
);
return
std
::
nullopt
;
return
nullptr
;
}
}
std
::
optional
<
std
::
vector
<
response_promise
>*>
std
::
vector
<
response_promise
>*
middleman_actor_impl
::
pending
(
const
endpoint
&
ep
)
{
middleman_actor_impl
::
pending
(
const
endpoint
&
ep
)
{
auto
i
=
pending_
.
find
(
ep
);
auto
i
=
pending_
.
find
(
ep
);
if
(
i
!=
pending_
.
end
())
if
(
i
!=
pending_
.
end
())
return
std
::
addressof
(
i
->
second
);
return
std
::
addressof
(
i
->
second
);
return
std
::
nullopt
;
return
nullptr
;
}
}
expected
<
scribe_ptr
>
middleman_actor_impl
::
connect
(
const
std
::
string
&
host
,
expected
<
scribe_ptr
>
middleman_actor_impl
::
connect
(
const
std
::
string
&
host
,
...
...
libcaf_test/caf/test/dsl.hpp
View file @
9c66965e
...
@@ -229,7 +229,7 @@ std::optional<std::tuple<Ts...>> default_extract(caf_handle x) {
...
@@ -229,7 +229,7 @@ std::optional<std::tuple<Ts...>> default_extract(caf_handle x) {
template
<
class
T
>
template
<
class
T
>
std
::
optional
<
std
::
tuple
<
T
>>
unboxing_extract
(
caf_handle
x
)
{
std
::
optional
<
std
::
tuple
<
T
>>
unboxing_extract
(
caf_handle
x
)
{
auto
tup
=
default_extract
<
typename
T
::
outer_type
>
(
x
);
auto
tup
=
default_extract
<
typename
T
::
outer_type
>
(
x
);
if
(
tup
==
std
::
nullopt
||
!
is
<
T
>
(
get
<
0
>
(
*
tup
)))
if
(
!
tup
||
!
is
<
T
>
(
get
<
0
>
(
*
tup
)))
return
std
::
nullopt
;
return
std
::
nullopt
;
return
std
::
make_tuple
(
get
<
T
>
(
get
<
0
>
(
*
tup
)));
return
std
::
make_tuple
(
get
<
T
>
(
get
<
0
>
(
*
tup
)));
}
}
...
@@ -266,7 +266,7 @@ std::optional<std::tuple<T, Ts...>> try_extract(caf_handle x) {
...
@@ -266,7 +266,7 @@ std::optional<std::tuple<T, Ts...>> try_extract(caf_handle x) {
template
<
class
T
,
class
...
Ts
>
template
<
class
T
,
class
...
Ts
>
std
::
tuple
<
T
,
Ts
...
>
extract
(
caf_handle
x
)
{
std
::
tuple
<
T
,
Ts
...
>
extract
(
caf_handle
x
)
{
auto
result
=
try_extract
<
T
,
Ts
...
>
(
x
);
auto
result
=
try_extract
<
T
,
Ts
...
>
(
x
);
if
(
result
==
std
::
nullop
t
)
{
if
(
!
resul
t
)
{
auto
ptr
=
x
->
peek_at_next_mailbox_element
();
auto
ptr
=
x
->
peek_at_next_mailbox_element
();
if
(
ptr
==
nullptr
)
if
(
ptr
==
nullptr
)
CAF_FAIL
(
"Mailbox is empty"
);
CAF_FAIL
(
"Mailbox is empty"
);
...
...
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