Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
actor-incubator
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
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-incubator
Commits
3d945be1
Commit
3d945be1
authored
Mar 15, 2020
by
Jakob Otto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port libcaf_net code
parent
50b0ab12
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
53 additions
and
26 deletions
+53
-26
cmake/incubator-test.cpp
cmake/incubator-test.cpp
+8
-0
libcaf_net/caf/net/basp/application.hpp
libcaf_net/caf/net/basp/application.hpp
+1
-2
libcaf_net/caf/net/endpoint_manager.hpp
libcaf_net/caf/net/endpoint_manager.hpp
+1
-2
libcaf_net/caf/net/test/incubator_test.hpp
libcaf_net/caf/net/test/incubator_test.hpp
+23
-0
libcaf_net/src/application.cpp
libcaf_net/src/application.cpp
+2
-3
libcaf_net/src/host.cpp
libcaf_net/src/host.cpp
+0
-1
libcaf_net/src/multiplexer.cpp
libcaf_net/src/multiplexer.cpp
+2
-0
libcaf_net/src/pipe_socket.cpp
libcaf_net/src/pipe_socket.cpp
+1
-1
libcaf_net/src/udp_datagram_socket.cpp
libcaf_net/src/udp_datagram_socket.cpp
+1
-0
libcaf_net/test/datagram_transport.cpp
libcaf_net/test/datagram_transport.cpp
+2
-3
libcaf_net/test/doorman.cpp
libcaf_net/test/doorman.cpp
+3
-3
libcaf_net/test/endpoint_manager.cpp
libcaf_net/test/endpoint_manager.cpp
+2
-2
libcaf_net/test/stream_transport.cpp
libcaf_net/test/stream_transport.cpp
+2
-3
libcaf_net/test/string_application.cpp
libcaf_net/test/string_application.cpp
+2
-2
libcaf_net/test/transport_worker.cpp
libcaf_net/test/transport_worker.cpp
+2
-2
libcaf_net/test/transport_worker_dispatcher.cpp
libcaf_net/test/transport_worker_dispatcher.cpp
+1
-2
No files found.
cmake/incubator-test.cpp
View file @
3d945be1
#define CAF_TEST_NO_MAIN
#include "caf/net/test/incubator_test.hpp"
#include "caf/test/unit_test_impl.hpp"
int
main
(
int
argc
,
char
**
argv
)
{
caf
::
init_global_meta_objects
<>
();
return
caf
::
test
::
main
(
argc
,
argv
);
}
\ No newline at end of file
libcaf_net/caf/net/basp/application.hpp
View file @
3d945be1
...
...
@@ -125,8 +125,7 @@ public:
// nop
}
static
expected
<
buffer_type
>
serialize
(
actor_system
&
sys
,
const
type_erased_tuple
&
x
);
static
expected
<
buffer_type
>
serialize
(
actor_system
&
sys
,
const
message
&
x
);
// -- utility functions ------------------------------------------------------
...
...
libcaf_net/caf/net/endpoint_manager.hpp
View file @
3d945be1
...
...
@@ -48,8 +48,7 @@ public:
using
maybe_buffer
=
expected
<
std
::
vector
<
byte
>>
;
/// A function type for serializing message payloads.
using
serialize_fun_type
=
maybe_buffer
(
*
)(
actor_system
&
,
const
type_erased_tuple
&
);
using
serialize_fun_type
=
maybe_buffer
(
*
)(
actor_system
&
,
const
message
&
);
// -- constructors, destructors, and assignment operators --------------------
...
...
libcaf_net/caf/net/test/incubator_test.hpp
0 → 100644
View file @
3d945be1
#include "caf/fwd.hpp"
#include "caf/test/dsl.hpp"
#include "caf/type_id.hpp"
#include "caf/typed_actor.hpp"
#include <cstdint>
#include <numeric>
#include <string>
#include <utility>
// -- forward declarations for all unit test suites ----------------------------
// -- type IDs for for all unit test suites ------------------------------------
#define ADD_TYPE_ID(type) CAF_ADD_TYPE_ID(incubator_test, type)
#define ADD_ATOM(atom_name) CAF_ADD_ATOM(incubator_test, atom_name)
CAF_BEGIN_TYPE_ID_BLOCK
(
incubator_test
,
caf
::
first_custom_type_id
)
CAF_END_TYPE_ID_BLOCK
(
incubator_test
)
#undef ADD_TYPE_ID
#undef ADD_ATOM
libcaf_net/src/application.cpp
View file @
3d945be1
...
...
@@ -39,7 +39,6 @@
#include "caf/sec.hpp"
#include "caf/send.hpp"
#include "caf/string_algorithms.hpp"
#include "caf/type_erased_tuple.hpp"
namespace
caf
::
net
::
basp
{
...
...
@@ -120,10 +119,10 @@ void application::local_actor_down(packet_writer& writer, actor_id id,
}
expected
<
std
::
vector
<
byte
>>
application
::
serialize
(
actor_system
&
sys
,
const
type_erased_tupl
e
&
x
)
{
const
messag
e
&
x
)
{
std
::
vector
<
byte
>
result
;
binary_serializer
sink
{
sys
,
result
};
if
(
auto
err
=
message
::
save
(
sink
,
x
))
if
(
auto
err
=
x
.
save
(
sink
))
return
err
.
value
();
return
result
;
}
...
...
libcaf_net/src/host.cpp
View file @
3d945be1
...
...
@@ -22,7 +22,6 @@
#include "caf/detail/net_syscall.hpp"
#include "caf/detail/socket_sys_includes.hpp"
#include "caf/error.hpp"
#include "caf/make_message.hpp"
#include "caf/message.hpp"
#include "caf/net/socket.hpp"
#include "caf/none.hpp"
...
...
libcaf_net/src/multiplexer.cpp
View file @
3d945be1
...
...
@@ -25,10 +25,12 @@
#include "caf/error.hpp"
#include "caf/expected.hpp"
#include "caf/logger.hpp"
#include "caf/make_counted.hpp"
#include "caf/net/operation.hpp"
#include "caf/net/pollset_updater.hpp"
#include "caf/net/socket_manager.hpp"
#include "caf/sec.hpp"
#include "caf/span.hpp"
#include "caf/variant.hpp"
#ifndef CAF_WINDOWS
...
...
libcaf_net/src/pipe_socket.cpp
View file @
3d945be1
...
...
@@ -26,10 +26,10 @@
#include "caf/detail/socket_sys_aliases.hpp"
#include "caf/detail/socket_sys_includes.hpp"
#include "caf/expected.hpp"
#include "caf/make_message.hpp"
#include "caf/message.hpp"
#include "caf/net/stream_socket.hpp"
#include "caf/sec.hpp"
#include "caf/span.hpp"
#include "caf/variant.hpp"
namespace
caf
::
net
{
...
...
libcaf_net/src/udp_datagram_socket.cpp
View file @
3d945be1
...
...
@@ -27,6 +27,7 @@
#include "caf/ip_endpoint.hpp"
#include "caf/logger.hpp"
#include "caf/net/socket_guard.hpp"
#include "caf/span.hpp"
namespace
caf
::
net
{
...
...
libcaf_net/test/datagram_transport.cpp
View file @
3d945be1
...
...
@@ -166,11 +166,10 @@ public:
CAF_FAIL
(
"handle_error called: "
<<
to_string
(
sec
));
}
static
expected
<
buffer_type
>
serialize
(
actor_system
&
sys
,
const
type_erased_tuple
&
x
)
{
static
expected
<
buffer_type
>
serialize
(
actor_system
&
sys
,
const
message
&
x
)
{
buffer_type
result
;
binary_serializer
sink
{
sys
,
result
};
if
(
auto
err
=
message
::
save
(
sink
,
x
))
if
(
auto
err
=
x
.
save
(
sink
))
return
err
.
value
();
return
result
;
}
...
...
libcaf_net/test/doorman.cpp
View file @
3d945be1
...
...
@@ -61,10 +61,10 @@ struct fixture : test_coordinator_fixture<>, host_fixture {
class
dummy_application
{
public:
static
expected
<
std
::
vector
<
byte
>>
serialize
(
actor_system
&
sys
,
const
type_erased_tupl
e
&
x
)
{
const
messag
e
&
x
)
{
std
::
vector
<
byte
>
result
;
binary_serializer
sink
{
sys
,
result
};
if
(
auto
err
=
message
::
save
(
sink
,
x
))
if
(
auto
err
=
x
.
save
(
sink
))
return
err
.
value
();
return
result
;
}
...
...
@@ -117,7 +117,7 @@ public:
using
application_type
=
dummy_application
;
static
expected
<
std
::
vector
<
byte
>>
serialize
(
actor_system
&
sys
,
const
type_erased_tupl
e
&
x
)
{
const
messag
e
&
x
)
{
return
dummy_application
::
serialize
(
sys
,
x
);
}
...
...
libcaf_net/test/endpoint_manager.cpp
View file @
3d945be1
...
...
@@ -62,10 +62,10 @@ struct fixture : test_coordinator_fixture<>, host_fixture {
class
dummy_application
{
public:
static
expected
<
std
::
vector
<
byte
>>
serialize
(
actor_system
&
sys
,
const
type_erased_tupl
e
&
x
)
{
const
messag
e
&
x
)
{
std
::
vector
<
byte
>
result
;
binary_serializer
sink
{
sys
,
result
};
if
(
auto
err
=
message
::
save
(
sink
,
x
))
if
(
auto
err
=
x
.
save
(
sink
))
return
err
.
value
();
return
result
;
}
...
...
libcaf_net/test/stream_transport.cpp
View file @
3d945be1
...
...
@@ -137,11 +137,10 @@ public:
// nop
}
static
expected
<
buffer_type
>
serialize
(
actor_system
&
sys
,
const
type_erased_tuple
&
x
)
{
static
expected
<
buffer_type
>
serialize
(
actor_system
&
sys
,
const
message
&
x
)
{
buffer_type
result
;
binary_serializer
sink
{
sys
,
result
};
if
(
auto
err
=
message
::
save
(
sink
,
x
))
if
(
auto
err
=
x
.
save
(
sink
))
return
err
.
value
();
return
result
;
}
...
...
libcaf_net/test/string_application.cpp
View file @
3d945be1
...
...
@@ -113,10 +113,10 @@ public:
}
static
expected
<
std
::
vector
<
byte
>>
serialize
(
actor_system
&
sys
,
const
type_erased_tupl
e
&
x
)
{
const
messag
e
&
x
)
{
std
::
vector
<
byte
>
result
;
binary_serializer
sink
{
sys
,
result
};
if
(
auto
err
=
message
::
save
(
sink
,
x
))
if
(
auto
err
=
x
.
save
(
sink
))
return
err
.
value
();
return
result
;
}
...
...
libcaf_net/test/transport_worker.cpp
View file @
3d945be1
...
...
@@ -103,10 +103,10 @@ public:
}
static
expected
<
std
::
vector
<
byte
>>
serialize
(
actor_system
&
sys
,
const
type_erased_tupl
e
&
x
)
{
const
messag
e
&
x
)
{
std
::
vector
<
byte
>
result
;
binary_serializer
sink
{
sys
,
result
};
if
(
auto
err
=
message
::
save
(
sink
,
x
))
if
(
auto
err
=
x
.
save
(
sink
))
return
err
.
value
();
return
result
;
}
...
...
libcaf_net/test/transport_worker_dispatcher.cpp
View file @
3d945be1
...
...
@@ -92,8 +92,7 @@ public:
rec_buf_
->
push_back
(
static_cast
<
byte
>
(
id_
));
}
static
expected
<
buffer_type
>
serialize
(
actor_system
&
,
const
type_erased_tuple
&
)
{
static
expected
<
buffer_type
>
serialize
(
actor_system
&
,
const
message
&
)
{
return
buffer_type
{};
}
...
...
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