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
31e73412
Commit
31e73412
authored
Oct 23, 2021
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-use the upstream enum string generator script
parent
c18a1e1a
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1 addition
and
398 deletions
+1
-398
libcaf_net/CMakeLists.txt
libcaf_net/CMakeLists.txt
+1
-5
libcaf_net/src/net/basp/connection_state_strings.cpp
libcaf_net/src/net/basp/connection_state_strings.cpp
+0
-75
libcaf_net/src/net/basp/ec_strings.cpp
libcaf_net/src/net/basp/ec_strings.cpp
+0
-129
libcaf_net/src/net/basp/message_type_strings.cpp
libcaf_net/src/net/basp/message_type_strings.cpp
+0
-87
libcaf_net/src/net/basp/operation_strings.cpp
libcaf_net/src/net/basp/operation_strings.cpp
+0
-29
libcaf_net/src/net/operation_strings.cpp
libcaf_net/src/net/operation_strings.cpp
+0
-73
No files found.
libcaf_net/CMakeLists.txt
View file @
31e73412
...
@@ -12,7 +12,7 @@ caf_incubator_add_component(
...
@@ -12,7 +12,7 @@ caf_incubator_add_component(
$<$<CXX_COMPILER_ID:MSVC>:ws2_32>
$<$<CXX_COMPILER_ID:MSVC>:ws2_32>
PRIVATE
PRIVATE
CAF::internal
CAF::internal
ENUM_
CONSISTENCY_CHECK
S
ENUM_
TYPE
S
net.basp.connection_state
net.basp.connection_state
net.basp.ec
net.basp.ec
net.basp.message_type
net.basp.message_type
...
@@ -30,10 +30,6 @@ caf_incubator_add_component(
...
@@ -30,10 +30,6 @@ caf_incubator_add_component(
src/multiplexer.cpp
src/multiplexer.cpp
src/net/abstract_actor_shell.cpp
src/net/abstract_actor_shell.cpp
src/net/actor_shell.cpp
src/net/actor_shell.cpp
src/net/basp/connection_state_strings.cpp
src/net/basp/ec_strings.cpp
src/net/basp/message_type_strings.cpp
src/net/basp/operation_strings.cpp
src/net/middleman.cpp
src/net/middleman.cpp
src/net/middleman_backend.cpp
src/net/middleman_backend.cpp
src/net/packet_writer.cpp
src/net/packet_writer.cpp
...
...
libcaf_net/src/net/basp/connection_state_strings.cpp
deleted
100644 → 0
View file @
c18a1e1a
// clang-format off
// DO NOT EDIT: this file is auto-generated by caf-generate-enum-strings.
// Run the target update-enum-strings if this file is out of sync.
#include "caf/config.hpp"
#include "caf/string_view.hpp"
CAF_PUSH_DEPRECATED_WARNING
#include "caf/net/basp/connection_state.hpp"
#include <string>
namespace
caf
{
namespace
net
{
namespace
basp
{
std
::
string
to_string
(
connection_state
x
)
{
switch
(
x
)
{
default:
return
"???"
;
case
connection_state
:
:
await_handshake_header
:
return
"await_handshake_header"
;
case
connection_state
:
:
await_handshake_payload
:
return
"await_handshake_payload"
;
case
connection_state
:
:
await_header
:
return
"await_header"
;
case
connection_state
:
:
await_payload
:
return
"await_payload"
;
case
connection_state
:
:
shutdown
:
return
"shutdown"
;
};
}
bool
from_string
(
string_view
in
,
connection_state
&
out
)
{
if
(
in
==
"await_handshake_header"
)
{
out
=
connection_state
::
await_handshake_header
;
return
true
;
}
else
if
(
in
==
"await_handshake_payload"
)
{
out
=
connection_state
::
await_handshake_payload
;
return
true
;
}
else
if
(
in
==
"await_header"
)
{
out
=
connection_state
::
await_header
;
return
true
;
}
else
if
(
in
==
"await_payload"
)
{
out
=
connection_state
::
await_payload
;
return
true
;
}
else
if
(
in
==
"shutdown"
)
{
out
=
connection_state
::
shutdown
;
return
true
;
}
else
{
return
false
;
}
}
bool
from_integer
(
std
::
underlying_type_t
<
connection_state
>
in
,
connection_state
&
out
)
{
auto
result
=
static_cast
<
connection_state
>
(
in
);
switch
(
result
)
{
default:
return
false
;
case
connection_state
:
:
await_handshake_header
:
case
connection_state
:
:
await_handshake_payload
:
case
connection_state
:
:
await_header
:
case
connection_state
:
:
await_payload
:
case
connection_state
:
:
shutdown
:
out
=
result
;
return
true
;
};
}
}
// namespace basp
}
// namespace net
}
// namespace caf
CAF_POP_WARNINGS
libcaf_net/src/net/basp/ec_strings.cpp
deleted
100644 → 0
View file @
c18a1e1a
// clang-format off
// DO NOT EDIT: this file is auto-generated by caf-generate-enum-strings.
// Run the target update-enum-strings if this file is out of sync.
#include "caf/config.hpp"
#include "caf/string_view.hpp"
CAF_PUSH_DEPRECATED_WARNING
#include "caf/net/basp/ec.hpp"
#include <string>
namespace
caf
{
namespace
net
{
namespace
basp
{
std
::
string
to_string
(
ec
x
)
{
switch
(
x
)
{
default:
return
"???"
;
case
ec
:
:
invalid_magic_number
:
return
"invalid_magic_number"
;
case
ec
:
:
unexpected_number_of_bytes
:
return
"unexpected_number_of_bytes"
;
case
ec
:
:
unexpected_payload
:
return
"unexpected_payload"
;
case
ec
:
:
missing_payload
:
return
"missing_payload"
;
case
ec
:
:
illegal_state
:
return
"illegal_state"
;
case
ec
:
:
invalid_handshake
:
return
"invalid_handshake"
;
case
ec
:
:
missing_handshake
:
return
"missing_handshake"
;
case
ec
:
:
unexpected_handshake
:
return
"unexpected_handshake"
;
case
ec
:
:
version_mismatch
:
return
"version_mismatch"
;
case
ec
:
:
unimplemented
:
return
"unimplemented"
;
case
ec
:
:
app_identifiers_mismatch
:
return
"app_identifiers_mismatch"
;
case
ec
:
:
invalid_payload
:
return
"invalid_payload"
;
case
ec
:
:
invalid_scheme
:
return
"invalid_scheme"
;
case
ec
:
:
invalid_locator
:
return
"invalid_locator"
;
};
}
bool
from_string
(
string_view
in
,
ec
&
out
)
{
if
(
in
==
"invalid_magic_number"
)
{
out
=
ec
::
invalid_magic_number
;
return
true
;
}
else
if
(
in
==
"unexpected_number_of_bytes"
)
{
out
=
ec
::
unexpected_number_of_bytes
;
return
true
;
}
else
if
(
in
==
"unexpected_payload"
)
{
out
=
ec
::
unexpected_payload
;
return
true
;
}
else
if
(
in
==
"missing_payload"
)
{
out
=
ec
::
missing_payload
;
return
true
;
}
else
if
(
in
==
"illegal_state"
)
{
out
=
ec
::
illegal_state
;
return
true
;
}
else
if
(
in
==
"invalid_handshake"
)
{
out
=
ec
::
invalid_handshake
;
return
true
;
}
else
if
(
in
==
"missing_handshake"
)
{
out
=
ec
::
missing_handshake
;
return
true
;
}
else
if
(
in
==
"unexpected_handshake"
)
{
out
=
ec
::
unexpected_handshake
;
return
true
;
}
else
if
(
in
==
"version_mismatch"
)
{
out
=
ec
::
version_mismatch
;
return
true
;
}
else
if
(
in
==
"unimplemented"
)
{
out
=
ec
::
unimplemented
;
return
true
;
}
else
if
(
in
==
"app_identifiers_mismatch"
)
{
out
=
ec
::
app_identifiers_mismatch
;
return
true
;
}
else
if
(
in
==
"invalid_payload"
)
{
out
=
ec
::
invalid_payload
;
return
true
;
}
else
if
(
in
==
"invalid_scheme"
)
{
out
=
ec
::
invalid_scheme
;
return
true
;
}
else
if
(
in
==
"invalid_locator"
)
{
out
=
ec
::
invalid_locator
;
return
true
;
}
else
{
return
false
;
}
}
bool
from_integer
(
std
::
underlying_type_t
<
ec
>
in
,
ec
&
out
)
{
auto
result
=
static_cast
<
ec
>
(
in
);
switch
(
result
)
{
default:
return
false
;
case
ec
:
:
invalid_magic_number
:
case
ec
:
:
unexpected_number_of_bytes
:
case
ec
:
:
unexpected_payload
:
case
ec
:
:
missing_payload
:
case
ec
:
:
illegal_state
:
case
ec
:
:
invalid_handshake
:
case
ec
:
:
missing_handshake
:
case
ec
:
:
unexpected_handshake
:
case
ec
:
:
version_mismatch
:
case
ec
:
:
unimplemented
:
case
ec
:
:
app_identifiers_mismatch
:
case
ec
:
:
invalid_payload
:
case
ec
:
:
invalid_scheme
:
case
ec
:
:
invalid_locator
:
out
=
result
;
return
true
;
};
}
}
// namespace basp
}
// namespace net
}
// namespace caf
CAF_POP_WARNINGS
libcaf_net/src/net/basp/message_type_strings.cpp
deleted
100644 → 0
View file @
c18a1e1a
// clang-format off
// DO NOT EDIT: this file is auto-generated by caf-generate-enum-strings.
// Run the target update-enum-strings if this file is out of sync.
#include "caf/config.hpp"
#include "caf/string_view.hpp"
CAF_PUSH_DEPRECATED_WARNING
#include "caf/net/basp/message_type.hpp"
#include <string>
namespace
caf
{
namespace
net
{
namespace
basp
{
std
::
string
to_string
(
message_type
x
)
{
switch
(
x
)
{
default:
return
"???"
;
case
message_type
:
:
handshake
:
return
"handshake"
;
case
message_type
:
:
actor_message
:
return
"actor_message"
;
case
message_type
:
:
resolve_request
:
return
"resolve_request"
;
case
message_type
:
:
resolve_response
:
return
"resolve_response"
;
case
message_type
:
:
monitor_message
:
return
"monitor_message"
;
case
message_type
:
:
down_message
:
return
"down_message"
;
case
message_type
:
:
heartbeat
:
return
"heartbeat"
;
};
}
bool
from_string
(
string_view
in
,
message_type
&
out
)
{
if
(
in
==
"handshake"
)
{
out
=
message_type
::
handshake
;
return
true
;
}
else
if
(
in
==
"actor_message"
)
{
out
=
message_type
::
actor_message
;
return
true
;
}
else
if
(
in
==
"resolve_request"
)
{
out
=
message_type
::
resolve_request
;
return
true
;
}
else
if
(
in
==
"resolve_response"
)
{
out
=
message_type
::
resolve_response
;
return
true
;
}
else
if
(
in
==
"monitor_message"
)
{
out
=
message_type
::
monitor_message
;
return
true
;
}
else
if
(
in
==
"down_message"
)
{
out
=
message_type
::
down_message
;
return
true
;
}
else
if
(
in
==
"heartbeat"
)
{
out
=
message_type
::
heartbeat
;
return
true
;
}
else
{
return
false
;
}
}
bool
from_integer
(
std
::
underlying_type_t
<
message_type
>
in
,
message_type
&
out
)
{
auto
result
=
static_cast
<
message_type
>
(
in
);
switch
(
result
)
{
default:
return
false
;
case
message_type
:
:
handshake
:
case
message_type
:
:
actor_message
:
case
message_type
:
:
resolve_request
:
case
message_type
:
:
resolve_response
:
case
message_type
:
:
monitor_message
:
case
message_type
:
:
down_message
:
case
message_type
:
:
heartbeat
:
out
=
result
;
return
true
;
};
}
}
// namespace basp
}
// namespace net
}
// namespace caf
CAF_POP_WARNINGS
libcaf_net/src/net/basp/operation_strings.cpp
deleted
100644 → 0
View file @
c18a1e1a
// clang-format off
// DO NOT EDIT: this file is auto-generated by caf-generate-enum-strings.
// Run the target update-enum-strings if this file is out of sync.
#include "caf/net/operation.hpp"
#include <string>
namespace
caf
{
namespace
net
{
std
::
string
to_string
(
operation
x
)
{
switch
(
x
)
{
default:
return
"???"
;
case
operation
:
:
none
:
return
"none"
;
case
operation
:
:
read
:
return
"read"
;
case
operation
:
:
write
:
return
"write"
;
case
operation
:
:
read_write
:
return
"read_write"
;
case
operation
:
:
shutdown
:
return
"shutdown"
;
};
}
}
// namespace net
}
// namespace caf
libcaf_net/src/net/operation_strings.cpp
deleted
100644 → 0
View file @
c18a1e1a
// clang-format off
// DO NOT EDIT: this file is auto-generated by caf-generate-enum-strings.
// Run the target update-enum-strings if this file is out of sync.
#include "caf/config.hpp"
#include "caf/string_view.hpp"
CAF_PUSH_DEPRECATED_WARNING
#include "caf/net/operation.hpp"
#include <string>
namespace
caf
{
namespace
net
{
std
::
string
to_string
(
operation
x
)
{
switch
(
x
)
{
default:
return
"???"
;
case
operation
:
:
none
:
return
"none"
;
case
operation
:
:
read
:
return
"read"
;
case
operation
:
:
write
:
return
"write"
;
case
operation
:
:
read_write
:
return
"read_write"
;
case
operation
:
:
shutdown
:
return
"shutdown"
;
};
}
bool
from_string
(
string_view
in
,
operation
&
out
)
{
if
(
in
==
"none"
)
{
out
=
operation
::
none
;
return
true
;
}
else
if
(
in
==
"read"
)
{
out
=
operation
::
read
;
return
true
;
}
else
if
(
in
==
"write"
)
{
out
=
operation
::
write
;
return
true
;
}
else
if
(
in
==
"read_write"
)
{
out
=
operation
::
read_write
;
return
true
;
}
else
if
(
in
==
"shutdown"
)
{
out
=
operation
::
shutdown
;
return
true
;
}
else
{
return
false
;
}
}
bool
from_integer
(
std
::
underlying_type_t
<
operation
>
in
,
operation
&
out
)
{
auto
result
=
static_cast
<
operation
>
(
in
);
switch
(
result
)
{
default:
return
false
;
case
operation
:
:
none
:
case
operation
:
:
read
:
case
operation
:
:
write
:
case
operation
:
:
read_write
:
case
operation
:
:
shutdown
:
out
=
result
;
return
true
;
};
}
}
// namespace net
}
// namespace caf
CAF_POP_WARNINGS
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