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
ea5b4f17
Commit
ea5b4f17
authored
Dec 14, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrate review feedback
parent
3ae049fe
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
214 additions
and
224 deletions
+214
-224
CMakeLists.txt
CMakeLists.txt
+5
-5
libcaf_core/caf/actor_factory.hpp
libcaf_core/caf/actor_factory.hpp
+0
-1
libcaf_core/caf/actor_storage.hpp
libcaf_core/caf/actor_storage.hpp
+0
-1
libcaf_core/caf/binary_deserializer.hpp
libcaf_core/caf/binary_deserializer.hpp
+1
-0
libcaf_core/caf/deserializer.hpp
libcaf_core/caf/deserializer.hpp
+1
-0
libcaf_core/caf/detail/atom_val.hpp
libcaf_core/caf/detail/atom_val.hpp
+11
-129
libcaf_core/caf/detail/parser/read_bool.hpp
libcaf_core/caf/detail/parser/read_bool.hpp
+28
-8
libcaf_core/caf/detail/parser/read_ini.hpp
libcaf_core/caf/detail/parser/read_ini.hpp
+52
-23
libcaf_core/caf/detail/parser/read_ipv4_address.hpp
libcaf_core/caf/detail/parser/read_ipv4_address.hpp
+9
-4
libcaf_core/caf/detail/parser/read_ipv6_address.hpp
libcaf_core/caf/detail/parser/read_ipv6_address.hpp
+75
-40
libcaf_core/caf/detail/parser/read_string.hpp
libcaf_core/caf/detail/parser/read_string.hpp
+27
-11
libcaf_core/caf/infer_handle.hpp
libcaf_core/caf/infer_handle.hpp
+0
-1
libcaf_core/caf/message_id.hpp
libcaf_core/caf/message_id.hpp
+0
-1
libcaf_core/caf/node_id.hpp
libcaf_core/caf/node_id.hpp
+1
-0
libcaf_core/caf/sec.hpp
libcaf_core/caf/sec.hpp
+1
-0
libcaf_core/caf/serializer.hpp
libcaf_core/caf/serializer.hpp
+1
-0
libcaf_core/caf/stream_aborter.hpp
libcaf_core/caf/stream_aborter.hpp
+1
-0
libcaf_core/caf/stream_manager.hpp
libcaf_core/caf/stream_manager.hpp
+1
-0
No files found.
CMakeLists.txt
View file @
ea5b4f17
...
...
@@ -7,10 +7,11 @@ option(BUILD_SHARED_LIBS "Build all modules as shared library" ON)
# -- includes ------------------------------------------------------------------
include
(
CheckCSourceCompiles
)
# Check whether compiler works
include
(
CheckCSourceRuns
)
# Check whether compiler produces binaries
include
(
GNUInstallDirs
)
# Sets default install paths
include
(
GenerateExportHeader
)
# Auto-generates dllexport macros
include
(
CMakePackageConfigHelpers
)
# For creating .cmake files
include
(
CheckCSourceCompiles
)
# Check whether compiler works
include
(
CheckCSourceRuns
)
# Check whether compiler produces binaries
include
(
GNUInstallDirs
)
# Sets default install paths
include
(
GenerateExportHeader
)
# Auto-generates dllexport macros
# -- check whether we are running as CMake subdirectory ------------------------
...
...
@@ -573,7 +574,6 @@ install(EXPORT CAFTargets
DESTINATION
"
${
INSTALL_CAF_CMAKEDIR
}
"
NAMESPACE caf::
)
include
(
CMakePackageConfigHelpers
)
write_basic_package_version_file
(
"
${
CMAKE_CURRENT_BINARY_DIR
}
/CAFConfigVersion.cmake"
VERSION
${
CAF_VERSION
}
...
...
libcaf_core/caf/actor_factory.hpp
View file @
ea5b4f17
...
...
@@ -23,7 +23,6 @@
#include "caf/actor_addr.hpp"
#include "caf/actor_system.hpp"
#include "caf/detail/core_export.hpp"
#include "caf/detail/type_traits.hpp"
#include "caf/execution_unit.hpp"
#include "caf/infer_handle.hpp"
...
...
libcaf_core/caf/actor_storage.hpp
View file @
ea5b4f17
...
...
@@ -26,7 +26,6 @@
#include "caf/abstract_actor.hpp"
#include "caf/actor_control_block.hpp"
#include "caf/config.hpp"
#include "caf/detail/core_export.hpp"
#ifdef CAF_GCC
# pragma GCC diagnostic push
...
...
libcaf_core/caf/binary_deserializer.hpp
View file @
ea5b4f17
...
...
@@ -23,6 +23,7 @@
#include <tuple>
#include <utility>
#include "caf/detail/core_export.hpp"
#include "caf/error_code.hpp"
#include "caf/fwd.hpp"
#include "caf/sec.hpp"
...
...
libcaf_core/caf/deserializer.hpp
View file @
ea5b4f17
...
...
@@ -25,6 +25,7 @@
#include <utility>
#include "caf/byte.hpp"
#include "caf/detail/core_export.hpp"
#include "caf/fwd.hpp"
#include "caf/span.hpp"
#include "caf/write_inspector.hpp"
...
...
libcaf_core/caf/detail/atom_val.hpp
View file @
ea5b4f17
...
...
@@ -22,137 +22,19 @@ namespace caf::detail {
namespace
{
// clang-format off
// encodes ASCII characters to 6bit encoding
constexpr
unsigned
char
encoding_table
[]
=
{
/* ..0 ..1 ..2 ..3 ..4 ..5 ..6 ..7 ..8 ..9 ..A ..B ..C ..D ..E ..F */
/* 0.. */
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
/* 1.. */
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
/* 2.. */
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
/* 3.. */
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
0
,
0
,
0
,
0
,
0
,
0
,
/* 4.. */
0
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
,
24
,
25
,
/* 5.. */
26
,
27
,
28
,
29
,
30
,
31
,
32
,
33
,
34
,
35
,
36
,
0
,
0
,
0
,
0
,
37
,
/* 6.. */
0
,
38
,
39
,
40
,
41
,
42
,
43
,
44
,
45
,
46
,
47
,
48
,
49
,
50
,
51
,
52
,
/* 7.. */
53
,
54
,
55
,
56
,
57
,
58
,
59
,
60
,
61
,
62
,
63
,
0
,
0
,
0
,
0
,
0
};
/* ..0 ..1 ..2 ..3 ..4 ..5 ..6 ..7 ..8 ..9 ..A ..B ..C ..D ..E ..F */
/* 0.. */
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
/* 1.. */
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
/* 2.. */
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
/* 3.. */
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
0
,
0
,
0
,
0
,
0
,
0
,
/* 4.. */
0
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
,
24
,
25
,
/* 5.. */
26
,
27
,
28
,
29
,
30
,
31
,
32
,
33
,
34
,
35
,
36
,
0
,
0
,
0
,
0
,
37
,
/* 6.. */
0
,
38
,
39
,
40
,
41
,
42
,
43
,
44
,
45
,
46
,
47
,
48
,
49
,
50
,
51
,
52
,
/* 7.. */
53
,
54
,
55
,
56
,
57
,
58
,
59
,
60
,
61
,
62
,
63
,
0
,
0
,
0
,
0
,
0
};
// clang-format on
// decodes 6bit characters to ASCII
constexpr
char
decoding_table
[]
=
" 0123456789"
...
...
libcaf_core/caf/detail/parser/read_bool.hpp
View file @
ea5b4f17
...
...
@@ -41,18 +41,38 @@ void read_bool(State& ps, Consumer&& consumer) {
if
(
ps
.
code
<=
pec
::
trailing_character
)
consumer
.
value
(
std
::
move
(
res
));
});
// clang-format off
start
();
state
(
init
){
transition
(
has_f
,
'f'
)
transition
(
has_t
,
't'
)}
state
(
has_f
){
transition
(
has_fa
,
'a'
)}
state
(
has_fa
){
transition
(
has_fal
,
'l'
)}
state
(
has_fal
){
transition
(
has_fals
,
's'
)}
state
(
has_fals
){
transition
(
done
,
'e'
,
res
=
false
)}
state
(
has_t
){
transition
(
has_tr
,
'r'
)}
state
(
has_tr
){
transition
(
has_tru
,
'u'
)}
state
(
has_tru
){
transition
(
done
,
'e'
,
res
=
true
)}
term_state
(
done
)
{
state
(
init
)
{
transition
(
has_f
,
'f'
)
transition
(
has_t
,
't'
)
}
state
(
has_f
)
{
transition
(
has_fa
,
'a'
)
}
state
(
has_fa
)
{
transition
(
has_fal
,
'l'
)
}
state
(
has_fal
)
{
transition
(
has_fals
,
's'
)
}
state
(
has_fals
)
{
transition
(
done
,
'e'
,
res
=
false
)
}
state
(
has_t
)
{
transition
(
has_tr
,
'r'
)
}
state
(
has_tr
)
{
transition
(
has_tru
,
'u'
)
}
state
(
has_tru
)
{
transition
(
done
,
'e'
,
res
=
true
)
}
term_state
(
done
)
{
// nop
}
fin
();
// clang-format on
}
}
// namespace caf::detail::parser
...
...
libcaf_core/caf/detail/parser/read_ini.hpp
View file @
ea5b4f17
...
...
@@ -58,11 +58,17 @@ namespace caf::detail::parser {
template
<
class
State
,
class
Consumer
>
void
read_ini_comment
(
State
&
ps
,
Consumer
&&
)
{
// clang-format off
start
();
term_state
(
init
){
transition
(
done
,
'\n'
)
transition
(
init
)}
term_state
(
done
)
{
term_state
(
init
)
{
transition
(
done
,
'\n'
)
transition
(
init
)
}
term_state
(
done
)
{
// nop
}
fin
();
// clang-format on
}
template
<
class
State
,
class
Consumer
>
...
...
@@ -70,18 +76,28 @@ void read_ini_value(State& ps, Consumer&& consumer);
template
<
class
State
,
class
Consumer
>
void
read_ini_list
(
State
&
ps
,
Consumer
&&
consumer
)
{
// clang-format off
start
();
state
(
init
){
epsilon
(
before_value
)}
state
(
before_value
){
transition
(
before_value
,
"
\t\n
"
)
transition
(
done
,
']'
,
consumer
.
end_list
())
fsm_epsilon
(
read_ini_comment
(
ps
,
consumer
),
before_value
,
';'
)
fsm_epsilon
(
read_ini_value
(
ps
,
consumer
),
after_value
)}
state
(
after_value
){
transition
(
after_value
,
"
\t\n
"
)
transition
(
before_value
,
','
)
transition
(
done
,
']'
,
consumer
.
end_list
())
fsm_epsilon
(
read_ini_comment
(
ps
,
consumer
),
after_value
,
';'
)}
term_state
(
done
)
{
state
(
init
)
{
epsilon
(
before_value
)
}
state
(
before_value
)
{
transition
(
before_value
,
"
\t\n
"
)
transition
(
done
,
']'
,
consumer
.
end_list
())
fsm_epsilon
(
read_ini_comment
(
ps
,
consumer
),
before_value
,
';'
)
fsm_epsilon
(
read_ini_value
(
ps
,
consumer
),
after_value
)
}
state
(
after_value
)
{
transition
(
after_value
,
"
\t\n
"
)
transition
(
before_value
,
','
)
transition
(
done
,
']'
,
consumer
.
end_list
())
fsm_epsilon
(
read_ini_comment
(
ps
,
consumer
),
after_value
,
';'
)
}
term_state
(
done
)
{
// nop
}
fin
();
// clang-format on
}
template
<
class
State
,
class
Consumer
>
...
...
@@ -146,33 +162,46 @@ void read_ini_uri(State& ps, Consumer&& consumer) {
if
(
ps
.
code
<=
pec
::
trailing_character
)
consumer
.
value
(
builder
.
make
());
});
// clang-format off
start
();
state
(
init
){
transition
(
init
,
"
\t\n
"
)
transition
(
before_uri
,
'<'
)}
state
(
before_uri
){
state
(
init
)
{
transition
(
init
,
"
\t\n
"
)
transition
(
before_uri
,
'<'
)
}
state
(
before_uri
)
{
transition
(
before_uri
,
"
\t\n
"
)
fsm_epsilon
(
read_uri
(
ps
,
builder
),
after_uri
)}
state
(
after_uri
){
transition
(
after_uri
,
"
\t\n
"
)
transition
(
done
,
'>'
)}
term_state
(
done
)
{
fsm_epsilon
(
read_uri
(
ps
,
builder
),
after_uri
)
}
state
(
after_uri
)
{
transition
(
after_uri
,
"
\t\n
"
)
transition
(
done
,
'>'
)
}
term_state
(
done
)
{
// nop
}
fin
();
// clang-format on
}
template
<
class
State
,
class
Consumer
>
void
read_ini_value
(
State
&
ps
,
Consumer
&&
consumer
)
{
// clang-format off
start
();
state
(
init
){
fsm_epsilon
(
read_string
(
ps
,
consumer
),
done
,
'"'
)
fsm_epsilon
(
read_atom
(
ps
,
consumer
),
done
,
'\''
)
fsm_epsilon
(
read_number
(
ps
,
consumer
),
done
,
'.'
)
fsm_epsilon
(
read_bool
(
ps
,
consumer
),
done
,
"ft"
)
fsm_epsilon
(
read_number_or_timespan
(
ps
,
consumer
),
done
,
"0123456789+-"
)
fsm_epsilon
(
read_ini_uri
(
ps
,
consumer
),
done
,
'<'
)
fsm_transition
(
read_ini_list
(
ps
,
consumer
.
begin_list
()),
done
,
'['
)
fsm_transition
(
read_ini_map
(
ps
,
consumer
.
begin_map
()),
done
,
'{'
)}
term_state
(
done
)
{
state
(
init
)
{
fsm_epsilon
(
read_string
(
ps
,
consumer
),
done
,
'"'
)
fsm_epsilon
(
read_atom
(
ps
,
consumer
),
done
,
'\''
)
fsm_epsilon
(
read_number
(
ps
,
consumer
),
done
,
'.'
)
fsm_epsilon
(
read_bool
(
ps
,
consumer
),
done
,
"ft"
)
fsm_epsilon
(
read_number_or_timespan
(
ps
,
consumer
),
done
,
"0123456789+-"
)
fsm_epsilon
(
read_ini_uri
(
ps
,
consumer
),
done
,
'<'
)
fsm_transition
(
read_ini_list
(
ps
,
consumer
.
begin_list
()),
done
,
'['
)
fsm_transition
(
read_ini_map
(
ps
,
consumer
.
begin_map
()),
done
,
'{'
)
}
term_state
(
done
)
{
// nop
}
fin
();
// clang-format on
}
/// Reads an INI formatted input.
...
...
libcaf_core/caf/detail/parser/read_ipv4_address.hpp
View file @
ea5b4f17
...
...
@@ -55,11 +55,16 @@ void read_ipv4_octet(State& ps, Consumer& consumer) {
if
(
ps
.
code
<=
pec
::
trailing_character
)
consumer
.
value
(
res
);
});
// clang-format off
start
();
state
(
init
){
transition
(
read
,
decimal_chars
,
rd_decimal
(
ch
),
pec
::
integer_overflow
)}
term_state
(
read
){
transition
(
read
,
decimal_chars
,
rd_decimal
(
ch
),
pec
::
integer_overflow
)}
fin
();
state
(
init
)
{
transition
(
read
,
decimal_chars
,
rd_decimal
(
ch
),
pec
::
integer_overflow
)
}
term_state
(
read
)
{
transition
(
read
,
decimal_chars
,
rd_decimal
(
ch
),
pec
::
integer_overflow
)
}
fin
();
// clang-format on
}
/// Reads a number, i.e., on success produces either an `int64_t` or a
...
...
libcaf_core/caf/detail/parser/read_ipv6_address.hpp
View file @
ea5b4f17
...
...
@@ -68,11 +68,17 @@ void read_ipv6_h16(State& ps, Consumer& consumer) {
if
(
ps
.
code
<=
pec
::
trailing_character
)
consumer
.
value
(
res
);
});
// clang-format off
start
();
state
(
init
){
transition
(
read
,
hexadecimal_chars
,
rd_hex
(
ch
),
pec
::
integer_overflow
)}
term_state
(
read
){
transition_if
(
digits
<
4
,
read
,
hexadecimal_chars
,
rd_hex
(
ch
),
pec
::
integer_overflow
)}
fin
();
state
(
init
)
{
transition
(
read
,
hexadecimal_chars
,
rd_hex
(
ch
),
pec
::
integer_overflow
)
}
term_state
(
read
)
{
transition_if
(
digits
<
4
,
read
,
hexadecimal_chars
,
rd_hex
(
ch
),
pec
::
integer_overflow
)
}
fin
();
// clang-format on
}
/// Reads 16 (hex) or 32 (IPv4 notation) bits of an IPv6 address.
...
...
@@ -118,21 +124,29 @@ void read_ipv6_h16_or_l32(State& ps, Consumer& consumer) {
fin_octet
();
}
});
// clang-format off
start
();
state
(
init
){
transition
(
read
,
hexadecimal_chars
,
rd_both
(
ch
),
pec
::
integer_overflow
)}
term_state
(
read
){
transition_if
(
mode
==
indeterminate
,
read
,
hexadecimal_chars
,
rd_both
(
ch
),
pec
::
integer_overflow
)
transition_if
(
mode
==
v6_bits
,
read
,
hexadecimal_chars
,
rd_hex
(
ch
),
pec
::
integer_overflow
)
transition_if
(
mode
!=
v6_bits
&&
digits
>
0
,
read_octet
,
'.'
,
fin_octet
())}
state
(
read_octet
){
state
(
init
)
{
transition
(
read
,
hexadecimal_chars
,
rd_both
(
ch
),
pec
::
integer_overflow
)
}
term_state
(
read
)
{
transition_if
(
mode
==
indeterminate
,
read
,
hexadecimal_chars
,
rd_both
(
ch
),
pec
::
integer_overflow
)
transition_if
(
mode
==
v6_bits
,
read
,
hexadecimal_chars
,
rd_hex
(
ch
),
pec
::
integer_overflow
)
transition_if
(
mode
!=
v6_bits
&&
digits
>
0
,
read_octet
,
'.'
,
fin_octet
())
}
state
(
read_octet
)
{
transition
(
read_octet
,
decimal_chars
,
rd_dec
(
ch
),
pec
::
integer_overflow
)
transition_if
(
octet
<
2
&&
digits
>
0
,
read_octet
,
'.'
,
fin_octet
())
transition_if
(
octet
==
2
&&
digits
>
0
,
read_last_octet
,
'.'
,
fin_octet
())}
term_state
(
read_last_octet
){
transition
(
read_last_octet
,
decimal_chars
,
rd_dec
(
ch
),
pec
::
integer_overflow
)}
fin
();
transition_if
(
octet
<
2
&&
digits
>
0
,
read_octet
,
'.'
,
fin_octet
())
transition_if
(
octet
==
2
&&
digits
>
0
,
read_last_octet
,
'.'
,
fin_octet
())
}
term_state
(
read_last_octet
)
{
transition
(
read_last_octet
,
decimal_chars
,
rd_dec
(
ch
),
pec
::
integer_overflow
)
}
fin
();
// clang-format on
}
template
<
class
F
>
...
...
@@ -208,31 +222,42 @@ void read_ipv6_address(State& ps, Consumer&& consumer) {
}
return
false
;
};
// clang-format off
start
();
// Either transitions to reading leading "::" or reads the first h16. When
// reading an l32 immediately promotes to IPv4 address and stops.
state
(
init
){
transition
(
rd_sep
,
':'
)
fsm_epsilon
(
read_ipv6_h16_or_l32
(
ps
,
prefix_consumer
),
maybe_has_l32
,
hexadecimal_chars
)}
state
(
init
)
{
transition
(
rd_sep
,
':'
)
fsm_epsilon
(
read_ipv6_h16_or_l32
(
ps
,
prefix_consumer
),
maybe_has_l32
,
hexadecimal_chars
)
}
// Checks whether the first call to read_ipv6_h16_or_l32 consumed
// exactly 4 bytes. If so, we have an IPv4-formatted address.
unstable_state
(
maybe_has_l32
){
epsilon_if
(
promote_v4
(),
done
)
epsilon
(
rd_prefix_sep
)}
unstable_state
(
maybe_has_l32
)
{
epsilon_if
(
promote_v4
(),
done
)
epsilon
(
rd_prefix_sep
)
}
// Got ":" at a position where it can only be parsed as "::".
state
(
rd_sep
){
transition
(
has_sep
,
':'
)}
state
(
rd_sep
)
{
transition
(
has_sep
,
':'
)
}
// Stops parsing after reading "::" (all-zero address) or proceeds with
// reading the suffix.
term_state
(
has_sep
){
epsilon
(
rd_suffix
,
hexadecimal_chars
)}
term_state
(
has_sep
)
{
epsilon
(
rd_suffix
,
hexadecimal_chars
)
}
// Read part of the prefix, i.e., everything before "::".
state
(
rd_prefix
){
fsm_epsilon_if
(
remaining_bytes
()
>
4
,
read_ipv6_h16
(
ps
,
prefix_consumer
),
state
(
rd_prefix
)
{
fsm_epsilon_if
(
remaining_bytes
()
>
4
,
read_ipv6_h16
(
ps
,
prefix_consumer
),
rd_prefix_sep
,
hexadecimal_chars
)
fsm_epsilon_if
(
remaining_bytes
()
==
4
,
read_ipv6_h16_or_l32
(
ps
,
prefix_consumer
),
maybe_done
,
hexadecimal_chars
)
fsm_epsilon_if
(
remaining_bytes
()
==
2
,
read_ipv6_h16
(
ps
,
prefix_consumer
),
done
,
hexadecimal_chars
)}
fsm_epsilon_if
(
remaining_bytes
()
==
4
,
read_ipv6_h16_or_l32
(
ps
,
prefix_consumer
),
maybe_done
,
hexadecimal_chars
)
fsm_epsilon_if
(
remaining_bytes
()
==
2
,
read_ipv6_h16
(
ps
,
prefix_consumer
),
done
,
hexadecimal_chars
)
}
// Checks whether we've read an l32 in our last call to read_ipv6_h16_or_l32,
// in which case we're done. Otherwise continues to read the last two bytes.
unstable_state
(
maybe_done
)
{
...
...
@@ -240,23 +265,33 @@ void read_ipv6_address(State& ps, Consumer&& consumer) {
epsilon
(
rd_prefix_sep
)
}
// Waits for ":" after reading an h16 in the prefix.
state
(
rd_prefix_sep
){
transition
(
rd_next_prefix
,
':'
)}
state
(
rd_prefix_sep
)
{
transition
(
rd_next_prefix
,
':'
)
}
// Waits for either the second ":" or an h16/l32 after reading an ":".
state
(
rd_next_prefix
){
transition
(
has_sep
,
':'
)
epsilon
(
rd_prefix
)}
state
(
rd_next_prefix
)
{
transition
(
has_sep
,
':'
)
epsilon
(
rd_prefix
)
}
// Reads a part of the suffix.
state
(
rd_suffix
){
state
(
rd_suffix
)
{
fsm_epsilon_if
(
remaining_bytes
()
>=
4
,
read_ipv6_h16_or_l32
(
ps
,
suffix_consumer
),
rd_next_suffix
,
hexadecimal_chars
)
fsm_epsilon_if
(
remaining_bytes
()
==
2
,
read_ipv6_h16
(
ps
,
suffix_consumer
),
rd_next_suffix
,
hexadecimal_chars
)}
read_ipv6_h16_or_l32
(
ps
,
suffix_consumer
),
rd_next_suffix
,
hexadecimal_chars
)
fsm_epsilon_if
(
remaining_bytes
()
==
2
,
read_ipv6_h16
(
ps
,
suffix_consumer
),
rd_next_suffix
,
hexadecimal_chars
)
}
// Reads the ":" separator between h16.
term_state
(
rd_next_suffix
){
transition
(
rd_suffix
,
':'
)}
term_state
(
rd_next_suffix
)
{
transition
(
rd_suffix
,
':'
)
}
// Accepts only the end-of-input, since we've read a full IP address.
term_state
(
done
)
{
// nop
}
fin
();
// clang-format on
}
}
// namespace caf::detail::parser
...
...
libcaf_core/caf/detail/parser/read_string.hpp
View file @
ea5b4f17
...
...
@@ -41,20 +41,36 @@ void read_string(State& ps, Consumer&& consumer) {
if
(
ps
.
code
<=
pec
::
trailing_character
)
consumer
.
value
(
std
::
move
(
res
));
});
// clang-format off
start
();
state
(
init
){
transition
(
init
,
"
\t
"
)
transition
(
read_chars
,
'"'
)
transition
(
read_unquoted_chars
,
alphanumeric_chars
,
res
+=
ch
)}
state
(
read_chars
){
transition
(
escape
,
'\\'
)
transition
(
done
,
'"'
)
error_transition
(
pec
::
unexpected_newline
,
'\n'
)
transition
(
read_chars
,
any_char
,
res
+=
ch
)}
state
(
escape
){
state
(
init
)
{
transition
(
init
,
"
\t
"
)
transition
(
read_chars
,
'"'
)
transition
(
read_unquoted_chars
,
alphanumeric_chars
,
res
+=
ch
)
}
state
(
read_chars
)
{
transition
(
escape
,
'\\'
)
transition
(
done
,
'"'
)
error_transition
(
pec
::
unexpected_newline
,
'\n'
)
transition
(
read_chars
,
any_char
,
res
+=
ch
)
}
state
(
escape
)
{
transition
(
read_chars
,
'n'
,
res
+=
'\n'
)
transition
(
read_chars
,
'r'
,
res
+=
'\r'
)
transition
(
read_chars
,
't'
,
res
+=
'\t'
)
transition
(
read_chars
,
'\\'
,
res
+=
'\\'
)
transition
(
read_chars
,
'"'
,
res
+=
'"'
)
error_transition
(
pec
::
illegal_escape_sequence
)}
term_state
(
read_unquoted_chars
){
transition
(
read_chars
,
'r'
,
res
+=
'\r'
)
transition
(
read_chars
,
't'
,
res
+=
'\t'
)
transition
(
read_chars
,
'\\'
,
res
+=
'\\'
)
transition
(
read_chars
,
'"'
,
res
+=
'"'
)
error_transition
(
pec
::
illegal_escape_sequence
)
}
term_state
(
read_unquoted_chars
)
{
transition
(
read_unquoted_chars
,
alphanumeric_chars
,
res
+=
ch
)
epsilon
(
done
)}
term_state
(
done
){
transition
(
done
,
"
\t
"
)}
fin
();
epsilon
(
done
)
}
term_state
(
done
)
{
transition
(
done
,
"
\t
"
)
}
fin
();
// clang-format on
}
}
// namespace caf::detail::parser
...
...
libcaf_core/caf/infer_handle.hpp
View file @
ea5b4f17
...
...
@@ -21,7 +21,6 @@
#include "caf/abstract_composable_behavior.hpp"
#include "caf/actor.hpp"
#include "caf/actor_addr.hpp"
#include "caf/detail/core_export.hpp"
#include "caf/stateful_actor.hpp"
#include "caf/typed_behavior.hpp"
...
...
libcaf_core/caf/message_id.hpp
View file @
ea5b4f17
...
...
@@ -24,7 +24,6 @@
#include "caf/config.hpp"
#include "caf/detail/comparable.hpp"
#include "caf/detail/core_export.hpp"
#include "caf/detail/type_traits.hpp"
#include "caf/error.hpp"
#include "caf/message_priority.hpp"
...
...
libcaf_core/caf/node_id.hpp
View file @
ea5b4f17
...
...
@@ -25,6 +25,7 @@
#include "caf/atom.hpp"
#include "caf/detail/comparable.hpp"
#include "caf/detail/core_export.hpp"
#include "caf/fwd.hpp"
#include "caf/intrusive_ptr.hpp"
#include "caf/none.hpp"
...
...
libcaf_core/caf/sec.hpp
View file @
ea5b4f17
...
...
@@ -24,6 +24,7 @@
#include <string>
#include "caf/detail/core_export.hpp"
#include "caf/fwd.hpp"
namespace
caf
{
...
...
libcaf_core/caf/serializer.hpp
View file @
ea5b4f17
...
...
@@ -25,6 +25,7 @@
#include <utility>
#include "caf/byte.hpp"
#include "caf/detail/core_export.hpp"
#include "caf/error.hpp"
#include "caf/fwd.hpp"
#include "caf/meta/annotation.hpp"
...
...
libcaf_core/caf/stream_aborter.hpp
View file @
ea5b4f17
...
...
@@ -20,6 +20,7 @@
#include "caf/actor_addr.hpp"
#include "caf/attachable.hpp"
#include "caf/detail/core_export.hpp"
#include "caf/fwd.hpp"
#include "caf/stream_slot.hpp"
...
...
libcaf_core/caf/stream_manager.hpp
View file @
ea5b4f17
...
...
@@ -25,6 +25,7 @@
#include "caf/actor.hpp"
#include "caf/actor_cast.hpp"
#include "caf/detail/core_export.hpp"
#include "caf/downstream_manager.hpp"
#include "caf/downstream_msg.hpp"
#include "caf/fwd.hpp"
...
...
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