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
42f02824
Commit
42f02824
authored
Jun 27, 2022
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove dead code
parent
161e554b
Changes
40
Hide whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
28 additions
and
1274 deletions
+28
-1274
libcaf_core/CMakeLists.txt
libcaf_core/CMakeLists.txt
+0
-3
libcaf_core/caf/actor_system_config.hpp
libcaf_core/caf/actor_system_config.hpp
+0
-1
libcaf_core/caf/config_value.hpp
libcaf_core/caf/config_value.hpp
+0
-1
libcaf_core/caf/decorator/splitter.hpp
libcaf_core/caf/decorator/splitter.hpp
+0
-42
libcaf_core/caf/detail/assign_inspector_try_result.hpp
libcaf_core/caf/detail/assign_inspector_try_result.hpp
+0
-30
libcaf_core/caf/detail/behavior_impl.hpp
libcaf_core/caf/detail/behavior_impl.hpp
+0
-1
libcaf_core/caf/detail/delegate_serialize.hpp
libcaf_core/caf/detail/delegate_serialize.hpp
+0
-48
libcaf_core/caf/detail/enqueue_result.hpp
libcaf_core/caf/detail/enqueue_result.hpp
+0
-14
libcaf_core/caf/detail/gcd.hpp
libcaf_core/caf/detail/gcd.hpp
+0
-20
libcaf_core/caf/detail/limited_vector.hpp
libcaf_core/caf/detail/limited_vector.hpp
+0
-232
libcaf_core/caf/detail/make_unique.hpp
libcaf_core/caf/detail/make_unique.hpp
+0
-16
libcaf_core/caf/detail/move_if_not_ptr.hpp
libcaf_core/caf/detail/move_if_not_ptr.hpp
+0
-27
libcaf_core/caf/detail/optional_message_visitor.hpp
libcaf_core/caf/detail/optional_message_visitor.hpp
+0
-112
libcaf_core/caf/detail/path_state.hpp
libcaf_core/caf/detail/path_state.hpp
+0
-58
libcaf_core/caf/detail/pp.hpp
libcaf_core/caf/detail/pp.hpp
+3
-0
libcaf_core/caf/detail/pseudo_tuple.hpp
libcaf_core/caf/detail/pseudo_tuple.hpp
+0
-106
libcaf_core/caf/detail/raw_access.hpp
libcaf_core/caf/detail/raw_access.hpp
+0
-55
libcaf_core/caf/detail/safe_equal.hpp
libcaf_core/caf/detail/safe_equal.hpp
+0
-41
libcaf_core/caf/detail/select_integer_type.hpp
libcaf_core/caf/detail/select_integer_type.hpp
+0
-58
libcaf_core/caf/detail/serialized_size.hpp
libcaf_core/caf/detail/serialized_size.hpp
+0
-100
libcaf_core/caf/detail/tail_argument_token.hpp
libcaf_core/caf/detail/tail_argument_token.hpp
+0
-11
libcaf_core/caf/detail/try_serialize.hpp
libcaf_core/caf/detail/try_serialize.hpp
+0
-19
libcaf_core/caf/detail/type_list.hpp
libcaf_core/caf/detail/type_list.hpp
+0
-113
libcaf_core/caf/detail/type_pair.hpp
libcaf_core/caf/detail/type_pair.hpp
+0
-30
libcaf_core/caf/expected.hpp
libcaf_core/caf/expected.hpp
+0
-1
libcaf_core/caf/intrusive/fifo_inbox.hpp
libcaf_core/caf/intrusive/fifo_inbox.hpp
+2
-4
libcaf_core/caf/is_message_sink.hpp
libcaf_core/caf/is_message_sink.hpp
+0
-25
libcaf_core/caf/logger.hpp
libcaf_core/caf/logger.hpp
+15
-12
libcaf_core/caf/send.hpp
libcaf_core/caf/send.hpp
+0
-1
libcaf_core/caf/settings.hpp
libcaf_core/caf/settings.hpp
+4
-2
libcaf_core/caf/tag/boxing_type.hpp
libcaf_core/caf/tag/boxing_type.hpp
+0
-12
libcaf_core/caf/typed_behavior.hpp
libcaf_core/caf/typed_behavior.hpp
+2
-2
libcaf_core/caf/unifyn.hpp
libcaf_core/caf/unifyn.hpp
+0
-10
libcaf_core/src/actor_system_config.cpp
libcaf_core/src/actor_system_config.cpp
+0
-1
libcaf_core/test/config_option_set.cpp
libcaf_core/test/config_option_set.cpp
+0
-1
libcaf_core/test/detail/limited_vector.cpp
libcaf_core/test/detail/limited_vector.cpp
+0
-61
libcaf_core/test/serialization.cpp
libcaf_core/test/serialization.cpp
+0
-1
libcaf_io/src/io/middleman.cpp
libcaf_io/src/io/middleman.cpp
+0
-1
libcaf_test/caf/test/bdd_dsl.hpp
libcaf_test/caf/test/bdd_dsl.hpp
+2
-1
libcaf_test/caf/test/dsl.hpp
libcaf_test/caf/test/dsl.hpp
+0
-1
No files found.
libcaf_core/CMakeLists.txt
View file @
42f02824
...
@@ -131,7 +131,6 @@ caf_add_component(
...
@@ -131,7 +131,6 @@ caf_add_component(
src/detail/private_thread.cpp
src/detail/private_thread.cpp
src/detail/private_thread_pool.cpp
src/detail/private_thread_pool.cpp
src/detail/ripemd_160.cpp
src/detail/ripemd_160.cpp
src/detail/serialized_size.cpp
src/detail/set_thread_name.cpp
src/detail/set_thread_name.cpp
src/detail/shared_spinlock.cpp
src/detail/shared_spinlock.cpp
src/detail/stringification_inspector.cpp
src/detail/stringification_inspector.cpp
...
@@ -254,7 +253,6 @@ caf_add_component(
...
@@ -254,7 +253,6 @@ caf_add_component(
detail.ieee_754
detail.ieee_754
detail.json
detail.json
detail.latch
detail.latch
detail.limited_vector
detail.local_group_module
detail.local_group_module
detail.meta_object
detail.meta_object
detail.monotonic_buffer_resource
detail.monotonic_buffer_resource
...
@@ -271,7 +269,6 @@ caf_add_component(
...
@@ -271,7 +269,6 @@ caf_add_component(
detail.private_thread_pool
detail.private_thread_pool
detail.ringbuffer
detail.ringbuffer
detail.ripemd_160
detail.ripemd_160
detail.serialized_size
detail.type_id_list_builder
detail.type_id_list_builder
detail.unique_function
detail.unique_function
dictionary
dictionary
...
...
libcaf_core/caf/actor_system_config.hpp
View file @
42f02824
...
@@ -20,7 +20,6 @@
...
@@ -20,7 +20,6 @@
#include "caf/config_option_set.hpp"
#include "caf/config_option_set.hpp"
#include "caf/config_value.hpp"
#include "caf/config_value.hpp"
#include "caf/detail/core_export.hpp"
#include "caf/detail/core_export.hpp"
#include "caf/detail/safe_equal.hpp"
#include "caf/detail/type_traits.hpp"
#include "caf/detail/type_traits.hpp"
#include "caf/dictionary.hpp"
#include "caf/dictionary.hpp"
#include "caf/fwd.hpp"
#include "caf/fwd.hpp"
...
...
libcaf_core/caf/config_value.hpp
View file @
42f02824
...
@@ -23,7 +23,6 @@
...
@@ -23,7 +23,6 @@
#include "caf/config_value_writer.hpp"
#include "caf/config_value_writer.hpp"
#include "caf/detail/bounds_checker.hpp"
#include "caf/detail/bounds_checker.hpp"
#include "caf/detail/core_export.hpp"
#include "caf/detail/core_export.hpp"
#include "caf/detail/move_if_not_ptr.hpp"
#include "caf/detail/parse.hpp"
#include "caf/detail/parse.hpp"
#include "caf/detail/type_traits.hpp"
#include "caf/detail/type_traits.hpp"
#include "caf/dictionary.hpp"
#include "caf/dictionary.hpp"
...
...
libcaf_core/caf/decorator/splitter.hpp
deleted
100644 → 0
View file @
161e554b
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
#include <vector>
#include "caf/actor_addr.hpp"
#include "caf/detail/core_export.hpp"
#include "caf/mailbox_element.hpp"
#include "caf/monitorable_actor.hpp"
namespace
caf
::
decorator
{
/// An actor decorator implementing "dot operator"-like compositions,
/// i.e., `f.g(x) = f(g(x))`. Composed actors are hidden actors.
/// A composed actor exits when either of its constituent actors exits;
/// Constituent actors have no dependency on the composed actor
/// by default, and exit of a composed actor has no effect on its
/// constituent actors. A composed actor is hosted on the same actor
/// system and node as `g`, the first actor on the forwarding chain.
class
CAF_CORE_EXPORT
splitter
:
public
monitorable_actor
{
public:
using
message_types_set
=
std
::
set
<
std
::
string
>
;
splitter
(
std
::
vector
<
strong_actor_ptr
>
workers
,
message_types_set
msg_types
);
// non-system messages are processed and then forwarded;
// system messages are handled and consumed on the spot;
// in either case, the processing is done synchronously
bool
enqueue
(
mailbox_element_ptr
what
,
execution_unit
*
context
)
override
;
message_types_set
message_types
()
const
override
;
private:
const
size_t
num_workers
;
std
::
vector
<
strong_actor_ptr
>
workers_
;
message_types_set
msg_types_
;
};
}
// namespace caf::decorator
libcaf_core/caf/detail/assign_inspector_try_result.hpp
deleted
100644 → 0
View file @
161e554b
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
#include "caf/error.hpp"
#include "caf/error_code.hpp"
#include "caf/sec.hpp"
#include "caf/type_id.hpp"
namespace
caf
::
detail
{
template
<
class
T
>
void
assign_inspector_try_result
(
error
&
x
,
T
&&
y
)
{
x
=
std
::
forward
<
T
>
(
y
);
}
inline
void
assign_inspector_try_result
(
error_code
<
sec
>&
x
,
const
error
&
y
)
{
if
(
y
.
category
()
==
type_id_v
<
sec
>
)
x
=
static_cast
<
sec
>
(
y
.
code
());
else
x
=
sec
::
runtime_error
;
}
inline
void
assign_inspector_try_result
(
error_code
<
sec
>&
x
,
error_code
<
sec
>
y
)
{
x
=
y
;
}
}
// namespace caf::detail
libcaf_core/caf/detail/behavior_impl.hpp
View file @
42f02824
...
@@ -14,7 +14,6 @@
...
@@ -14,7 +14,6 @@
#include "caf/detail/core_export.hpp"
#include "caf/detail/core_export.hpp"
#include "caf/detail/int_list.hpp"
#include "caf/detail/int_list.hpp"
#include "caf/detail/invoke_result_visitor.hpp"
#include "caf/detail/invoke_result_visitor.hpp"
#include "caf/detail/tail_argument_token.hpp"
#include "caf/detail/type_traits.hpp"
#include "caf/detail/type_traits.hpp"
#include "caf/intrusive_ptr.hpp"
#include "caf/intrusive_ptr.hpp"
#include "caf/make_counted.hpp"
#include "caf/make_counted.hpp"
...
...
libcaf_core/caf/detail/delegate_serialize.hpp
deleted
100644 → 0
View file @
161e554b
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
// The rationale of this header is to provide a serialization API
// that is compatible to boost.serialization. In particular, the
// design goals are:
// - allow users to integrate existing boost.serialization-based code easily
// - allow to switch out this header with the actual boost header in boost.actor
//
// Differences in semantics are:
// - CAF does *not* respect class versions
// - the `unsigned int` argument is always 0 and ignored by CAF
//
// Since CAF requires all runtime instances to have the same types
// announced, different class versions in a single actor system would
// cause inconsistencies that are not recoverable.
#pragma once
#include <type_traits>
#include <utility>
#include "caf/detail/type_traits.hpp"
namespace
boost
::
serialization
{}
// namespace boost::serialization
namespace
caf
::
detail
{
// Calls `serialize(...)` with `using namespace boost::serialization`
// to enable both ADL and picking up existing boost code.
template
<
class
Processor
,
class
U
>
auto
delegate_serialize
(
Processor
&
proc
,
U
&
x
,
const
unsigned
int
y
=
0
)
->
decltype
(
serialize
(
proc
,
x
,
y
))
{
using
namespace
boost
::
serialization
;
serialize
(
proc
,
x
,
y
);
}
// Calls `serialize(...)` without the unused version argument, which CAF
// ignores anyway.
template
<
class
Processor
,
class
U
>
auto
delegate_serialize
(
Processor
&
proc
,
U
&
x
)
->
decltype
(
serialize
(
proc
,
x
))
{
serialize
(
proc
,
x
);
}
}
// namespace caf::detail
libcaf_core/caf/detail/enqueue_result.hpp
deleted
100644 → 0
View file @
161e554b
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
#include "caf/intrusive/inbox_result.hpp"
namespace
caf
::
detail
{
/// Alias for backwards compatibility.
using
enqueue_result
=
intrusive
::
inbox_result
;
}
// namespace caf::detail
libcaf_core/caf/detail/gcd.hpp
deleted
100644 → 0
View file @
161e554b
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
namespace
caf
::
detail
{
template
<
class
T
>
T
gcd
(
T
a
,
T
b
)
{
T
r
;
while
(
b
!=
0
)
{
r
=
a
%
b
;
a
=
b
;
b
=
r
;
}
return
a
;
}
}
// namespace caf::detail
libcaf_core/caf/detail/limited_vector.hpp
deleted
100644 → 0
View file @
161e554b
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
#include <algorithm>
#include <cstddef>
#include <initializer_list>
#include <iterator>
#include <type_traits>
#include "caf/config.hpp"
#include "caf/raise_error.hpp"
namespace
caf
::
detail
{
// A vector with a fixed maximum size (uses an array internally).
// @warning This implementation is highly optimized for arithmetic types and
template
<
class
T
,
size_t
MaxSize
>
class
limited_vector
{
public:
using
value_type
=
T
;
using
size_type
=
size_t
;
using
difference_type
=
ptrdiff_t
;
using
reference
=
value_type
&
;
using
const_reference
=
const
value_type
&
;
using
pointer
=
value_type
*
;
using
const_pointer
=
const
value_type
*
;
using
iterator
=
pointer
;
using
const_iterator
=
const_pointer
;
using
reverse_iterator
=
std
::
reverse_iterator
<
iterator
>
;
using
const_reverse_iterator
=
std
::
reverse_iterator
<
const_iterator
>
;
limited_vector
()
:
size_
(
0
)
{
// nop
}
explicit
limited_vector
(
size_t
initial_size
)
:
size_
(
initial_size
)
{
auto
tmp
=
T
{};
std
::
fill_n
(
begin
(),
initial_size
,
tmp
);
}
limited_vector
(
const
limited_vector
&
other
)
:
size_
(
other
.
size_
)
{
std
::
copy
(
other
.
begin
(),
other
.
end
(),
begin
());
}
limited_vector
&
operator
=
(
const
limited_vector
&
other
)
{
resize
(
other
.
size
());
std
::
copy
(
other
.
begin
(),
other
.
end
(),
begin
());
return
*
this
;
}
void
resize
(
size_type
s
)
{
CAF_ASSERT
(
s
<=
MaxSize
);
size_
=
s
;
}
explicit
limited_vector
(
std
::
initializer_list
<
T
>
init
)
:
size_
(
init
.
size
())
{
CAF_ASSERT
(
init
.
size
()
<=
MaxSize
);
std
::
copy
(
init
.
begin
(),
init
.
end
(),
begin
());
}
void
assign
(
size_type
count
,
const_reference
value
)
{
resize
(
count
);
std
::
fill
(
begin
(),
end
(),
value
);
}
template
<
class
InputIterator
>
void
assign
(
InputIterator
first
,
InputIterator
last
,
// dummy SFINAE argument
typename
std
::
iterator_traits
<
InputIterator
>::
pointer
=
nullptr
)
{
auto
dist
=
std
::
distance
(
first
,
last
);
CAF_ASSERT
(
dist
>=
0
);
resize
(
static_cast
<
size_t
>
(
dist
));
std
::
copy
(
first
,
last
,
begin
());
}
size_type
size
()
const
{
return
size_
;
}
size_type
max_size
()
const
{
return
MaxSize
;
}
size_type
capacity
()
const
{
return
max_size
()
-
size
();
}
void
clear
()
{
size_
=
0
;
}
bool
empty
()
const
{
return
size_
==
0
;
}
bool
full
()
const
{
return
size_
==
MaxSize
;
}
void
push_back
(
const_reference
what
)
{
CAF_ASSERT
(
!
full
());
data_
[
size_
++
]
=
what
;
}
void
pop_back
()
{
CAF_ASSERT
(
!
empty
());
--
size_
;
}
reference
at
(
size_type
pos
)
{
CAF_ASSERT
(
pos
<
size_
);
return
data_
[
pos
];
}
const_reference
at
(
size_type
pos
)
const
{
CAF_ASSERT
(
pos
<
size_
);
return
data_
[
pos
];
}
reference
operator
[](
size_type
pos
)
{
return
at
(
pos
);
}
const_reference
operator
[](
size_type
pos
)
const
{
return
at
(
pos
);
}
iterator
begin
()
{
return
data_
;
}
const_iterator
begin
()
const
{
return
data_
;
}
const_iterator
cbegin
()
const
{
return
begin
();
}
iterator
end
()
{
return
begin
()
+
size_
;
}
const_iterator
end
()
const
{
return
begin
()
+
size_
;
}
const_iterator
cend
()
const
{
return
end
();
}
reverse_iterator
rbegin
()
{
return
reverse_iterator
(
end
());
}
const_reverse_iterator
rbegin
()
const
{
return
reverse_iterator
(
end
());
}
const_reverse_iterator
crbegin
()
const
{
return
rbegin
();
}
reverse_iterator
rend
()
{
return
reverse_iterator
(
begin
());
}
const_reverse_iterator
rend
()
const
{
return
reverse_iterator
(
begin
());
}
const_reverse_iterator
crend
()
const
{
return
rend
();
}
reference
front
()
{
CAF_ASSERT
(
!
empty
());
return
data_
[
0
];
}
const_reference
front
()
const
{
CAF_ASSERT
(
!
empty
());
return
data_
[
0
];
}
reference
back
()
{
CAF_ASSERT
(
!
empty
());
return
data_
[
size_
-
1
];
}
const_reference
back
()
const
{
CAF_ASSERT
(
!
empty
());
return
data_
[
size_
-
1
];
}
T
*
data
()
{
return
data_
;
}
const
T
*
data
()
const
{
return
data_
;
}
template
<
class
InputIterator
>
void
insert
(
iterator
pos
,
InputIterator
first
,
InputIterator
last
)
{
CAF_ASSERT
(
first
<=
last
);
auto
num_elements
=
static_cast
<
size_t
>
(
std
::
distance
(
first
,
last
));
if
((
size
()
+
num_elements
)
>
MaxSize
)
{
CAF_RAISE_ERROR
(
"limited_vector::insert: too much elements"
);
}
if
(
pos
==
end
())
{
resize
(
size
()
+
num_elements
);
std
::
copy
(
first
,
last
,
pos
);
}
else
{
// move elements
auto
old_end
=
end
();
resize
(
size
()
+
num_elements
);
std
::
copy_backward
(
pos
,
old_end
,
end
());
// insert new elements
std
::
copy
(
first
,
last
,
pos
);
}
}
private:
size_t
size_
;
T
data_
[(
MaxSize
>
0
)
?
MaxSize
:
1
];
};
}
// namespace caf::detail
libcaf_core/caf/detail/make_unique.hpp
deleted
100644 → 0
View file @
161e554b
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
#include <memory>
namespace
caf
::
detail
{
template
<
class
T
,
class
...
Ts
>
std
::
unique_ptr
<
T
>
make_unique
(
Ts
&&
...
xs
)
{
return
std
::
unique_ptr
<
T
>
{
new
T
(
std
::
forward
<
Ts
>
(
xs
)...)};
}
}
// namespace caf::detail
libcaf_core/caf/detail/move_if_not_ptr.hpp
deleted
100644 → 0
View file @
161e554b
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
#include <type_traits>
#include "caf/detail/type_traits.hpp"
namespace
caf
::
detail
{
/// Moves the value from `x` if it is not a pointer (e.g., `optional` or
/// `expected`), returns `*x` otherwise.
template
<
class
T
>
T
&
move_if_not_ptr
(
T
*
x
)
{
return
*
x
;
}
/// Moves the value from `x` if it is not a pointer (e.g., `optional` or
/// `expected`), returns `*x` otherwise.
template
<
class
T
,
class
E
=
enable_if_t
<!
std
::
is_pointer
<
T
>
::
value
>>
auto
move_if_not_ptr
(
T
&
x
)
->
decltype
(
std
::
move
(
*
x
))
{
return
std
::
move
(
*
x
);
}
}
// namespace caf::detail
libcaf_core/caf/detail/optional_message_visitor.hpp
deleted
100644 → 0
View file @
161e554b
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
#include "caf/delegated.hpp"
#include "caf/detail/core_export.hpp"
#include "caf/detail/type_traits.hpp"
#include "caf/none.hpp"
#include "caf/response_promise.hpp"
#include "caf/skip.hpp"
#include "caf/static_visitor.hpp"
#include "caf/typed_response_promise.hpp"
#include "caf/unit.hpp"
namespace
caf
::
detail
{
template
<
class
T
>
struct
is_message_id_wrapper
{
template
<
class
U
>
static
char
(
&
test
(
typename
U
::
message_id_wrapper_tag
))[
1
];
template
<
class
U
>
static
char
(
&
test
(...))[
2
];
static
constexpr
bool
value
=
sizeof
(
test
<
T
>
(
0
))
==
1
;
};
template
<
class
T
>
struct
is_response_promise
:
std
::
false_type
{};
template
<
>
struct
is_response_promise
<
response_promise
>
:
std
::
true_type
{};
template
<
class
...
Ts
>
struct
is_response_promise
<
typed_response_promise
<
Ts
...
>>
:
std
::
true_type
{};
template
<
class
...
Ts
>
struct
is_response_promise
<
delegated
<
Ts
...
>>
:
std
::
true_type
{};
template
<
class
T
>
struct
optional_message_visitor_enable_tpl
{
static
constexpr
bool
value
=
!
is_one_of
<
typename
std
::
remove_const
<
T
>::
type
,
none_t
,
unit_t
,
skip_t
,
std
::
optional
<
skip_t
>>::
value
&&
!
is_message_id_wrapper
<
T
>::
value
&&
!
is_response_promise
<
T
>::
value
;
};
class
CAF_CORE_EXPORT
optional_message_visitor
:
public
static_visitor
<
std
::
optional
<
message
>>
{
public:
optional_message_visitor
()
=
default
;
using
opt_msg
=
std
::
optional
<
message
>
;
opt_msg
operator
()(
const
none_t
&
)
const
{
return
none
;
}
opt_msg
operator
()(
const
skip_t
&
)
const
{
return
none
;
}
opt_msg
operator
()(
const
unit_t
&
)
const
{
return
message
{};
}
opt_msg
operator
()(
std
::
optional
<
skip_t
>&
val
)
const
{
if
(
val
)
return
none
;
return
message
{};
}
opt_msg
operator
()(
opt_msg
&
msg
)
{
return
msg
;
}
template
<
class
T
>
typename
std
::
enable_if
<
is_response_promise
<
T
>::
value
,
opt_msg
>::
type
operator
()(
const
T
&
)
const
{
return
message
{};
}
template
<
class
T
,
class
...
Ts
>
typename
std
::
enable_if
<
optional_message_visitor_enable_tpl
<
T
>::
value
,
opt_msg
>::
type
operator
()(
T
&
x
,
Ts
&
...
xs
)
const
{
return
make_message
(
std
::
move
(
x
),
std
::
move
(
xs
)...);
}
template
<
class
T
>
typename
std
::
enable_if
<
is_message_id_wrapper
<
T
>::
value
,
opt_msg
>::
type
operator
()(
T
&
value
)
const
{
return
make_message
(
atom
(
"MESSAGE_ID"
),
value
.
get_message_id
().
integer_value
());
}
template
<
class
...
Ts
>
opt_msg
operator
()(
std
::
tuple
<
Ts
...
>&
value
)
const
{
return
apply_args
(
*
this
,
get_indices
(
value
),
value
);
}
template
<
class
T
>
opt_msg
operator
()(
std
::
optional
<
T
>&
value
)
const
{
if
(
value
)
return
(
*
this
)(
*
value
);
if
(
value
.
empty
())
return
message
{};
return
value
.
error
();
}
};
}
// namespace caf::detail
libcaf_core/caf/detail/path_state.hpp
deleted
100644 → 0
View file @
161e554b
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
#include <new>
#include <vector>
#include "caf/unit.hpp"
namespace
caf
::
detail
{
/// Bundles a filter and a buffer.
template
<
class
Filter
,
class
T
>
struct
path_state
{
Filter
filter
;
std
::
vector
<
T
>
buf
;
};
/// Compress path_state if `Filter` is `unit`.
template
<
class
T
>
struct
path_state
<
unit_t
,
T
>
{
using
buffer_type
=
std
::
vector
<
T
>
;
union
{
unit_t
filter
;
buffer_type
buf
;
};
path_state
()
{
new
(
&
buf
)
buffer_type
();
}
path_state
(
path_state
&&
other
)
{
new
(
&
buf
)
buffer_type
(
std
::
move
(
other
.
buf
));
}
path_state
(
const
path_state
&
other
)
{
new
(
&
buf
)
buffer_type
(
other
.
buf
);
}
path_state
&
operator
=
(
path_state
&&
other
)
{
buf
=
std
::
move
(
other
.
buf
);
return
*
this
;
}
path_state
&
operator
=
(
const
path_state
&
other
)
{
buf
=
other
.
buf
;
return
*
this
;
}
~
path_state
()
{
buf
.
~
buffer_type
();
}
};
}
// namespace caf::detail
libcaf_core/caf/detail/pp.hpp
View file @
42f02824
...
@@ -15,6 +15,9 @@
...
@@ -15,6 +15,9 @@
/// Evaluate x and y before concatenating into a single token.
/// Evaluate x and y before concatenating into a single token.
#define CAF_PP_PASTE(x, y) CAF_PP_CAT(x, y)
#define CAF_PP_PASTE(x, y) CAF_PP_CAT(x, y)
/// Adds the current line number to make `NAME` unique.
#define CAF_PP_UNIFYN(name) CAF_PP_PASTE(name, __LINE__)
/// Evaluates to __COUNTER__. Allows delaying evaluation of __COUNTER__ in some
/// Evaluates to __COUNTER__. Allows delaying evaluation of __COUNTER__ in some
/// edge cases where it otherwise could increment the internal counter twice.
/// edge cases where it otherwise could increment the internal counter twice.
#define CAF_PP_COUNTER() __COUNTER__
#define CAF_PP_COUNTER() __COUNTER__
...
...
libcaf_core/caf/detail/pseudo_tuple.hpp
deleted
100644 → 0
View file @
161e554b
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
#include <cstddef>
#include "caf/config.hpp"
#include "caf/param.hpp"
#include "caf/detail/type_traits.hpp"
namespace
caf
::
detail
{
// tuple-like access to an array of void pointers that is
// also aware of the semantics of param<T>
template
<
class
...
Ts
>
struct
pseudo_tuple
{
using
pointer
=
void
*
;
using
const_pointer
=
const
void
*
;
pointer
data
[
sizeof
...(
Ts
)
>
0
?
sizeof
...(
Ts
)
:
1
];
bool
shared_access
;
template
<
class
Tuple
>
pseudo_tuple
(
const
Tuple
&
xs
)
:
data
(),
shared_access
(
xs
.
shared
())
{
CAF_ASSERT
(
sizeof
...(
Ts
)
==
xs
.
size
());
for
(
size_t
i
=
0
;
i
<
xs
.
size
();
++
i
)
data
[
i
]
=
const_cast
<
void
*>
(
xs
.
get
(
i
));
}
const_pointer
at
(
size_t
p
)
const
{
return
data
[
p
];
}
pointer
get_mutable
(
size_t
p
)
{
return
data
[
p
];
}
pointer
&
operator
[](
size_t
p
)
{
return
data
[
p
];
}
};
template
<
class
T
>
struct
pseudo_tuple_access
{
using
result_type
=
T
&
;
template
<
class
Tuple
>
static
T
&
get
(
Tuple
&
xs
,
size_t
pos
)
{
auto
vp
=
xs
.
get_mutable
(
pos
);
CAF_ASSERT
(
vp
!=
nullptr
);
return
*
reinterpret_cast
<
T
*>
(
vp
);
}
};
template
<
class
T
>
struct
pseudo_tuple_access
<
const
T
>
{
using
result_type
=
const
T
&
;
template
<
class
Tuple
>
static
const
T
&
get
(
const
Tuple
&
xs
,
size_t
pos
)
{
auto
vp
=
xs
.
at
(
pos
);
CAF_ASSERT
(
vp
!=
nullptr
);
return
*
reinterpret_cast
<
const
T
*>
(
vp
);
}
};
template
<
class
T
>
struct
pseudo_tuple_access
<
param
<
T
>>
{
using
result_type
=
param
<
T
>
;
template
<
class
Tuple
>
static
result_type
get
(
const
Tuple
&
xs
,
size_t
pos
)
{
auto
vp
=
xs
.
at
(
pos
);
CAF_ASSERT
(
vp
!=
nullptr
);
return
{
vp
,
xs
.
shared_access
};
}
};
template
<
class
T
>
struct
pseudo_tuple_access
<
const
param
<
T
>>
:
pseudo_tuple_access
<
param
<
T
>>
{
// nop
};
template
<
size_t
N
,
class
...
Ts
>
typename
pseudo_tuple_access
<
const
typename
detail
::
type_at
<
N
,
Ts
...
>::
type
>::
result_type
get
(
const
detail
::
pseudo_tuple
<
Ts
...
>&
tv
)
{
static_assert
(
N
<
sizeof
...(
Ts
),
"N >= tv.size()"
);
using
f
=
pseudo_tuple_access
<
const
typename
detail
::
type_at
<
N
,
Ts
...
>::
type
>
;
return
f
::
get
(
tv
,
N
);
}
template
<
size_t
N
,
class
...
Ts
>
typename
pseudo_tuple_access
<
typename
detail
::
type_at
<
N
,
Ts
...
>::
type
>::
result_type
get
(
detail
::
pseudo_tuple
<
Ts
...
>&
tv
)
{
static_assert
(
N
<
sizeof
...(
Ts
),
"N >= tv.size()"
);
using
f
=
pseudo_tuple_access
<
typename
detail
::
type_at
<
N
,
Ts
...
>::
type
>
;
return
f
::
get
(
tv
,
N
);
}
}
// namespace caf::detail
libcaf_core/caf/detail/raw_access.hpp
deleted
100644 → 0
View file @
161e554b
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
#include "caf/abstract_actor.hpp"
#include "caf/abstract_channel.hpp"
#include "caf/abstract_group.hpp"
#include "caf/actor.hpp"
#include "caf/actor_addr.hpp"
#include "caf/channel.hpp"
#include "caf/group.hpp"
namespace
caf
::
detail
{
class
raw_access
{
public:
template
<
class
ActorHandle
>
static
abstract_actor
*
get
(
const
ActorHandle
&
hdl
)
{
return
hdl
.
ptr_
.
get
();
}
static
abstract_channel
*
get
(
const
channel
&
hdl
)
{
return
hdl
.
ptr_
.
get
();
}
static
abstract_group
*
get
(
const
group
&
hdl
)
{
return
hdl
.
ptr_
.
get
();
}
static
actor
unsafe_cast
(
abstract_actor
*
ptr
)
{
return
{
ptr
};
}
static
actor
unsafe_cast
(
const
actor_addr
&
hdl
)
{
return
{
get
(
hdl
)};
}
static
actor
unsafe_cast
(
const
abstract_actor_ptr
&
ptr
)
{
return
{
ptr
.
get
()};
}
template
<
class
T
>
static
void
unsafe_assign
(
T
&
lhs
,
const
actor
&
rhs
)
{
lhs
=
T
{
get
(
rhs
)};
}
template
<
class
T
>
static
void
unsafe_assign
(
T
&
lhs
,
const
abstract_actor_ptr
&
ptr
)
{
lhs
=
T
{
ptr
.
get
()};
}
};
}
// namespace caf::detail
libcaf_core/caf/detail/safe_equal.hpp
deleted
100644 → 0
View file @
161e554b
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
#include <cmath> // fabs
#include <limits>
#include <type_traits>
namespace
caf
::
detail
{
/// Compares two values by using `operator==` unless two floating
/// point numbers are compared. In the latter case, the function
/// performs an epsilon comparison.
template
<
class
T
,
typename
U
>
typename
std
::
enable_if
<
!
std
::
is_floating_point
<
T
>::
value
&&
!
std
::
is_floating_point
<
U
>::
value
&&
!
(
std
::
is_same
<
T
,
U
>::
value
&&
std
::
is_empty
<
T
>::
value
),
bool
>::
type
safe_equal
(
const
T
&
lhs
,
const
U
&
rhs
)
{
return
lhs
==
rhs
;
}
template
<
class
T
,
typename
U
>
typename
std
::
enable_if
<
std
::
is_same
<
T
,
U
>::
value
&&
std
::
is_empty
<
T
>::
value
,
bool
>::
type
safe_equal
(
const
T
&
,
const
U
&
)
{
return
true
;
}
template
<
class
T
,
typename
U
>
typename
std
::
enable_if
<
std
::
is_floating_point
<
T
>::
value
||
std
::
is_floating_point
<
U
>::
value
,
bool
>::
type
safe_equal
(
const
T
&
lhs
,
const
U
&
rhs
)
{
using
res_type
=
decltype
(
lhs
-
rhs
);
return
std
::
fabs
(
lhs
-
rhs
)
<=
std
::
numeric_limits
<
res_type
>::
epsilon
();
}
}
// namespace caf::detail
libcaf_core/caf/detail/select_integer_type.hpp
deleted
100644 → 0
View file @
161e554b
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
#include <cstdint>
namespace
caf
::
detail
{
template
<
int
,
bool
>
struct
select_integer_type
;
template
<
>
struct
select_integer_type
<
1
,
true
>
{
using
type
=
int8_t
;
};
template
<
>
struct
select_integer_type
<
1
,
false
>
{
using
type
=
uint8_t
;
};
template
<
>
struct
select_integer_type
<
2
,
true
>
{
using
type
=
int16_t
;
};
template
<
>
struct
select_integer_type
<
2
,
false
>
{
using
type
=
uint16_t
;
};
template
<
>
struct
select_integer_type
<
4
,
true
>
{
using
type
=
int32_t
;
};
template
<
>
struct
select_integer_type
<
4
,
false
>
{
using
type
=
uint32_t
;
};
template
<
>
struct
select_integer_type
<
8
,
true
>
{
using
type
=
int64_t
;
};
template
<
>
struct
select_integer_type
<
8
,
false
>
{
using
type
=
uint64_t
;
};
template
<
int
Size
,
bool
IsSigned
>
using
select_integer_type_t
=
typename
select_integer_type
<
Size
,
IsSigned
>::
type
;
}
// namespace caf::detail
libcaf_core/caf/detail/serialized_size.hpp
deleted
100644 → 0
View file @
161e554b
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
#include "caf/detail/core_export.hpp"
#include "caf/error.hpp"
#include "caf/serializer.hpp"
namespace
caf
::
detail
{
class
CAF_CORE_EXPORT
serialized_size_inspector
final
:
public
serializer
{
public:
using
super
=
serializer
;
using
super
::
super
;
size_t
result
=
0
;
bool
begin_object
(
type_id_t
,
std
::
string_view
)
override
;
bool
end_object
()
override
;
bool
begin_field
(
std
::
string_view
)
override
;
bool
begin_field
(
std
::
string_view
,
bool
is_present
)
override
;
bool
begin_field
(
std
::
string_view
,
span
<
const
type_id_t
>
types
,
size_t
index
)
override
;
bool
begin_field
(
std
::
string_view
,
bool
is_present
,
span
<
const
type_id_t
>
types
,
size_t
index
)
override
;
bool
end_field
()
override
;
bool
begin_tuple
(
size_t
size
)
override
;
bool
end_tuple
()
override
;
bool
begin_sequence
(
size_t
size
)
override
;
bool
end_sequence
()
override
;
bool
value
(
std
::
byte
x
)
override
;
bool
value
(
bool
x
)
override
;
bool
value
(
int8_t
x
)
override
;
bool
value
(
uint8_t
x
)
override
;
bool
value
(
int16_t
x
)
override
;
bool
value
(
uint16_t
x
)
override
;
bool
value
(
int32_t
x
)
override
;
bool
value
(
uint32_t
x
)
override
;
bool
value
(
int64_t
x
)
override
;
bool
value
(
uint64_t
x
)
override
;
bool
value
(
float
x
)
override
;
bool
value
(
double
x
)
override
;
bool
value
(
long
double
x
)
override
;
bool
value
(
std
::
string_view
x
)
override
;
bool
value
(
const
std
::
u16string
&
x
)
override
;
bool
value
(
const
std
::
u32string
&
x
)
override
;
bool
value
(
span
<
const
std
::
byte
>
x
)
override
;
using
super
::
list
;
bool
list
(
const
std
::
vector
<
bool
>&
xs
)
override
;
};
template
<
class
T
>
size_t
serialized_size
(
const
T
&
x
)
{
serialized_size_inspector
f
;
auto
unused
=
f
.
apply
(
x
);
static_cast
<
void
>
(
unused
);
// Always true.
return
f
.
result
;
}
template
<
class
T
>
size_t
serialized_size
(
actor_system
&
sys
,
const
T
&
x
)
{
serialized_size_inspector
f
{
sys
};
auto
unused
=
f
.
apply
(
x
);
static_cast
<
void
>
(
unused
);
// Always true.
return
f
.
result
;
}
}
// namespace caf::detail
libcaf_core/caf/detail/tail_argument_token.hpp
deleted
100644 → 0
View file @
161e554b
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
namespace
caf
::
detail
{
struct
tail_argument_token
{};
}
// namespace caf::detail
libcaf_core/caf/detail/try_serialize.hpp
deleted
100644 → 0
View file @
161e554b
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
namespace
caf
::
detail
{
template
<
class
Processor
,
class
T
>
auto
try_serialize
(
Processor
&
proc
,
T
*
x
)
->
decltype
(
proc
&
*
x
)
{
proc
&*
x
;
}
template
<
class
Processor
>
void
try_serialize
(
Processor
&
,
void
*
)
{
// nop
}
}
// namespace caf::detail
libcaf_core/caf/detail/type_list.hpp
View file @
42f02824
...
@@ -8,8 +8,6 @@
...
@@ -8,8 +8,6 @@
#include <type_traits>
#include <type_traits>
#include <typeinfo>
#include <typeinfo>
#include "caf/detail/tbind.hpp"
#include "caf/detail/type_pair.hpp"
#include "caf/fwd.hpp"
#include "caf/fwd.hpp"
#include "caf/none.hpp"
#include "caf/none.hpp"
#include "caf/unit.hpp"
#include "caf/unit.hpp"
...
@@ -133,18 +131,6 @@ struct tl_back<type_list<T0, T1, Ts...>> {
...
@@ -133,18 +131,6 @@ struct tl_back<type_list<T0, T1, Ts...>> {
template
<
class
List
>
template
<
class
List
>
using
tl_back_t
=
typename
tl_back
<
List
>::
type
;
using
tl_back_t
=
typename
tl_back
<
List
>::
type
;
// bool empty(type_list)
/// Tests whether a list is empty.
template
<
class
List
>
struct
tl_empty
{
static
constexpr
bool
value
=
std
::
is_same
<
empty_type_list
,
List
>::
value
;
};
// Uncomment after having switched to C++14
// template <class List>
// inline constexpr bool tl_empty_v = tl_empty<List>::value;
// list slice(size_t, size_t)
// list slice(size_t, size_t)
template
<
size_t
LeftOffset
,
size_t
Remaining
,
typename
PadType
,
class
List
,
template
<
size_t
LeftOffset
,
size_t
Remaining
,
typename
PadType
,
class
List
,
...
@@ -199,98 +185,6 @@ struct tl_slice {
...
@@ -199,98 +185,6 @@ struct tl_slice {
template
<
class
List
,
size_t
First
,
size_t
Last
>
template
<
class
List
,
size_t
First
,
size_t
Last
>
using
tl_slice_t
=
typename
tl_slice
<
List
,
First
,
Last
>::
type
;
using
tl_slice_t
=
typename
tl_slice
<
List
,
First
,
Last
>::
type
;
/// Creates a new list containing the last `N` elements.
template
<
class
List
,
size_t
NewSize
,
size_t
OldSize
=
tl_size
<
List
>
::
value
>
struct
tl_right
{
static
constexpr
size_t
first_idx
=
OldSize
>
NewSize
?
OldSize
-
NewSize
:
0
;
using
type
=
tl_slice_t
<
List
,
first_idx
,
OldSize
>
;
};
template
<
class
List
,
size_t
N
>
struct
tl_right
<
List
,
N
,
N
>
{
using
type
=
List
;
};
template
<
size_t
N
>
struct
tl_right
<
empty_type_list
,
N
,
0
>
{
using
type
=
empty_type_list
;
};
template
<
>
struct
tl_right
<
empty_type_list
,
0
,
0
>
{
using
type
=
empty_type_list
;
};
template
<
class
List
,
size_t
NewSize
,
size_t
OldSize
=
tl_size
<
List
>
::
value
>
using
tl_right_t
=
typename
tl_right
<
List
,
NewSize
,
OldSize
>::
type
;
template
<
class
ListA
,
class
ListB
,
template
<
class
,
typename
>
class
Fun
=
to_type_pair
>
struct
tl_zip_impl
;
template
<
class
...
LhsElements
,
class
...
RhsElements
,
template
<
class
,
typename
>
class
Fun
>
struct
tl_zip_impl
<
type_list
<
LhsElements
...
>
,
type_list
<
RhsElements
...
>
,
Fun
>
{
static_assert
(
sizeof
...(
LhsElements
)
==
sizeof
...(
RhsElements
),
"Lists have different size"
);
using
type
=
type_list
<
typename
Fun
<
LhsElements
,
RhsElements
>::
type
...
>
;
};
/// Zips two lists of equal size.
///
/// Creates a list formed from the two lists `ListA` and `ListB,`
/// e.g., tl_zip<type_list<int, double>, type_list<float, string>>::type
/// is type_list<type_pair<int, float>, type_pair<double, string>>.
template
<
class
ListA
,
class
ListB
,
template
<
class
,
class
>
class
Fun
>
struct
tl_zip
{
static
constexpr
size_t
sizea
=
tl_size
<
ListA
>::
value
;
static
constexpr
size_t
sizeb
=
tl_size
<
ListB
>::
value
;
static
constexpr
size_t
result_size
=
(
sizea
<
sizeb
)
?
sizea
:
sizeb
;
using
type
=
typename
tl_zip_impl
<
tl_slice_t
<
ListA
,
0
,
result_size
>
,
tl_slice_t
<
ListB
,
0
,
result_size
>
,
Fun
>::
type
;
};
template
<
class
ListA
,
class
ListB
,
template
<
class
,
class
>
class
Fun
>
using
tl_zip_t
=
typename
tl_zip
<
ListA
,
ListB
,
Fun
>::
type
;
/// Equal to `zip(right(ListA, N), right(ListB, N), Fun)`.
template
<
class
ListA
,
class
ListB
,
template
<
class
,
class
>
class
Fun
,
size_t
N
>
struct
tl_zip_right
{
using
type
=
typename
tl_zip_impl
<
tl_right_t
<
ListA
,
N
>
,
tl_right_t
<
ListB
,
N
>
,
Fun
>::
type
;
};
template
<
class
ListA
,
class
ListB
,
template
<
class
,
class
>
class
Fun
,
size_t
N
>
using
tl_zip_right_t
=
typename
tl_zip_right
<
ListA
,
ListB
,
Fun
,
N
>::
type
;
template
<
class
ListA
,
class
ListB
,
typename
PadA
=
unit_t
,
typename
PadB
=
unit_t
,
template
<
class
,
typename
>
class
Fun
=
to_type_pair
>
struct
tl_zip_all
{
static
constexpr
size_t
result_size
=
(
tl_size
<
ListA
>::
value
>
tl_size
<
ListB
>::
value
)
?
tl_size
<
ListA
>::
value
:
tl_size
<
ListB
>::
value
;
using
type
=
typename
tl_zip_impl
<
typename
tl_slice_
<
ListA
,
tl_size
<
ListA
>::
value
,
0
,
result_size
>::
type
,
typename
tl_slice_
<
ListB
,
tl_size
<
ListB
>::
value
,
0
,
result_size
>::
type
,
Fun
>::
type
;
};
template
<
class
ListA
,
class
ListB
,
typename
PadA
=
unit_t
,
typename
PadB
=
unit_t
,
template
<
class
,
typename
>
class
Fun
=
to_type_pair
>
using
tl_zip_all_t
=
typename
tl_zip_all
<
ListA
,
ListB
,
PadA
,
PadB
,
Fun
>::
type
;
template
<
class
ListA
>
struct
tl_unzip
;
template
<
class
...
Elements
>
struct
tl_unzip
<
type_list
<
Elements
...
>>
{
using
first
=
type_list
<
typename
Elements
::
first
...
>
;
using
second
=
type_list
<
typename
Elements
::
second
...
>
;
};
// int index_of(list, type)
// int index_of(list, type)
/// Finds the first element of type `What` beginning at index `Pos`.
/// Finds the first element of type `What` beginning at index `Pos`.
...
@@ -900,13 +794,6 @@ struct tl_pad_left {
...
@@ -900,13 +794,6 @@ struct tl_pad_left {
template
<
class
List
,
size_t
NewSize
,
class
FillType
=
unit_t
>
template
<
class
List
,
size_t
NewSize
,
class
FillType
=
unit_t
>
using
tl_pad_left_t
=
typename
tl_pad_left
<
List
,
NewSize
,
FillType
>::
type
;
using
tl_pad_left_t
=
typename
tl_pad_left
<
List
,
NewSize
,
FillType
>::
type
;
// bool is_zipped(list)
template
<
class
List
>
struct
tl_is_zipped
{
static
constexpr
bool
value
=
tl_forall
<
List
,
is_type_pair
>::
value
;
};
// Uncomment after having switched to C++14
// Uncomment after having switched to C++14
// template <class List>
// template <class List>
// inline constexpr bool tl_is_zipped_v = tl_is_zipped<List>::value;
// inline constexpr bool tl_is_zipped_v = tl_is_zipped<List>::value;
...
...
libcaf_core/caf/detail/type_pair.hpp
deleted
100644 → 0
View file @
161e554b
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
namespace
caf
::
detail
{
template
<
class
First
,
typename
Second
>
struct
type_pair
{
using
first
=
First
;
using
second
=
Second
;
};
template
<
class
First
,
typename
Second
>
struct
to_type_pair
{
using
type
=
type_pair
<
First
,
Second
>
;
};
template
<
class
What
>
struct
is_type_pair
{
static
constexpr
bool
value
=
false
;
};
template
<
class
First
,
typename
Second
>
struct
is_type_pair
<
type_pair
<
First
,
Second
>>
{
static
constexpr
bool
value
=
true
;
};
}
// namespace caf::detail
libcaf_core/caf/expected.hpp
View file @
42f02824
...
@@ -14,7 +14,6 @@
...
@@ -14,7 +14,6 @@
#include "caf/deep_to_string.hpp"
#include "caf/deep_to_string.hpp"
#include "caf/error.hpp"
#include "caf/error.hpp"
#include "caf/is_error_code_enum.hpp"
#include "caf/is_error_code_enum.hpp"
#include "caf/unifyn.hpp"
#include "caf/unit.hpp"
#include "caf/unit.hpp"
namespace
caf
{
namespace
caf
{
...
...
libcaf_core/caf/intrusive/fifo_inbox.hpp
View file @
42f02824
...
@@ -20,8 +20,6 @@
...
@@ -20,8 +20,6 @@
#include "caf/intrusive/lifo_inbox.hpp"
#include "caf/intrusive/lifo_inbox.hpp"
#include "caf/intrusive/new_round_result.hpp"
#include "caf/intrusive/new_round_result.hpp"
#include "caf/detail/enqueue_result.hpp"
namespace
caf
::
intrusive
{
namespace
caf
::
intrusive
{
/// A FIFO inbox that combines an efficient thread-safe LIFO inbox with a FIFO
/// A FIFO inbox that combines an efficient thread-safe LIFO inbox with a FIFO
...
@@ -97,8 +95,8 @@ public:
...
@@ -97,8 +95,8 @@ public:
/// @cond PRIVATE
/// @cond PRIVATE
detail
::
enqueue
_result
enqueue
(
pointer
ptr
)
noexcept
{
inbox
_result
enqueue
(
pointer
ptr
)
noexcept
{
return
static_cast
<
detail
::
enqueue
_result
>
(
inbox_
.
push_front
(
ptr
));
return
static_cast
<
inbox
_result
>
(
inbox_
.
push_front
(
ptr
));
}
}
size_t
count
()
noexcept
{
size_t
count
()
noexcept
{
...
...
libcaf_core/caf/is_message_sink.hpp
deleted
100644 → 0
View file @
161e554b
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
#include <type_traits>
#include "caf/fwd.hpp"
namespace
caf
{
template
<
class
T
>
struct
is_message_sink
:
std
::
false_type
{};
template
<
>
struct
is_message_sink
<
actor
>
:
std
::
true_type
{};
template
<
>
struct
is_message_sink
<
group
>
:
std
::
true_type
{};
template
<
class
...
Ts
>
struct
is_message_sink
<
typed_actor
<
Ts
...
>>
:
std
::
true_type
{};
}
// namespace caf
libcaf_core/caf/logger.hpp
View file @
42f02824
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include "caf/detail/arg_wrapper.hpp"
#include "caf/detail/arg_wrapper.hpp"
#include "caf/detail/core_export.hpp"
#include "caf/detail/core_export.hpp"
#include "caf/detail/log_level.hpp"
#include "caf/detail/log_level.hpp"
#include "caf/detail/pp.hpp"
#include "caf/detail/pretty_type_name.hpp"
#include "caf/detail/pretty_type_name.hpp"
#include "caf/detail/ringbuffer.hpp"
#include "caf/detail/ringbuffer.hpp"
#include "caf/detail/scope_guard.hpp"
#include "caf/detail/scope_guard.hpp"
...
@@ -30,7 +31,6 @@
...
@@ -30,7 +31,6 @@
#include "caf/intrusive/singly_linked.hpp"
#include "caf/intrusive/singly_linked.hpp"
#include "caf/ref_counted.hpp"
#include "caf/ref_counted.hpp"
#include "caf/timestamp.hpp"
#include "caf/timestamp.hpp"
#include "caf/unifyn.hpp"
/*
/*
* To enable logging, you have to define CAF_DEBUG. This enables
* To enable logging, you have to define CAF_DEBUG. This enables
...
@@ -420,22 +420,24 @@ CAF_CORE_EXPORT bool operator==(const logger::field& x, const logger::field& y);
...
@@ -420,22 +420,24 @@ CAF_CORE_EXPORT bool operator==(const logger::field& x, const logger::field& y);
#define CAF_LOG_IMPL(component, loglvl, message) \
#define CAF_LOG_IMPL(component, loglvl, message) \
do { \
do { \
auto CAF_
UNIFYN(caf_logger) = caf::logger::current_logger();
\
auto CAF_
PP_UNIFYN(caf_logger) = caf::logger::current_logger();
\
if (CAF_
UNIFYN(caf_logger) != nullptr
\
if (CAF_
PP_UNIFYN(caf_logger) != nullptr
\
&& CAF_
UNIFYN(caf_logger)->accepts(loglvl, component))
\
&& CAF_
PP_UNIFYN(caf_logger)->accepts(loglvl, component))
\
CAF_
UNIFYN(caf_logger)
\
CAF_
PP_UNIFYN(caf_logger)
\
->log(CAF_LOG_MAKE_EVENT(caf::logger::thread_local_aid(), component, \
->log(CAF_LOG_MAKE_EVENT(caf::logger::thread_local_aid(), component, \
loglvl, message)); \
loglvl, message)); \
} while (false)
} while (false)
#define CAF_PUSH_AID(aarg) \
#define CAF_PUSH_AID(aarg) \
caf::actor_id CAF_UNIFYN(caf_aid_tmp) = caf::logger::thread_local_aid(aarg); \
caf::actor_id CAF_PP_UNIFYN(caf_aid_tmp) \
auto CAF_UNIFYN(caf_aid_tmp_guard) = caf::detail::make_scope_guard( \
= caf::logger::thread_local_aid(aarg); \
[=] { caf::logger::thread_local_aid(CAF_UNIFYN(caf_aid_tmp)); })
auto CAF_PP_UNIFYN(caf_aid_tmp_guard) = caf::detail::make_scope_guard( \
[=] { caf::logger::thread_local_aid(CAF_PP_UNIFYN(caf_aid_tmp)); })
#define CAF_PUSH_AID_FROM_PTR(some_ptr) \
#define CAF_PUSH_AID_FROM_PTR(some_ptr) \
auto CAF_UNIFYN(caf_aid_ptr) = some_ptr; \
auto CAF_PP_UNIFYN(caf_aid_ptr) = some_ptr; \
CAF_PUSH_AID(CAF_UNIFYN(caf_aid_ptr) ? CAF_UNIFYN(caf_aid_ptr)->id() : 0)
CAF_PUSH_AID(CAF_PP_UNIFYN(caf_aid_ptr) ? CAF_PP_UNIFYN(caf_aid_ptr)->id() \
: 0)
#define CAF_SET_AID(aid_arg) caf::logger::thread_local_aid(aid_arg)
#define CAF_SET_AID(aid_arg) caf::logger::thread_local_aid(aid_arg)
...
@@ -450,8 +452,9 @@ CAF_CORE_EXPORT bool operator==(const logger::field& x, const logger::field& y);
...
@@ -450,8 +452,9 @@ CAF_CORE_EXPORT bool operator==(const logger::field& x, const logger::field& y);
# define CAF_LOG_TRACE(entry_message) \
# define CAF_LOG_TRACE(entry_message) \
CAF_LOG_IMPL(CAF_LOG_COMPONENT, CAF_LOG_LEVEL_TRACE, \
CAF_LOG_IMPL(CAF_LOG_COMPONENT, CAF_LOG_LEVEL_TRACE, \
"ENTRY" << entry_message); \
"ENTRY" << entry_message); \
auto CAF_UNIFYN(caf_log_trace_guard_) = ::caf::detail::make_scope_guard( \
auto CAF_PP_UNIFYN(caf_log_trace_guard_) \
[=] { CAF_LOG_IMPL(CAF_LOG_COMPONENT, CAF_LOG_LEVEL_TRACE, "EXIT"); })
= ::caf::detail::make_scope_guard( \
[=] { CAF_LOG_IMPL(CAF_LOG_COMPONENT, CAF_LOG_LEVEL_TRACE, "EXIT"); })
#endif // CAF_LOG_LEVEL < CAF_LOG_LEVEL_TRACE
#endif // CAF_LOG_LEVEL < CAF_LOG_LEVEL_TRACE
...
...
libcaf_core/caf/send.hpp
View file @
42f02824
...
@@ -8,7 +8,6 @@
...
@@ -8,7 +8,6 @@
#include "caf/actor_addr.hpp"
#include "caf/actor_addr.hpp"
#include "caf/actor_cast.hpp"
#include "caf/actor_cast.hpp"
#include "caf/check_typed_input.hpp"
#include "caf/check_typed_input.hpp"
#include "caf/is_message_sink.hpp"
#include "caf/local_actor.hpp"
#include "caf/local_actor.hpp"
#include "caf/mailbox_element.hpp"
#include "caf/mailbox_element.hpp"
#include "caf/message.hpp"
#include "caf/message.hpp"
...
...
libcaf_core/caf/settings.hpp
View file @
42f02824
...
@@ -9,7 +9,6 @@
...
@@ -9,7 +9,6 @@
#include "caf/config_value.hpp"
#include "caf/config_value.hpp"
#include "caf/defaults.hpp"
#include "caf/defaults.hpp"
#include "caf/detail/core_export.hpp"
#include "caf/detail/core_export.hpp"
#include "caf/detail/move_if_not_ptr.hpp"
#include "caf/dictionary.hpp"
#include "caf/dictionary.hpp"
#include "caf/raise_error.hpp"
#include "caf/raise_error.hpp"
...
@@ -52,7 +51,10 @@ template <class T>
...
@@ -52,7 +51,10 @@ template <class T>
T
get
(
const
settings
&
xs
,
std
::
string_view
name
)
{
T
get
(
const
settings
&
xs
,
std
::
string_view
name
)
{
auto
result
=
get_if
<
T
>
(
&
xs
,
name
);
auto
result
=
get_if
<
T
>
(
&
xs
,
name
);
CAF_ASSERT
(
result
);
CAF_ASSERT
(
result
);
return
detail
::
move_if_not_ptr
(
result
);
if
constexpr
(
std
::
is_pointer_v
<
decltype
(
result
)
>
)
return
*
result
;
else
return
std
::
move
(
*
result
);
}
}
/// Retrieves the value associated to `name` from `xs` or returns `fallback`.
/// Retrieves the value associated to `name` from `xs` or returns `fallback`.
...
...
libcaf_core/caf/tag/boxing_type.hpp
deleted
100644 → 0
View file @
161e554b
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
namespace
caf
::
tag
{
/// Allows the testing DSL to recognize that subtypes are boxing content types.
struct
boxing_type
{};
}
// namespace caf::tag
libcaf_core/caf/typed_behavior.hpp
View file @
42f02824
...
@@ -6,14 +6,14 @@
...
@@ -6,14 +6,14 @@
#include "caf/behavior.hpp"
#include "caf/behavior.hpp"
#include "caf/deduce_mpi.hpp"
#include "caf/deduce_mpi.hpp"
#include "caf/detail/tbind.hpp"
#include "caf/detail/typed_actor_util.hpp"
#include "caf/interface_mismatch.hpp"
#include "caf/interface_mismatch.hpp"
#include "caf/message_handler.hpp"
#include "caf/message_handler.hpp"
#include "caf/system_messages.hpp"
#include "caf/system_messages.hpp"
#include "caf/timespan.hpp"
#include "caf/timespan.hpp"
#include "caf/unsafe_behavior_init.hpp"
#include "caf/unsafe_behavior_init.hpp"
#include "caf/detail/typed_actor_util.hpp"
namespace
caf
::
detail
{
namespace
caf
::
detail
{
template
<
class
Signature
>
template
<
class
Signature
>
...
...
libcaf_core/caf/unifyn.hpp
deleted
100644 → 0
View file @
161e554b
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
#define CAF_CONCAT_(LHS, RHS) LHS ## RHS
#define CAF_CONCAT(LHS, RHS) CAF_CONCAT_(LHS, RHS)
#define CAF_UNIFYN(NAME) CAF_CONCAT(NAME, __LINE__)
libcaf_core/src/actor_system_config.cpp
View file @
42f02824
...
@@ -14,7 +14,6 @@
...
@@ -14,7 +14,6 @@
#include "caf/config_option_adder.hpp"
#include "caf/config_option_adder.hpp"
#include "caf/defaults.hpp"
#include "caf/defaults.hpp"
#include "caf/detail/config_consumer.hpp"
#include "caf/detail/config_consumer.hpp"
#include "caf/detail/gcd.hpp"
#include "caf/detail/parser/read_config.hpp"
#include "caf/detail/parser/read_config.hpp"
#include "caf/detail/parser/read_string.hpp"
#include "caf/detail/parser/read_string.hpp"
#include "caf/message_builder.hpp"
#include "caf/message_builder.hpp"
...
...
libcaf_core/test/config_option_set.cpp
View file @
42f02824
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
#include <string>
#include <string>
#include <vector>
#include <vector>
#include "caf/detail/move_if_not_ptr.hpp"
#include "caf/settings.hpp"
#include "caf/settings.hpp"
using
std
::
string
;
using
std
::
string
;
...
...
libcaf_core/test/detail/limited_vector.cpp
deleted
100644 → 0
View file @
161e554b
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#define CAF_SUITE detail.limited_vector
#include "caf/detail/limited_vector.hpp"
#include "core-test.hpp"
#include <algorithm>
using
caf
::
detail
::
limited_vector
;
CAF_TEST
(
basics
)
{
using
std
::
equal
;
int
arr1
[]{
1
,
2
,
3
,
4
};
limited_vector
<
int
,
4
>
vec1
{
1
,
2
,
3
,
4
};
limited_vector
<
int
,
5
>
vec2
{
4
,
3
,
2
,
1
};
limited_vector
<
int
,
4
>
vec3
;
for
(
int
i
=
1
;
i
<=
4
;
++
i
)
vec3
.
push_back
(
i
);
limited_vector
<
int
,
4
>
vec4
{
1
,
2
};
limited_vector
<
int
,
2
>
vec5
{
3
,
4
};
vec4
.
insert
(
vec4
.
end
(),
vec5
.
begin
(),
vec5
.
end
());
auto
vec6
=
vec4
;
CHECK_EQ
(
vec1
.
size
(),
4u
);
CHECK_EQ
(
vec2
.
size
(),
4u
);
CHECK_EQ
(
vec3
.
size
(),
4u
);
CHECK_EQ
(
vec4
.
size
(),
4u
);
CHECK_EQ
(
vec5
.
size
(),
2u
);
CHECK_EQ
(
vec6
.
size
(),
4u
);
CHECK_EQ
(
vec1
.
full
(),
true
);
CHECK_EQ
(
vec2
.
full
(),
false
);
CHECK_EQ
(
vec3
.
full
(),
true
);
CHECK_EQ
(
vec4
.
full
(),
true
);
CHECK_EQ
(
vec5
.
full
(),
true
);
CHECK_EQ
(
vec6
.
full
(),
true
);
CHECK
(
std
::
equal
(
vec1
.
begin
(),
vec1
.
end
(),
arr1
));
CHECK
(
std
::
equal
(
vec2
.
rbegin
(),
vec2
.
rend
(),
arr1
));
CHECK
(
std
::
equal
(
vec4
.
begin
(),
vec4
.
end
(),
arr1
));
CHECK
(
std
::
equal
(
vec6
.
begin
(),
vec6
.
end
(),
arr1
));
CHECK
(
std
::
equal
(
vec6
.
begin
(),
vec6
.
end
(),
vec2
.
rbegin
()));
limited_vector
<
int
,
10
>
vec7
{
5
,
9
};
limited_vector
<
int
,
10
>
vec8
{
1
,
2
,
3
,
4
};
limited_vector
<
int
,
10
>
vec9
{
6
,
7
,
8
};
vec7
.
insert
(
vec7
.
begin
()
+
1
,
vec9
.
begin
(),
vec9
.
end
());
vec7
.
insert
(
vec7
.
begin
(),
vec8
.
begin
(),
vec8
.
end
());
CHECK_EQ
(
vec7
.
full
(),
false
);
limited_vector
<
int
,
1
>
vec10
{
10
};
vec7
.
insert
(
vec7
.
end
(),
vec10
.
begin
(),
vec10
.
end
());
CHECK_EQ
(
vec7
.
full
(),
true
);
CHECK
((
std
::
is_sorted
(
vec7
.
begin
(),
vec7
.
end
())));
int
arr2
[]{
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
};
CHECK
((
std
::
equal
(
vec7
.
begin
(),
vec7
.
end
(),
std
::
begin
(
arr2
))));
vec7
.
assign
(
std
::
begin
(
arr2
),
std
::
end
(
arr2
));
CHECK
((
std
::
equal
(
vec7
.
begin
(),
vec7
.
end
(),
std
::
begin
(
arr2
))));
vec7
.
assign
(
5
,
0
);
CHECK_EQ
(
vec7
.
size
(),
5u
);
CHECK
((
std
::
all_of
(
vec7
.
begin
(),
vec7
.
end
(),
[](
int
i
)
{
return
i
==
0
;
})));
}
libcaf_core/test/serialization.cpp
View file @
42f02824
...
@@ -38,7 +38,6 @@
...
@@ -38,7 +38,6 @@
#include "caf/detail/get_mac_addresses.hpp"
#include "caf/detail/get_mac_addresses.hpp"
#include "caf/detail/ieee_754.hpp"
#include "caf/detail/ieee_754.hpp"
#include "caf/detail/int_list.hpp"
#include "caf/detail/int_list.hpp"
#include "caf/detail/safe_equal.hpp"
#include "caf/detail/stringification_inspector.hpp"
#include "caf/detail/stringification_inspector.hpp"
#include "caf/detail/type_traits.hpp"
#include "caf/detail/type_traits.hpp"
#include "caf/event_based_actor.hpp"
#include "caf/event_based_actor.hpp"
...
...
libcaf_io/src/io/middleman.cpp
View file @
42f02824
...
@@ -23,7 +23,6 @@
...
@@ -23,7 +23,6 @@
#include "caf/detail/latch.hpp"
#include "caf/detail/latch.hpp"
#include "caf/detail/prometheus_broker.hpp"
#include "caf/detail/prometheus_broker.hpp"
#include "caf/detail/ripemd_160.hpp"
#include "caf/detail/ripemd_160.hpp"
#include "caf/detail/safe_equal.hpp"
#include "caf/detail/set_thread_name.hpp"
#include "caf/detail/set_thread_name.hpp"
#include "caf/event_based_actor.hpp"
#include "caf/event_based_actor.hpp"
#include "caf/function_view.hpp"
#include "caf/function_view.hpp"
...
...
libcaf_test/caf/test/bdd_dsl.hpp
View file @
42f02824
#pragma once
#pragma once
#include "caf/detail/pp.hpp"
#include "caf/test/dsl.hpp"
#include "caf/test/dsl.hpp"
#define SCENARIO(description) \
#define SCENARIO(description) \
...
@@ -68,6 +69,6 @@
...
@@ -68,6 +69,6 @@
#define FAIL(what) CAF_FAIL(what)
#define FAIL(what) CAF_FAIL(what)
#define BEGIN_FIXTURE_SCOPE(fixture_class) \
#define BEGIN_FIXTURE_SCOPE(fixture_class) \
CAF_TEST_FIXTURE_SCOPE(CAF_UNIFYN(tests), fixture_class)
CAF_TEST_FIXTURE_SCOPE(CAF_
PP_
UNIFYN(tests), fixture_class)
#define END_FIXTURE_SCOPE() CAF_TEST_FIXTURE_SCOPE_END()
#define END_FIXTURE_SCOPE() CAF_TEST_FIXTURE_SCOPE_END()
libcaf_test/caf/test/dsl.hpp
View file @
42f02824
...
@@ -10,7 +10,6 @@
...
@@ -10,7 +10,6 @@
#include "caf/binary_serializer.hpp"
#include "caf/binary_serializer.hpp"
#include "caf/byte_buffer.hpp"
#include "caf/byte_buffer.hpp"
#include "caf/config.hpp"
#include "caf/config.hpp"
#include "caf/detail/gcd.hpp"
#include "caf/init_global_meta_objects.hpp"
#include "caf/init_global_meta_objects.hpp"
#include "caf/test/unit_test.hpp"
#include "caf/test/unit_test.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