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
9eac8a21
Unverified
Commit
9eac8a21
authored
Mar 31, 2020
by
Dominik Charousset
Committed by
GitHub
Mar 31, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #65
Port message-rework changes to incubator
parents
87d4ebdd
d2bf0a64
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
114 additions
and
149 deletions
+114
-149
CMakeLists.txt
CMakeLists.txt
+11
-100
cmake/incubator-test.cpp
cmake/incubator-test.cpp
+9
-1
cmake/incubator-test.hpp
cmake/incubator-test.hpp
+16
-0
configure
configure
+23
-17
libcaf_bb/caf/bb/test/bb_test_type_ids.hpp
libcaf_bb/caf/bb/test/bb_test_type_ids.hpp
+26
-0
libcaf_bb/test/container_source.cpp
libcaf_bb/test/container_source.cpp
+2
-1
libcaf_bb/test/stream_reader.cpp
libcaf_bb/test/stream_reader.cpp
+1
-1
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/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
+4
-3
libcaf_net/test/stream_transport.cpp
libcaf_net/test/stream_transport.cpp
+3
-4
libcaf_net/test/string_application.cpp
libcaf_net/test/string_application.cpp
+3
-3
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.
CMakeLists.txt
View file @
9eac8a21
# -- project setup -------------------------------------------------------------
# -- project setup -------------------------------------------------------------
cmake_minimum_required
(
VERSION 3.0 FATAL_ERROR
)
cmake_minimum_required
(
VERSION 3.0 FATAL_ERROR
)
project
(
caf_incubator C
C
XX
)
project
(
caf_incubator CXX
)
# -- project options -----------------------------------------------------------
# -- project options -----------------------------------------------------------
...
@@ -10,12 +10,10 @@ option(BUILD_SHARED_LIBS "Build all modules as shared library" ON)
...
@@ -10,12 +10,10 @@ option(BUILD_SHARED_LIBS "Build all modules as shared library" ON)
# -- includes ------------------------------------------------------------------
# -- includes ------------------------------------------------------------------
include
(
CMakePackageConfigHelpers
)
# For creating .cmake files
include
(
CMakePackageConfigHelpers
)
# For creating .cmake files
include
(
CheckCSourceCompiles
)
# Check whether compiler works
include
(
CheckCXXSourceCompiles
)
# Check wether compiler works
include
(
CheckCSourceRuns
)
# Check whether compiler produces binaries
include
(
GNUInstallDirs
)
# Sets default install paths
include
(
GNUInstallDirs
)
# Sets default install paths
include
(
GenerateExportHeader
)
# Auto-generates dllexport macros
include
(
GenerateExportHeader
)
# Auto-generates dllexport macros
# -- project-specific CMake settings -------------------------------------------
# -- project-specific CMake settings -------------------------------------------
set
(
CMAKE_MODULE_PATH
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake"
)
set
(
CMAKE_MODULE_PATH
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake"
)
...
@@ -165,19 +163,6 @@ endif()
...
@@ -165,19 +163,6 @@ endif()
# utility functions #
# utility functions #
################################################################################
################################################################################
# Appends `str` to the variable named `var` with a whitespace as separator.
# Suppresses a leading whitespace if the variable is empty and does nothing if
# `str` is empty.
function
(
build_string var str
)
if
(
NOT str STREQUAL
""
)
if
(
"
${${
var
}}
"
STREQUAL
""
)
set
(
"
${
var
}
"
"
${
str
}
"
PARENT_SCOPE
)
else
()
set
(
"
${
var
}
"
"
${${
var
}}
${
str
}
"
PARENT_SCOPE
)
endif
()
endif
()
endfunction
(
build_string
)
# Forces `var` to 'no' if the content of the variables evaluates to false.
# Forces `var` to 'no' if the content of the variables evaluates to false.
function
(
pretty_no var
)
function
(
pretty_no var
)
if
(
NOT
"
${${
var
}}
"
)
if
(
NOT
"
${${
var
}}
"
)
...
@@ -266,42 +251,6 @@ endif()
...
@@ -266,42 +251,6 @@ endif()
# -- compiler setup ------------------------------------------------------------
# -- compiler setup ------------------------------------------------------------
# Enable a ton of warnings if --more-clang-warnings is used.
if
(
CAF_MORE_WARNINGS
)
if
(
CMAKE_CXX_COMPILER_ID MATCHES
"Clang"
)
set
(
WFLAGS
"-Weverything -Wno-c++98-compat -Wno-padded "
"-Wno-documentation-unknown-command -Wno-exit-time-destructors "
"-Wno-global-constructors -Wno-missing-prototypes "
"-Wno-c++98-compat-pedantic -Wno-unused-member-function "
"-Wno-unused-const-variable -Wno-switch-enum "
"-Wno-abstract-vbase-init -Wno-shadow "
"-Wno-missing-noreturn -Wno-covered-switch-default"
)
elseif
(
CMAKE_CXX_COMPILER_ID MATCHES
"GNU"
)
set
(
WFLAGS
"-Waddress -Wall -Warray-bounds "
"-Wattributes -Wbuiltin-macro-redefined -Wcast-align "
"-Wcast-qual -Wchar-subscripts -Wclobbered -Wcomment "
"-Wconversion -Wconversion-null -Wcoverage-mismatch "
"-Wcpp -Wdelete-non-virtual-dtor -Wdeprecated "
"-Wdeprecated-declarations -Wdiv-by-zero -Wdouble-promotion "
"-Wempty-body -Wendif-labels -Wenum-compare -Wextra "
"-Wfloat-equal -Wformat -Wfree-nonheap-object "
"-Wignored-qualifiers -Winit-self "
"-Winline -Wint-to-pointer-cast -Winvalid-memory-model "
"-Winvalid-offsetof -Wlogical-op -Wmain -Wmaybe-uninitialized "
"-Wmissing-braces -Wmultichar "
"-Wnarrowing -Wnoexcept -Wnon-template-friend "
"-Wnon-virtual-dtor -Wnonnull -Woverflow "
"-Woverlength-strings -Wparentheses "
"-Wpmf-conversions -Wpointer-arith -Wreorder "
"-Wreturn-type -Wsequence-point "
"-Wsign-compare -Wswitch -Wtype-limits -Wundef "
"-Wuninitialized -Wunused -Wvla -Wwrite-strings"
)
endif
()
# convert CMake list to a single string, erasing the ";" separators
string
(
REPLACE
";"
""
WFLAGS_STR
${
WFLAGS
}
)
build_string
(
"EXTRA_FLAGS"
"
${
WFLAGS_STR
}
"
)
endif
()
# Enable ASAN if requested by the user.
# Enable ASAN if requested by the user.
if
(
CAF_SANITIZERS
)
if
(
CAF_SANITIZERS
)
add_compile_options
(
"-fsanitize=
${
CAF_SANITIZERS
}
"
add_compile_options
(
"-fsanitize=
${
CAF_SANITIZERS
}
"
...
@@ -311,18 +260,18 @@ endif()
...
@@ -311,18 +260,18 @@ endif()
# -pthread is ignored on MacOSX but required on other platforms
# -pthread is ignored on MacOSX but required on other platforms
if
(
NOT APPLE AND NOT WIN32
)
if
(
NOT APPLE AND NOT WIN32
)
build_string
(
"EXTRA_FLAGS"
"-pthread"
)
add_compile_options
(
-pthread
)
list
(
APPEND CAF_EXTRA_LDFLAGS
"-pthread"
)
endif
()
endif
()
# -fPIC generates warnings on MinGW and Cygwin plus extra setup steps needed on MinGW
# -fPIC generates warnings on MinGW and Cygwin plus extra setup steps needed on MinGW
if
(
MINGW
)
if
(
MINGW
)
add_definitions
(
-D_WIN32_WINNT=0x0600
)
add_definitions
(
-D_WIN32_WINNT=0x0600 -DWIN32
)
add_definitions
(
-DWIN32
)
list
(
APPEND CAF_EXTRA_LDFLAGS -lws2_32 -liphlpapi -lpsapi
)
list
(
APPEND CAF_EXTRA_LDFLAGS -lws2_32 -liphlpapi -lpsapi
)
# build static to avoid runtime dependencies to GCC libraries
# build static to avoid runtime dependencies to GCC libraries
build_string
(
"EXTRA_FLAGS"
"-static"
)
add_compile_options
(
-static
)
elseif
(
CYGWIN
)
elseif
(
CYGWIN
)
build_string
(
"EXTRA_FLAGS"
"-U__STRICT_ANSI__"
)
add_compile_options
(
-U__STRICT_ANSI__
)
endif
()
endif
()
# Add Windows-specific linker flags.
# Add Windows-specific linker flags.
...
@@ -338,45 +287,12 @@ endif()
...
@@ -338,45 +287,12 @@ endif()
# Add iOS target if requested by user.
# Add iOS target if requested by user.
if
(
CAF_IOS_DEPLOYMENT_TARGET
)
if
(
CAF_IOS_DEPLOYMENT_TARGET
)
if
(
CAF_OSX_SYSROOT STREQUAL
"iphonesimulator"
)
if
(
CAF_OSX_SYSROOT STREQUAL
"iphonesimulator"
)
build_string
(
"EXTRA_FLAGS"
add_compile_options
(
"-mios-simulator-version-min=
${
CAF_IOS_DEPLOYMENT_TARGET
}
"
)
"-mios-simulator-version-min=
${
CAF_IOS_DEPLOYMENT_TARGET
}
"
)
else
()
else
()
build_string
(
"EXTRA_FLAGS"
add_compile_options
(
"-miphoneos-version-min=
${
CAF_IOS_DEPLOYMENT_TARGET
}
"
)
"-miphoneos-version-min=
${
CAF_IOS_DEPLOYMENT_TARGET
}
"
)
endif
()
endif
()
endif
()
endif
()
# -- check if the user provided CXXFLAGS, set defaults otherwise ---------------
if
(
NOT CMAKE_CXX_FLAGS
)
set
(
CMAKE_CXX_FLAGS
"-Wextra -Wall -pedantic
${
EXTRA_FLAGS
}
"
)
endif
()
if
(
NOT CMAKE_CXX_FLAGS_DEBUG
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-O0 -g"
)
endif
()
if
(
NOT CMAKE_CXX_FLAGS_MINSIZEREL
)
set
(
CMAKE_CXX_FLAGS_MINSIZEREL
"-Os"
)
endif
()
if
(
NOT CMAKE_CXX_FLAGS_RELEASE
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-O3 -DNDEBUG"
)
endif
()
if
(
NOT CMAKE_CXX_FLAGS_RELWITHDEBINFO
)
set
(
CMAKE_CXX_FLAGS_RELWITHDEBINFO
"-O2 -g -fno-omit-frame-pointer"
)
endif
()
if
(
NOT CMAKE_BUILD_TYPE
)
set
(
CMAKE_BUILD_TYPE RelWithDebInfo
)
endif
()
# needed by subprojects
if
(
DEFINED CMAKE_LD_LIBS
)
list
(
APPEND
${
CMAKE_LD_LIBS
}
)
endif
()
# -- install targets -----------------------------------------------------------
# -- install targets -----------------------------------------------------------
# Process cmake_uninstall.cmake.in.
# Process cmake_uninstall.cmake.in.
...
@@ -435,12 +351,7 @@ endmacro()
...
@@ -435,12 +351,7 @@ endmacro()
# Invert CAF_NO_* variables for nicer output.
# Invert CAF_NO_* variables for nicer output.
invertYesNo
(
CAF_NO_UNIT_TESTS CAF_BUILD_UNIT_TESTS
)
invertYesNo
(
CAF_NO_UNIT_TESTS CAF_BUILD_UNIT_TESTS
)
get_property
(
all_cxx_flags DIRECTORY PROPERTY COMPILE_OPTIONS
)
# Collect all compiler flags.
string
(
TOUPPER
"
${
CMAKE_BUILD_TYPE
}
"
UPPER_BUILD_TYPE
)
set
(
ALL_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
CMAKE_CXX_FLAGS_
${
UPPER_BUILD_TYPE
}}
"
)
set
(
ALL_LD_FLAGS
"
${
CMAKE_SHARED_LINKER_FLAGS
}
${
CAF_EXTRA_LDFLAGS
}
"
)
string
(
STRIP
"
${
ALL_LD_FLAGS
}
"
ALL_LD_FLAGS
)
# Print summary.
# Print summary.
if
(
NOT CAF_NO_SUMMARY
)
if
(
NOT CAF_NO_SUMMARY
)
...
@@ -452,7 +363,7 @@ if(NOT CAF_NO_SUMMARY)
...
@@ -452,7 +363,7 @@ if(NOT CAF_NO_SUMMARY)
"
\n
Build static runtime:
${
CAF_BUILD_STATIC_RUNTIME
}
"
"
\n
Build static runtime:
${
CAF_BUILD_STATIC_RUNTIME
}
"
"
\n
"
"
\n
"
"
\n
CXX:
${
CMAKE_CXX_COMPILER
}
"
"
\n
CXX:
${
CMAKE_CXX_COMPILER
}
"
"
\n
CXXFLAGS:
${
ALL_CXX_FLAGS
}
"
"
\n
CXXFLAGS:
${
all_cxx_flags
}
"
"
\n
LINKER_FLAGS (shared):
${
ALL_LD_FLAGS
}
"
"
\n
LINKER_FLAGS (shared):
${
ALL_LD_FLAGS
}
"
"
\n
"
"
\n
"
"
\n
Source directory:
${
CMAKE_CURRENT_SOURCE_DIR
}
"
"
\n
Source directory:
${
CMAKE_CURRENT_SOURCE_DIR
}
"
...
...
cmake/incubator-test.cpp
View file @
9eac8a21
#include "caf/test/unit_test_impl.hpp"
#define CAF_TEST_NO_MAIN
#include "incubator-test.hpp"
int
main
(
int
argc
,
char
**
argv
)
{
caf
::
core
::
init_global_meta_objects
();
caf
::
init_global_meta_objects
<
caf
::
id_block
::
incubator_test
>
();
return
caf
::
test
::
main
(
argc
,
argv
);
}
cmake/incubator-test.hpp
0 → 100644
View file @
9eac8a21
#pragma once
#include <vector>
#include "caf/fwd.hpp"
#include "caf/stream.hpp"
#include "caf/test/dsl.hpp"
#include "caf/test/unit_test_impl.hpp"
#include "caf/type_id.hpp"
CAF_BEGIN_TYPE_ID_BLOCK
(
incubator_test
,
caf
::
first_custom_type_id
)
CAF_ADD_TYPE_ID
(
incubator_test
,
(
caf
::
stream
<
int
>
)
)
CAF_ADD_TYPE_ID
(
incubator_test
,
(
std
::
vector
<
int
>
)
)
CAF_END_TYPE_ID_BLOCK
(
incubator_test
)
configure
View file @
9eac8a21
...
@@ -2,15 +2,6 @@
...
@@ -2,15 +2,6 @@
# Convenience wrapper for easily viewing/setting options that
# Convenience wrapper for easily viewing/setting options that
# the project's CMake scripts will recognize.
# the project's CMake scripts will recognize.
# check for `cmake` command
type
cmake
>
/dev/null 2>&1
||
{
echo
"
\
This package requires CMake, please install it first, then you may
use this configure script to access CMake equivalent functionality.
\
"
>
&2
;
exit
1
;
}
command
=
"
$0
$*
"
command
=
"
$0
$*
"
dirname_0
=
`
dirname
$0
`
dirname_0
=
`
dirname
$0
`
sourcedir
=
`
cd
$dirname_0
&&
pwd
`
sourcedir
=
`
cd
$dirname_0
&&
pwd
`
...
@@ -19,20 +10,20 @@ usage="\
...
@@ -19,20 +10,20 @@ usage="\
Usage:
$0
[OPTION]... [VAR=VALUE]...
Usage:
$0
[OPTION]... [VAR=VALUE]...
Build Options:
Build Options:
--cmake=PATH set a custom path to the CMake binary
--generator=GENERATOR set CMake generator (see cmake --help)
--generator=GENERATOR set CMake generator (see cmake --help)
--build-type=TYPE set CMake build type [RelWithDebInfo]:
--build-type=TYPE set CMake build type [RelWithDebInfo]:
- Debug: debugging flags enabled
- Debug: debugging flags enabled
- MinSizeRel: minimal output size
- MinSizeRel: minimal output size
- Release: optimizations on, debugging off
- Release: optimizations on, debugging off
- RelWithDebInfo: release flags plus debugging
- RelWithDebInfo: release flags plus debugging
--extra-flags=STRING additional compiler flags
--extra-flags=STRING additional compiler flags
(sets CMAKE_CXX_FLAGS)
--build-dir=DIR place build files in directory [build]
--build-dir=DIR place build files in directory [build]
--bin-dir=DIR executable directory [build/bin]
--bin-dir=DIR executable directory [build/bin]
--lib-dir=DIR library directory [build/lib]
--lib-dir=DIR library directory [build/lib]
--build-static build as static and shared library
--build-static build as static and shared library
--build-static-only build as static library only
--build-static-only build as static library only
--static-runtime build with static C++ runtime
--static-runtime build with static C++ runtime
--more-warnings enables most warnings
--no-compiler-check disable compiler version check
--no-compiler-check disable compiler version check
--no-auto-libc++ do not automatically enable libc++ for Clang
--no-auto-libc++ do not automatically enable libc++ for Clang
...
@@ -111,6 +102,9 @@ while [ $# -ne 0 ]; do
...
@@ -111,6 +102,9 @@ while [ $# -ne 0 ]; do
echo
"
${
usage
}
"
1>&2
echo
"
${
usage
}
"
1>&2
exit
1
exit
1
;;
;;
--cmake
=
*
)
CMakeCommand
=
"
$optarg
"
;;
--generator
=
*
)
--generator
=
*
)
CMakeGenerator
=
"
$optarg
"
CMakeGenerator
=
"
$optarg
"
;;
;;
...
@@ -120,9 +114,6 @@ while [ $# -ne 0 ]; do
...
@@ -120,9 +114,6 @@ while [ $# -ne 0 ]; do
--with-sanitizers
=
*
)
--with-sanitizers
=
*
)
append_cache_entry CAF_SANITIZERS STRING
"
$optarg
"
append_cache_entry CAF_SANITIZERS STRING
"
$optarg
"
;;
;;
--more-warnings
)
append_cache_entry CAF_MORE_WARNINGS BOOL
yes
;;
--no-compiler-check
)
--no-compiler-check
)
append_cache_entry CAF_NO_COMPILER_CHECK BOOL
yes
append_cache_entry CAF_NO_COMPILER_CHECK BOOL
yes
;;
;;
...
@@ -143,7 +134,7 @@ while [ $# -ne 0 ]; do
...
@@ -143,7 +134,7 @@ while [ $# -ne 0 ]; do
append_cache_entry CMAKE_BUILD_TYPE STRING
"
$optarg
"
append_cache_entry CMAKE_BUILD_TYPE STRING
"
$optarg
"
;;
;;
--extra-flags
=
*
)
--extra-flags
=
*
)
append_cache_entry
EXTRA
_FLAGS STRING
"
$optarg
"
append_cache_entry
CMAKE_CXX
_FLAGS STRING
"
$optarg
"
;;
;;
--build-dir
=
*
)
--build-dir
=
*
)
builddir
=
"
$optarg
"
builddir
=
"
$optarg
"
...
@@ -186,6 +177,21 @@ done
...
@@ -186,6 +177,21 @@ done
# -- CMake setup ---------------------------------------------------------------
# -- CMake setup ---------------------------------------------------------------
# Check for `cmake` command.
if
[
-z
"
$CMakeCommand
"
]
;
then
# prefer cmake3 over "regular" cmake (cmake == cmake2 on RHEL)
if
command
-v
cmake3
>
/dev/null 2>&1
;
then
CMakeCommand
=
"cmake3"
elif
command
-v
cmake
>
/dev/null 2>&1
;
then
CMakeCommand
=
"cmake"
else
echo
"This package requires CMake, please install it first."
echo
"Then you may use this script to configure the CMake build."
echo
"Note: pass --cmake=PATH to use cmake in non-standard locations."
exit
1
;
fi
fi
CMakeDefaultCache
=
$CMakeCacheEntries
CMakeDefaultCache
=
$CMakeCacheEntries
CMakeCacheEntries
=
$CMakeDefaultCache
CMakeCacheEntries
=
$CMakeDefaultCache
...
@@ -214,9 +220,9 @@ fi
...
@@ -214,9 +220,9 @@ fi
cd
"
$workdir
"
cd
"
$workdir
"
if
[
-n
"
$CMakeGenerator
"
]
;
then
if
[
-n
"
$CMakeGenerator
"
]
;
then
cmake
-G
"
$CMakeGenerator
"
$CMakeCacheEntries
"
$sourcedir
"
"
$CMakeCommand
"
-G
"
$CMakeGenerator
"
$CMakeCacheEntries
"
$sourcedir
"
else
else
cmake
$CMakeCacheEntries
"
$sourcedir
"
"
$CMakeCommand
"
$CMakeCacheEntries
"
$sourcedir
"
fi
fi
printf
"#!/bin/sh
\n\n
"
>
config.status
printf
"#!/bin/sh
\n\n
"
>
config.status
...
...
libcaf_bb/caf/bb/test/bb_test_type_ids.hpp
0 → 100644
View file @
9eac8a21
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ Actor *
* | |___ / ___ \| _| Framework *
* \____/_/ \_|_| *
* *
* Copyright 2011-2020 Dominik Charousset *
* *
* Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software *
* License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE. *
* *
* If you did not receive a copy of the license files, see *
* http://opensource.org/licenses/BSD-3-Clause and *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#include "caf/test/dsl.hpp"
CAF_BEGIN_TYPE_ID_BLOCK
(
bb_test
,
caf
::
first_custom_type_id
)
CAF_ADD_TYPE_ID
(
bb_test
,
(
caf
::
stream
<
int
>
)
)
CAF_ADD_TYPE_ID
(
bb_test
,
(
std
::
vector
<
int
>
)
)
CAF_END_TYPE_ID_BLOCK
(
bb_test
)
libcaf_bb/test/container_source.cpp
View file @
9eac8a21
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include "caf/bb/container_source.hpp"
#include "caf/bb/container_source.hpp"
#include "caf/bb/test/bb_test_type_ids.hpp"
#include "caf/test/dsl.hpp"
#include "caf/test/dsl.hpp"
#include <vector>
#include <vector>
...
@@ -74,7 +75,7 @@ TESTEE(container_monitor) {
...
@@ -74,7 +75,7 @@ TESTEE(container_monitor) {
struct
config
:
actor_system_config
{
struct
config
:
actor_system_config
{
config
()
{
config
()
{
add_message_type
<
container_type
::
value_type
>
(
"value_type"
);
// nop
}
}
};
};
...
...
libcaf_bb/test/stream_reader.cpp
View file @
9eac8a21
...
@@ -21,10 +21,10 @@
...
@@ -21,10 +21,10 @@
#include "caf/bb/stream_reader.hpp"
#include "caf/bb/stream_reader.hpp"
#include "caf/policy/tokenized_integer_reader.hpp"
#include "caf/policy/tokenized_integer_reader.hpp"
#include "caf/bb/test/bb_test_type_ids.hpp"
#include "caf/test/dsl.hpp"
#include "caf/test/dsl.hpp"
#include <memory>
#include <memory>
#include <sstream>
#include <string>
#include <string>
#include <vector>
#include <vector>
...
...
libcaf_net/caf/net/basp/application.hpp
View file @
9eac8a21
...
@@ -125,8 +125,7 @@ public:
...
@@ -125,8 +125,7 @@ public:
// nop
// nop
}
}
static
expected
<
buffer_type
>
serialize
(
actor_system
&
sys
,
static
expected
<
buffer_type
>
serialize
(
actor_system
&
sys
,
const
message
&
x
);
const
type_erased_tuple
&
x
);
// -- utility functions ------------------------------------------------------
// -- utility functions ------------------------------------------------------
...
...
libcaf_net/caf/net/endpoint_manager.hpp
View file @
9eac8a21
...
@@ -48,8 +48,7 @@ public:
...
@@ -48,8 +48,7 @@ public:
using
maybe_buffer
=
expected
<
std
::
vector
<
byte
>>
;
using
maybe_buffer
=
expected
<
std
::
vector
<
byte
>>
;
/// A function type for serializing message payloads.
/// A function type for serializing message payloads.
using
serialize_fun_type
=
maybe_buffer
(
*
)(
actor_system
&
,
using
serialize_fun_type
=
maybe_buffer
(
*
)(
actor_system
&
,
const
message
&
);
const
type_erased_tuple
&
);
// -- constructors, destructors, and assignment operators --------------------
// -- constructors, destructors, and assignment operators --------------------
...
...
libcaf_net/src/application.cpp
View file @
9eac8a21
...
@@ -39,7 +39,6 @@
...
@@ -39,7 +39,6 @@
#include "caf/sec.hpp"
#include "caf/sec.hpp"
#include "caf/send.hpp"
#include "caf/send.hpp"
#include "caf/string_algorithms.hpp"
#include "caf/string_algorithms.hpp"
#include "caf/type_erased_tuple.hpp"
namespace
caf
::
net
::
basp
{
namespace
caf
::
net
::
basp
{
...
@@ -120,10 +119,10 @@ void application::local_actor_down(packet_writer& writer, actor_id id,
...
@@ -120,10 +119,10 @@ void application::local_actor_down(packet_writer& writer, actor_id id,
}
}
expected
<
std
::
vector
<
byte
>>
application
::
serialize
(
actor_system
&
sys
,
expected
<
std
::
vector
<
byte
>>
application
::
serialize
(
actor_system
&
sys
,
const
type_erased_tupl
e
&
x
)
{
const
messag
e
&
x
)
{
std
::
vector
<
byte
>
result
;
std
::
vector
<
byte
>
result
;
binary_serializer
sink
{
sys
,
result
};
binary_serializer
sink
{
sys
,
result
};
if
(
auto
err
=
message
::
save
(
sink
,
x
))
if
(
auto
err
=
x
.
save
(
sink
))
return
err
.
value
();
return
err
.
value
();
return
result
;
return
result
;
}
}
...
...
libcaf_net/src/host.cpp
View file @
9eac8a21
...
@@ -22,7 +22,6 @@
...
@@ -22,7 +22,6 @@
#include "caf/detail/net_syscall.hpp"
#include "caf/detail/net_syscall.hpp"
#include "caf/detail/socket_sys_includes.hpp"
#include "caf/detail/socket_sys_includes.hpp"
#include "caf/error.hpp"
#include "caf/error.hpp"
#include "caf/make_message.hpp"
#include "caf/message.hpp"
#include "caf/message.hpp"
#include "caf/net/socket.hpp"
#include "caf/net/socket.hpp"
#include "caf/none.hpp"
#include "caf/none.hpp"
...
...
libcaf_net/src/multiplexer.cpp
View file @
9eac8a21
...
@@ -25,10 +25,12 @@
...
@@ -25,10 +25,12 @@
#include "caf/error.hpp"
#include "caf/error.hpp"
#include "caf/expected.hpp"
#include "caf/expected.hpp"
#include "caf/logger.hpp"
#include "caf/logger.hpp"
#include "caf/make_counted.hpp"
#include "caf/net/operation.hpp"
#include "caf/net/operation.hpp"
#include "caf/net/pollset_updater.hpp"
#include "caf/net/pollset_updater.hpp"
#include "caf/net/socket_manager.hpp"
#include "caf/net/socket_manager.hpp"
#include "caf/sec.hpp"
#include "caf/sec.hpp"
#include "caf/span.hpp"
#include "caf/variant.hpp"
#include "caf/variant.hpp"
#ifndef CAF_WINDOWS
#ifndef CAF_WINDOWS
...
...
libcaf_net/src/pipe_socket.cpp
View file @
9eac8a21
...
@@ -26,10 +26,10 @@
...
@@ -26,10 +26,10 @@
#include "caf/detail/socket_sys_aliases.hpp"
#include "caf/detail/socket_sys_aliases.hpp"
#include "caf/detail/socket_sys_includes.hpp"
#include "caf/detail/socket_sys_includes.hpp"
#include "caf/expected.hpp"
#include "caf/expected.hpp"
#include "caf/make_message.hpp"
#include "caf/message.hpp"
#include "caf/message.hpp"
#include "caf/net/stream_socket.hpp"
#include "caf/net/stream_socket.hpp"
#include "caf/sec.hpp"
#include "caf/sec.hpp"
#include "caf/span.hpp"
#include "caf/variant.hpp"
#include "caf/variant.hpp"
namespace
caf
::
net
{
namespace
caf
::
net
{
...
...
libcaf_net/src/udp_datagram_socket.cpp
View file @
9eac8a21
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include "caf/ip_endpoint.hpp"
#include "caf/ip_endpoint.hpp"
#include "caf/logger.hpp"
#include "caf/logger.hpp"
#include "caf/net/socket_guard.hpp"
#include "caf/net/socket_guard.hpp"
#include "caf/span.hpp"
namespace
caf
::
net
{
namespace
caf
::
net
{
...
...
libcaf_net/test/datagram_transport.cpp
View file @
9eac8a21
...
@@ -166,11 +166,10 @@ public:
...
@@ -166,11 +166,10 @@ public:
CAF_FAIL
(
"handle_error called: "
<<
to_string
(
sec
));
CAF_FAIL
(
"handle_error called: "
<<
to_string
(
sec
));
}
}
static
expected
<
buffer_type
>
serialize
(
actor_system
&
sys
,
static
expected
<
buffer_type
>
serialize
(
actor_system
&
sys
,
const
message
&
x
)
{
const
type_erased_tuple
&
x
)
{
buffer_type
result
;
buffer_type
result
;
binary_serializer
sink
{
sys
,
result
};
binary_serializer
sink
{
sys
,
result
};
if
(
auto
err
=
message
::
save
(
sink
,
x
))
if
(
auto
err
=
x
.
save
(
sink
))
return
err
.
value
();
return
err
.
value
();
return
result
;
return
result
;
}
}
...
...
libcaf_net/test/doorman.cpp
View file @
9eac8a21
...
@@ -61,10 +61,10 @@ struct fixture : test_coordinator_fixture<>, host_fixture {
...
@@ -61,10 +61,10 @@ struct fixture : test_coordinator_fixture<>, host_fixture {
class
dummy_application
{
class
dummy_application
{
public:
public:
static
expected
<
std
::
vector
<
byte
>>
serialize
(
actor_system
&
sys
,
static
expected
<
std
::
vector
<
byte
>>
serialize
(
actor_system
&
sys
,
const
type_erased_tupl
e
&
x
)
{
const
messag
e
&
x
)
{
std
::
vector
<
byte
>
result
;
std
::
vector
<
byte
>
result
;
binary_serializer
sink
{
sys
,
result
};
binary_serializer
sink
{
sys
,
result
};
if
(
auto
err
=
message
::
save
(
sink
,
x
))
if
(
auto
err
=
x
.
save
(
sink
))
return
err
.
value
();
return
err
.
value
();
return
result
;
return
result
;
}
}
...
@@ -117,7 +117,7 @@ public:
...
@@ -117,7 +117,7 @@ public:
using
application_type
=
dummy_application
;
using
application_type
=
dummy_application
;
static
expected
<
std
::
vector
<
byte
>>
serialize
(
actor_system
&
sys
,
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
);
return
dummy_application
::
serialize
(
sys
,
x
);
}
}
...
...
libcaf_net/test/endpoint_manager.cpp
View file @
9eac8a21
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#include "caf/net/make_endpoint_manager.hpp"
#include "caf/net/make_endpoint_manager.hpp"
#include "caf/net/multiplexer.hpp"
#include "caf/net/multiplexer.hpp"
#include "caf/net/stream_socket.hpp"
#include "caf/net/stream_socket.hpp"
#include "caf/node_id.hpp"
#include "caf/span.hpp"
#include "caf/span.hpp"
using
namespace
caf
;
using
namespace
caf
;
...
@@ -62,10 +63,10 @@ struct fixture : test_coordinator_fixture<>, host_fixture {
...
@@ -62,10 +63,10 @@ struct fixture : test_coordinator_fixture<>, host_fixture {
class
dummy_application
{
class
dummy_application
{
public:
public:
static
expected
<
std
::
vector
<
byte
>>
serialize
(
actor_system
&
sys
,
static
expected
<
std
::
vector
<
byte
>>
serialize
(
actor_system
&
sys
,
const
type_erased_tupl
e
&
x
)
{
const
messag
e
&
x
)
{
std
::
vector
<
byte
>
result
;
std
::
vector
<
byte
>
result
;
binary_serializer
sink
{
sys
,
result
};
binary_serializer
sink
{
sys
,
result
};
if
(
auto
err
=
message
::
save
(
sink
,
x
))
if
(
auto
err
=
x
.
save
(
sink
))
return
err
.
value
();
return
err
.
value
();
return
result
;
return
result
;
}
}
...
@@ -124,7 +125,7 @@ public:
...
@@ -124,7 +125,7 @@ public:
template
<
class
Manager
>
template
<
class
Manager
>
void
resolve
(
Manager
&
mgr
,
const
uri
&
locator
,
const
actor
&
listener
)
{
void
resolve
(
Manager
&
mgr
,
const
uri
&
locator
,
const
actor
&
listener
)
{
actor_id
aid
=
42
;
actor_id
aid
=
42
;
auto
hid
=
"0011223344556677889900112233445566778899"
;
auto
hid
=
string_view
(
"0011223344556677889900112233445566778899"
)
;
auto
nid
=
unbox
(
make_node_id
(
42
,
hid
));
auto
nid
=
unbox
(
make_node_id
(
42
,
hid
));
actor_config
cfg
;
actor_config
cfg
;
auto
p
=
make_actor
<
actor_proxy_impl
,
strong_actor_ptr
>
(
aid
,
nid
,
auto
p
=
make_actor
<
actor_proxy_impl
,
strong_actor_ptr
>
(
aid
,
nid
,
...
...
libcaf_net/test/stream_transport.cpp
View file @
9eac8a21
...
@@ -106,7 +106,7 @@ public:
...
@@ -106,7 +106,7 @@ public:
template
<
class
Parent
>
template
<
class
Parent
>
void
resolve
(
Parent
&
parent
,
string_view
path
,
const
actor
&
listener
)
{
void
resolve
(
Parent
&
parent
,
string_view
path
,
const
actor
&
listener
)
{
actor_id
aid
=
42
;
actor_id
aid
=
42
;
auto
hid
=
"0011223344556677889900112233445566778899"
;
auto
hid
=
string_view
(
"0011223344556677889900112233445566778899"
)
;
auto
nid
=
unbox
(
make_node_id
(
42
,
hid
));
auto
nid
=
unbox
(
make_node_id
(
42
,
hid
));
actor_config
cfg
;
actor_config
cfg
;
endpoint_manager_ptr
ptr
{
&
parent
.
manager
()};
endpoint_manager_ptr
ptr
{
&
parent
.
manager
()};
...
@@ -137,11 +137,10 @@ public:
...
@@ -137,11 +137,10 @@ public:
// nop
// nop
}
}
static
expected
<
buffer_type
>
serialize
(
actor_system
&
sys
,
static
expected
<
buffer_type
>
serialize
(
actor_system
&
sys
,
const
message
&
x
)
{
const
type_erased_tuple
&
x
)
{
buffer_type
result
;
buffer_type
result
;
binary_serializer
sink
{
sys
,
result
};
binary_serializer
sink
{
sys
,
result
};
if
(
auto
err
=
message
::
save
(
sink
,
x
))
if
(
auto
err
=
x
.
save
(
sink
))
return
err
.
value
();
return
err
.
value
();
return
result
;
return
result
;
}
}
...
...
libcaf_net/test/string_application.cpp
View file @
9eac8a21
...
@@ -113,10 +113,10 @@ public:
...
@@ -113,10 +113,10 @@ public:
}
}
static
expected
<
std
::
vector
<
byte
>>
serialize
(
actor_system
&
sys
,
static
expected
<
std
::
vector
<
byte
>>
serialize
(
actor_system
&
sys
,
const
type_erased_tupl
e
&
x
)
{
const
messag
e
&
x
)
{
std
::
vector
<
byte
>
result
;
std
::
vector
<
byte
>
result
;
binary_serializer
sink
{
sys
,
result
};
binary_serializer
sink
{
sys
,
result
};
if
(
auto
err
=
message
::
save
(
sink
,
x
))
if
(
auto
err
=
x
.
save
(
sink
))
return
err
.
value
();
return
err
.
value
();
return
result
;
return
result
;
}
}
...
@@ -168,7 +168,7 @@ public:
...
@@ -168,7 +168,7 @@ public:
template
<
class
Parent
>
template
<
class
Parent
>
void
resolve
(
Parent
&
parent
,
string_view
path
,
actor
listener
)
{
void
resolve
(
Parent
&
parent
,
string_view
path
,
actor
listener
)
{
actor_id
aid
=
42
;
actor_id
aid
=
42
;
auto
hid
=
"0011223344556677889900112233445566778899"
;
auto
hid
=
string_view
(
"0011223344556677889900112233445566778899"
)
;
auto
nid
=
unbox
(
make_node_id
(
aid
,
hid
));
auto
nid
=
unbox
(
make_node_id
(
aid
,
hid
));
actor_config
cfg
;
actor_config
cfg
;
auto
sys
=
&
parent
.
system
();
auto
sys
=
&
parent
.
system
();
...
...
libcaf_net/test/transport_worker.cpp
View file @
9eac8a21
...
@@ -103,10 +103,10 @@ public:
...
@@ -103,10 +103,10 @@ public:
}
}
static
expected
<
std
::
vector
<
byte
>>
serialize
(
actor_system
&
sys
,
static
expected
<
std
::
vector
<
byte
>>
serialize
(
actor_system
&
sys
,
const
type_erased_tupl
e
&
x
)
{
const
messag
e
&
x
)
{
std
::
vector
<
byte
>
result
;
std
::
vector
<
byte
>
result
;
binary_serializer
sink
{
sys
,
result
};
binary_serializer
sink
{
sys
,
result
};
if
(
auto
err
=
message
::
save
(
sink
,
x
))
if
(
auto
err
=
x
.
save
(
sink
))
return
err
.
value
();
return
err
.
value
();
return
result
;
return
result
;
}
}
...
...
libcaf_net/test/transport_worker_dispatcher.cpp
View file @
9eac8a21
...
@@ -92,8 +92,7 @@ public:
...
@@ -92,8 +92,7 @@ public:
rec_buf_
->
push_back
(
static_cast
<
byte
>
(
id_
));
rec_buf_
->
push_back
(
static_cast
<
byte
>
(
id_
));
}
}
static
expected
<
buffer_type
>
serialize
(
actor_system
&
,
static
expected
<
buffer_type
>
serialize
(
actor_system
&
,
const
message
&
)
{
const
type_erased_tuple
&
)
{
return
buffer_type
{};
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