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
64cff1d0
Commit
64cff1d0
authored
Aug 27, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix shadowing and conversion warnings on GCC
parent
737a2d9a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
31 deletions
+24
-31
libcaf_io/src/publish_local_groups.cpp
libcaf_io/src/publish_local_groups.cpp
+4
-11
libcaf_io/src/test_multiplexer.cpp
libcaf_io/src/test_multiplexer.cpp
+13
-12
libcaf_io/test/basp.cpp
libcaf_io/test/basp.cpp
+7
-8
No files found.
libcaf_io/src/publish_local_groups.cpp
View file @
64cff1d0
...
...
@@ -26,22 +26,15 @@
namespace
caf
{
namespace
io
{
namespace
{
struct
group_nameserver
:
event_based_actor
{
behavior
make_behavior
()
override
{
uint16_t
publish_local_groups
(
uint16_t
port
,
const
char
*
addr
)
{
auto
group_nameserver
=
[]()
->
behavior
{
return
{
[](
get_atom
,
const
std
::
string
&
name
)
{
return
group
::
get
(
"local"
,
name
);
}
};
}
};
}
// namespace <anonymous>
uint16_t
publish_local_groups
(
uint16_t
port
,
const
char
*
addr
)
{
auto
gn
=
spawn
<
group_nameserver
,
hidden
>
();
};
auto
gn
=
spawn
<
hidden
>
(
group_nameserver
);
uint16_t
result
;
try
{
result
=
publish
(
gn
,
port
,
addr
);
...
...
libcaf_io/src/test_multiplexer.cpp
View file @
64cff1d0
...
...
@@ -28,9 +28,9 @@ test_multiplexer::~test_multiplexer() {
}
connection_handle
test_multiplexer
::
new_tcp_scribe
(
const
std
::
string
&
host
,
uint16_t
port
)
{
uint16_t
desired_
port
)
{
connection_handle
result
;
auto
i
=
scribes_
.
find
(
std
::
make_pair
(
host
,
port
));
auto
i
=
scribes_
.
find
(
std
::
make_pair
(
host
,
desired_
port
));
if
(
i
!=
scribes_
.
end
())
{
result
=
i
->
second
;
scribes_
.
erase
(
i
);
...
...
@@ -86,22 +86,22 @@ connection_handle test_multiplexer::add_tcp_scribe(abstract_broker*,
connection_handle
test_multiplexer
::
add_tcp_scribe
(
abstract_broker
*
ptr
,
const
std
::
string
&
host
,
uint16_t
port
)
{
auto
hdl
=
new_tcp_scribe
(
host
,
port
);
uint16_t
desired_
port
)
{
auto
hdl
=
new_tcp_scribe
(
host
,
desired_
port
);
if
(
hdl
!=
invalid_connection_handle
)
assign_tcp_scribe
(
ptr
,
hdl
);
return
hdl
;
}
std
::
pair
<
accept_handle
,
uint16_t
>
test_multiplexer
::
new_tcp_doorman
(
uint16_t
port
,
const
char
*
,
bool
)
{
test_multiplexer
::
new_tcp_doorman
(
uint16_t
desired_
port
,
const
char
*
,
bool
)
{
accept_handle
result
;
auto
i
=
doormen_
.
find
(
port
);
auto
i
=
doormen_
.
find
(
desired_
port
);
if
(
i
!=
doormen_
.
end
())
{
result
=
i
->
second
;
doormen_
.
erase
(
i
);
}
return
{
result
,
port
};
return
{
result
,
desired_
port
};
}
void
test_multiplexer
::
assign_tcp_doorman
(
abstract_broker
*
ptr
,
...
...
@@ -169,14 +169,15 @@ void test_multiplexer::run() {
// nop
}
void
test_multiplexer
::
provide_scribe
(
std
::
string
host
,
uint16_t
port
,
void
test_multiplexer
::
provide_scribe
(
std
::
string
host
,
uint16_t
desired_
port
,
connection_handle
hdl
)
{
scribes_
.
emplace
(
std
::
make_pair
(
std
::
move
(
host
),
port
),
hdl
);
scribes_
.
emplace
(
std
::
make_pair
(
std
::
move
(
host
),
desired_
port
),
hdl
);
}
void
test_multiplexer
::
provide_acceptor
(
uint16_t
port
,
accept_handle
hdl
)
{
doormen_
.
emplace
(
port
,
hdl
);
doorman_data_
[
hdl
].
port
=
port
;
void
test_multiplexer
::
provide_acceptor
(
uint16_t
desired_port
,
accept_handle
hdl
)
{
doormen_
.
emplace
(
desired_port
,
hdl
);
doorman_data_
[
hdl
].
port
=
desired_port
;
}
/// The external input buffer should be filled by
...
...
libcaf_io/test/basp.cpp
View file @
64cff1d0
...
...
@@ -90,7 +90,7 @@ namespace {
throw std::logic_error("unexpected timeout"); \
}
static
constexpr
size
_t
num_remote_nodes
=
2
;
static
constexpr
uint32
_t
num_remote_nodes
=
2
;
using
buffer
=
std
::
vector
<
char
>
;
...
...
@@ -128,7 +128,7 @@ public:
for
(
uint32_t
i
=
0
;
i
<
num_remote_nodes
;
++
i
)
{
node_id
::
host_id_type
tmp
=
this_node_
.
host_id
();
for
(
auto
&
c
:
tmp
)
c
+=
static_cast
<
uint8_t
>
(
i
+
1
);
c
=
static_cast
<
uint8_t
>
(
c
+
i
+
1
);
remote_node_
[
i
]
=
node_id
{
this_node_
.
process_id
()
+
i
+
1
,
tmp
};
remote_hdl_
[
i
]
=
connection_handle
::
from_int
(
i
+
1
);
auto
&
ptr
=
pseudo_remote_
[
i
];
...
...
@@ -335,9 +335,8 @@ public:
message
msg
;
auto
source
=
make_deserializer
(
buf
);
msg
.
deserialize
(
source
);
auto
registry
=
detail
::
singletons
::
get_actor_registry
();
auto
src
=
registry
->
get
(
hdr
.
source_actor
);
auto
dest
=
registry
->
get
(
hdr
.
dest_actor
);
auto
src
=
registry_
->
get
(
hdr
.
source_actor
);
auto
dest
=
registry_
->
get
(
hdr
.
dest_actor
);
CAF_REQUIRE
(
dest
!=
nullptr
);
dest
->
enqueue
(
src
?
src
->
address
()
:
invalid_actor_addr
,
message_id
::
make
(),
std
::
move
(
msg
),
nullptr
);
...
...
@@ -613,11 +612,11 @@ CAF_TEST(remote_actor_and_send) {
}
CAF_TEST
(
actor_serialize_and_deserialize
)
{
auto
testee_impl
=
[](
event_based_actor
*
self
)
->
behavior
{
auto
testee_impl
=
[](
event_based_actor
*
testee_
self
)
->
behavior
{
return
{
others
>>
[
=
]
{
self
->
quit
();
return
self
->
current_message
();
testee_
self
->
quit
();
return
testee_
self
->
current_message
();
}
};
};
...
...
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