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
c4a54050
Commit
c4a54050
authored
Dec 20, 2014
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix shadowing warnings
parent
fd0c18e2
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
73 additions
and
72 deletions
+73
-72
libcaf_core/caf/detail/proper_actor.hpp
libcaf_core/caf/detail/proper_actor.hpp
+5
-5
libcaf_core/caf/local_actor.hpp
libcaf_core/caf/local_actor.hpp
+2
-2
libcaf_core/caf/scheduler/worker.hpp
libcaf_core/caf/scheduler/worker.hpp
+4
-4
libcaf_core/src/abstract_group.cpp
libcaf_core/src/abstract_group.cpp
+1
-1
libcaf_core/src/exception.cpp
libcaf_core/src/exception.cpp
+2
-2
libcaf_core/src/forwarding_actor_proxy.cpp
libcaf_core/src/forwarding_actor_proxy.cpp
+3
-3
libcaf_core/src/group.cpp
libcaf_core/src/group.cpp
+1
-1
libcaf_core/src/local_actor.cpp
libcaf_core/src/local_actor.cpp
+12
-12
libcaf_core/src/message.cpp
libcaf_core/src/message.cpp
+1
-1
libcaf_core/src/message_iterator.cpp
libcaf_core/src/message_iterator.cpp
+2
-2
libcaf_core/src/uniform_type_info.cpp
libcaf_core/src/uniform_type_info.cpp
+2
-2
libcaf_core/src/uniform_type_info_map.cpp
libcaf_core/src/uniform_type_info_map.cpp
+3
-3
libcaf_io/caf/io/network/default_multiplexer.hpp
libcaf_io/caf/io/network/default_multiplexer.hpp
+15
-15
libcaf_io/src/broker.cpp
libcaf_io/src/broker.cpp
+7
-6
libcaf_io/src/default_multiplexer.cpp
libcaf_io/src/default_multiplexer.cpp
+9
-9
unit_testing/test_sync_send.cpp
unit_testing/test_sync_send.cpp
+4
-4
No files found.
libcaf_core/caf/detail/proper_actor.hpp
View file @
c4a54050
...
...
@@ -64,10 +64,10 @@ class proper_actor_base : public Policies::resume_policy::template
scheduling_policy
().
enqueue
(
dptr
(),
sender
,
mid
,
msg
,
eu
);
}
inline
void
launch
(
bool
hide
,
bool
lazy
,
execution_unit
*
host
)
{
inline
void
launch
(
bool
hide
,
bool
lazy
,
execution_unit
*
eu
)
{
CAF_LOG_TRACE
(
""
);
this
->
is_registered
(
!
hide
);
this
->
scheduling_policy
().
launch
(
this
,
host
,
lazy
);
this
->
scheduling_policy
().
launch
(
this
,
eu
,
lazy
);
}
template
<
class
F
>
...
...
@@ -255,17 +255,17 @@ class proper_actor<Base, Policies, true>
}
restore_cache
();
}
bool
has_timeout
=
false
;
bool
timeout_valid
=
false
;
uint32_t
timeout_id
;
// request timeout if needed
if
(
bhvr
.
timeout
().
valid
())
{
has_timeout
=
true
;
timeout_valid
=
true
;
timeout_id
=
this
->
request_timeout
(
bhvr
.
timeout
());
}
// workaround for GCC 4.7 bug (const this when capturing refs)
auto
&
pending_timeouts
=
m_pending_timeouts
;
auto
guard
=
detail
::
make_scope_guard
([
&
]
{
if
(
has_timeout
)
{
if
(
timeout_valid
)
{
auto
e
=
pending_timeouts
.
end
();
auto
i
=
std
::
find
(
pending_timeouts
.
begin
(),
e
,
timeout_id
);
if
(
i
!=
e
)
{
...
...
libcaf_core/caf/local_actor.hpp
View file @
c4a54050
...
...
@@ -504,8 +504,8 @@ class local_actor : public extend<abstract_actor>::with<mixin::memory_cached> {
// returns 0 if last_dequeued() is an asynchronous or sync request message,
// a response id generated from the request id otherwise
inline
message_id
get_response_id
()
{
auto
id
=
m_current_node
->
mid
;
return
(
id
.
is_request
())
?
id
.
response_id
()
:
message_id
();
auto
m
id
=
m_current_node
->
mid
;
return
(
mid
.
is_request
())
?
m
id
.
response_id
()
:
message_id
();
}
void
reply_message
(
message
&&
what
);
...
...
libcaf_core/caf/scheduler/worker.hpp
View file @
c4a54050
...
...
@@ -43,10 +43,10 @@ class worker : public execution_unit {
using
coordinator_ptr
=
coordinator
<
Policy
>*
;
using
policy_data
=
typename
Policy
::
worker_data
;
worker
(
size_t
id
,
coordinator_ptr
parent
,
size_t
max_
throughput
)
:
m_max_throughput
(
max_
throughput
),
m_id
(
id
),
m_parent
(
parent
)
{
worker
(
size_t
worker_id
,
coordinator_ptr
worker_parent
,
size_t
throughput
)
:
m_max_throughput
(
throughput
),
m_id
(
worker_
id
),
m_parent
(
worker_
parent
)
{
// nop
}
...
...
libcaf_core/src/abstract_group.cpp
View file @
c4a54050
...
...
@@ -44,7 +44,7 @@ bool abstract_group::subscription::matches(const token& what) {
return
ot
.
group
==
m_group
;
}
abstract_group
::
module
::
module
(
std
::
string
name
)
:
m_name
(
std
::
move
(
name
))
{
abstract_group
::
module
::
module
(
std
::
string
mname
)
:
m_name
(
std
::
move
(
m
name
))
{
// nop
}
...
...
libcaf_core/src/exception.cpp
View file @
c4a54050
...
...
@@ -64,8 +64,8 @@ actor_exited::~actor_exited() noexcept {
// nop
}
actor_exited
::
actor_exited
(
uint32_t
r
eason
)
:
caf_exception
(
ae_what
(
reaso
n
))
{
m_reason
=
r
easo
n
;
actor_exited
::
actor_exited
(
uint32_t
r
sn
)
:
caf_exception
(
ae_what
(
rs
n
))
{
m_reason
=
r
s
n
;
}
network_error
::
network_error
(
const
std
::
string
&
str
)
:
super
(
str
)
{
...
...
libcaf_core/src/forwarding_actor_proxy.cpp
View file @
c4a54050
...
...
@@ -30,10 +30,10 @@ using namespace std;
namespace
caf
{
forwarding_actor_proxy
::
forwarding_actor_proxy
(
actor_id
aid
,
node_id
nid
,
actor
m
anage
r
)
actor
m
g
r
)
:
actor_proxy
(
aid
,
nid
),
m_manager
(
m
anage
r
)
{
CAF_REQUIRE
(
m
anage
r
!=
invalid_actor
);
m_manager
(
m
g
r
)
{
CAF_REQUIRE
(
m
g
r
!=
invalid_actor
);
CAF_LOG_INFO
(
CAF_ARG
(
aid
)
<<
", "
<<
CAF_TARG
(
nid
,
to_string
));
}
...
...
libcaf_core/src/group.cpp
View file @
c4a54050
...
...
@@ -30,7 +30,7 @@ group::group(const invalid_group_t&) : m_ptr(nullptr) {
// nop
}
group
::
group
(
abstract_group_ptr
ptr
)
:
m_ptr
(
std
::
move
(
ptr
))
{
group
::
group
(
abstract_group_ptr
gptr
)
:
m_ptr
(
std
::
move
(
g
ptr
))
{
// nop
}
...
...
libcaf_core/src/local_actor.cpp
View file @
c4a54050
...
...
@@ -103,13 +103,13 @@ void local_actor::reply_message(message&& what) {
if
(
!
whom
)
{
return
;
}
auto
&
id
=
m_current_node
->
mid
;
if
(
id
.
valid
()
==
false
||
id
.
is_response
())
{
auto
&
m
id
=
m_current_node
->
mid
;
if
(
mid
.
valid
()
==
false
||
m
id
.
is_response
())
{
send_tuple
(
actor_cast
<
channel
>
(
whom
),
std
::
move
(
what
));
}
else
if
(
!
id
.
is_answered
())
{
}
else
if
(
!
m
id
.
is_answered
())
{
auto
ptr
=
actor_cast
<
actor
>
(
whom
);
ptr
->
enqueue
(
address
(),
id
.
response_id
(),
std
::
move
(
what
),
host
());
id
.
mark_as_answered
();
ptr
->
enqueue
(
address
(),
m
id
.
response_id
(),
std
::
move
(
what
),
host
());
m
id
.
mark_as_answered
();
}
}
...
...
@@ -117,10 +117,10 @@ void local_actor::forward_message(const actor& dest, message_priority prio) {
if
(
!
dest
)
{
return
;
}
auto
id
=
(
prio
==
message_priority
::
high
)
?
m_current_node
->
mid
.
with_high_priority
()
:
m_current_node
->
mid
.
with_normal_priority
();
dest
->
enqueue
(
m_current_node
->
sender
,
id
,
m_current_node
->
msg
,
host
());
auto
m
id
=
(
prio
==
message_priority
::
high
)
?
m_current_node
->
mid
.
with_high_priority
()
:
m_current_node
->
mid
.
with_normal_priority
();
dest
->
enqueue
(
m_current_node
->
sender
,
m
id
,
m_current_node
->
msg
,
host
());
// treat this message as asynchronous message from now on
m_current_node
->
mid
=
invalid_message_id
;
}
...
...
@@ -130,11 +130,11 @@ void local_actor::send_tuple(message_priority prio, const channel& dest,
if
(
!
dest
)
{
return
;
}
message_id
id
;
message_id
m
id
;
if
(
prio
==
message_priority
::
high
)
{
id
=
id
.
with_high_priority
();
mid
=
m
id
.
with_high_priority
();
}
dest
->
enqueue
(
address
(),
id
,
std
::
move
(
what
),
host
());
dest
->
enqueue
(
address
(),
m
id
,
std
::
move
(
what
),
host
());
}
void
local_actor
::
send_exit
(
const
actor_addr
&
whom
,
uint32_t
reason
)
{
...
...
libcaf_core/src/message.cpp
View file @
c4a54050
...
...
@@ -33,7 +33,7 @@ message::message(message&& other) : m_vals(std::move(other.m_vals)) {
// nop
}
message
::
message
(
const
data_ptr
&
vals
)
:
m_vals
(
vals
)
{
message
::
message
(
const
data_ptr
&
ptr
)
:
m_vals
(
ptr
)
{
// nop
}
...
...
libcaf_core/src/message_iterator.cpp
View file @
c4a54050
...
...
@@ -24,9 +24,9 @@
namespace
caf
{
namespace
detail
{
message_iterator
::
message_iterator
(
const_pointer
data
,
size_t
pos
)
message_iterator
::
message_iterator
(
const_pointer
data
ptr
,
size_t
pos
)
:
m_pos
(
pos
),
m_data
(
data
)
{
m_data
(
data
ptr
)
{
// nop
}
...
...
libcaf_core/src/uniform_type_info.cpp
View file @
c4a54050
...
...
@@ -87,9 +87,9 @@ const uniform_type_info* uniform_type_info::from(const std::string& name) {
return
result
;
}
uniform_value
uniform_type_info
::
deserialize
(
deserializer
*
from
)
const
{
uniform_value
uniform_type_info
::
deserialize
(
deserializer
*
src
)
const
{
auto
uval
=
create
();
deserialize
(
uval
->
val
,
from
);
deserialize
(
uval
->
val
,
src
);
return
std
::
move
(
uval
);
}
...
...
libcaf_core/src/uniform_type_info_map.cpp
View file @
c4a54050
...
...
@@ -600,10 +600,10 @@ protected:
class
default_meta_message
:
public
uniform_type_info
{
public:
default_meta_message
(
const
std
::
string
&
name
)
{
m_name
=
name
;
default_meta_message
(
const
std
::
string
&
t
name
)
{
m_name
=
t
name
;
std
::
vector
<
std
::
string
>
elements
;
split
(
elements
,
name
,
is_any_of
(
"+"
));
split
(
elements
,
t
name
,
is_any_of
(
"+"
));
auto
uti_map
=
detail
::
singletons
::
get_uniform_type_info_map
();
CAF_REQUIRE
(
elements
.
size
()
>
0
&&
elements
.
front
()
==
"@<>"
);
// ignore first element, because it's always "@<>"
...
...
libcaf_io/caf/io/network/default_multiplexer.hpp
View file @
c4a54050
...
...
@@ -246,8 +246,8 @@ class event_handler {
/**
* Sets the bit field storing the subscribed events.
*/
inline
void
eventbf
(
int
eventbf
)
{
m_eventbf
=
eventbf
;
inline
void
eventbf
(
int
value
)
{
m_eventbf
=
value
;
}
/**
...
...
@@ -442,9 +442,9 @@ class stream : public event_handler {
*/
using
buffer_type
=
std
::
vector
<
char
>
;
stream
(
default_multiplexer
&
backend
)
:
event_handler
(
backend
),
m_sock
(
backend
),
stream
(
default_multiplexer
&
backend
_ref
)
:
event_handler
(
backend
_ref
),
m_sock
(
backend
_ref
),
m_writing
(
false
)
{
configure_read
(
receive_policy
::
at_most
(
1024
));
}
...
...
@@ -466,8 +466,8 @@ class stream : public event_handler {
/**
* Initializes this stream, setting the socket handle to `fd`.
*/
void
init
(
Socket
fd
)
{
m_sock
=
std
::
move
(
fd
);
void
init
(
Socket
sock
fd
)
{
m_sock
=
std
::
move
(
sock
fd
);
}
/**
...
...
@@ -681,10 +681,10 @@ class acceptor : public event_handler {
*/
using
manager_ptr
=
intrusive_ptr
<
manager_type
>
;
acceptor
(
default_multiplexer
&
backend
)
:
event_handler
(
backend
),
m_accept_sock
(
backend
),
m_sock
(
backend
)
{
acceptor
(
default_multiplexer
&
backend
_ref
)
:
event_handler
(
backend
_ref
),
m_accept_sock
(
backend
_ref
),
m_sock
(
backend
_ref
)
{
// nop
}
...
...
@@ -737,10 +737,10 @@ class acceptor : public event_handler {
CAF_LOG_TRACE
(
"m_accept_sock.fd = "
<<
m_accept_sock
.
fd
()
<<
", op = "
<<
static_cast
<
int
>
(
op
));
if
(
m_mgr
&&
op
==
operation
::
read
)
{
native_socket
fd
=
invalid_native_socket
;
if
(
try_accept
(
fd
,
m_accept_sock
.
fd
()))
{
if
(
fd
!=
invalid_native_socket
)
{
m_sock
=
socket_type
{
backend
(),
fd
};
native_socket
sock
fd
=
invalid_native_socket
;
if
(
try_accept
(
sock
fd
,
m_accept_sock
.
fd
()))
{
if
(
sock
fd
!=
invalid_native_socket
)
{
m_sock
=
socket_type
{
backend
(),
sock
fd
};
m_mgr
->
new_connection
();
}
}
...
...
libcaf_io/src/broker.cpp
View file @
c4a54050
...
...
@@ -62,8 +62,9 @@ void broker::servant::disconnect(bool invoke_disconnect_message) {
}
}
broker
::
scribe
::
scribe
(
broker
*
parent
,
connection_handle
hdl
)
:
servant
(
parent
),
m_hdl
(
hdl
)
{
broker
::
scribe
::
scribe
(
broker
*
ptr
,
connection_handle
conn_hdl
)
:
servant
(
ptr
),
m_hdl
(
conn_hdl
)
{
std
::
vector
<
char
>
tmp
;
m_read_msg
=
make_message
(
new_data_msg
{
m_hdl
,
std
::
move
(
tmp
)});
}
...
...
@@ -100,8 +101,8 @@ void broker::scribe::io_failure(network::operation op) {
disconnect
(
true
);
}
broker
::
doorman
::
doorman
(
broker
*
p
arent
,
accept_handle
hdl
)
:
servant
(
p
arent
),
m_hdl
(
hdl
)
{
broker
::
doorman
::
doorman
(
broker
*
p
tr
,
accept_handle
acc_
hdl
)
:
servant
(
p
tr
),
m_hdl
(
acc_
hdl
)
{
auto
hdl2
=
connection_handle
::
from_int
(
-
1
);
m_accept_msg
=
make_message
(
new_connection_msg
{
m_hdl
,
hdl2
});
}
...
...
@@ -334,8 +335,8 @@ void broker::close_all() {
std
::
vector
<
connection_handle
>
broker
::
connections
()
const
{
std
::
vector
<
connection_handle
>
result
;
for
(
auto
&
scribe
:
m_scribes
)
{
result
.
push_back
(
scribe
.
first
);
for
(
auto
&
kvp
:
m_scribes
)
{
result
.
push_back
(
kvp
.
first
);
}
return
result
;
}
...
...
libcaf_io/src/default_multiplexer.cpp
View file @
c4a54050
...
...
@@ -676,8 +676,8 @@ connection_handle default_multiplexer::add_tcp_scribe(broker* self,
CAF_LOG_TRACE
(
""
);
class
impl
:
public
broker
::
scribe
{
public:
impl
(
broker
*
p
arent
,
default_socket
&&
s
)
:
scribe
(
p
arent
,
network
::
conn_hdl_from_socket
(
s
)),
impl
(
broker
*
p
tr
,
default_socket
&&
s
)
:
scribe
(
p
tr
,
network
::
conn_hdl_from_socket
(
s
)),
m_launched
(
false
),
m_stream
(
s
.
backend
())
{
m_stream
.
init
(
std
::
move
(
s
));
...
...
@@ -723,8 +723,8 @@ accept_handle default_multiplexer::add_tcp_doorman(broker* self,
CAF_REQUIRE
(
sock
.
fd
()
!=
network
::
invalid_native_socket
);
class
impl
:
public
broker
::
doorman
{
public:
impl
(
broker
*
p
arent
,
default_socket_acceptor
&&
s
)
:
doorman
(
p
arent
,
network
::
accept_hdl_from_socket
(
s
)),
impl
(
broker
*
p
tr
,
default_socket_acceptor
&&
s
)
:
doorman
(
p
tr
,
network
::
accept_hdl_from_socket
(
s
)),
m_acceptor
(
s
.
backend
())
{
m_acceptor
.
init
(
std
::
move
(
s
));
}
...
...
@@ -861,11 +861,11 @@ event_handler::~event_handler() {
// nop
}
default_socket
::
default_socket
(
default_multiplexer
&
parent
,
native_socket
fd
)
:
m_parent
(
parent
),
m_fd
(
fd
)
{
CAF_LOG_TRACE
(
CAF_ARG
(
fd
));
if
(
fd
!=
invalid_native_socket
)
{
default_socket
::
default_socket
(
default_multiplexer
&
ref
,
native_socket
sock
fd
)
:
m_parent
(
ref
),
m_fd
(
sock
fd
)
{
CAF_LOG_TRACE
(
CAF_ARG
(
sock
fd
));
if
(
sock
fd
!=
invalid_native_socket
)
{
// enable nonblocking IO & disable Nagle's algorithm
nonblocking
(
m_fd
,
true
);
tcp_nodelay
(
m_fd
,
true
);
...
...
unit_testing/test_sync_send.cpp
View file @
c4a54050
...
...
@@ -35,7 +35,7 @@ struct float_or_int : event_based_actor {
struct
popular_actor
:
event_based_actor
{
// popular actors have a buddy
actor
m_buddy
;
popular_actor
(
const
actor
&
buddy
)
:
m_buddy
(
buddy
)
{
popular_actor
(
const
actor
&
buddy
_arg
)
:
m_buddy
(
buddy_arg
)
{
// nop
}
inline
const
actor
&
buddy
()
const
{
...
...
@@ -62,7 +62,7 @@ struct popular_actor : event_based_actor { // popular actors have a buddy
\ ******************************************************************************/
struct
A
:
popular_actor
{
A
(
const
actor
&
buddy
)
:
popular_actor
(
buddy
)
{
A
(
const
actor
&
buddy
_arg
)
:
popular_actor
(
buddy_arg
)
{
// nop
}
behavior
make_behavior
()
override
{
...
...
@@ -85,7 +85,7 @@ struct A : popular_actor {
};
struct
B
:
popular_actor
{
B
(
const
actor
&
buddy
)
:
popular_actor
(
buddy
)
{
B
(
const
actor
&
buddy
_arg
)
:
popular_actor
(
buddy_arg
)
{
// nop
}
behavior
make_behavior
()
override
{
...
...
@@ -127,7 +127,7 @@ struct C : event_based_actor {
\ ******************************************************************************/
struct
D
:
popular_actor
{
D
(
const
actor
&
buddy
)
:
popular_actor
(
buddy
)
{}
D
(
const
actor
&
buddy
_arg
)
:
popular_actor
(
buddy_arg
)
{}
behavior
make_behavior
()
override
{
return
{
others
()
>>
[
=
]
{
...
...
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