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
48e941b1
Commit
48e941b1
authored
Nov 18, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix build on debian-8
parent
ba74bb57
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
20 deletions
+24
-20
examples/custom_type/custom_types_1.cpp
examples/custom_type/custom_types_1.cpp
+1
-1
libcaf_core/caf/binary_deserializer.hpp
libcaf_core/caf/binary_deserializer.hpp
+5
-3
libcaf_core/caf/binary_serializer.hpp
libcaf_core/caf/binary_serializer.hpp
+2
-1
libcaf_core/caf/detail/type_traits.hpp
libcaf_core/caf/detail/type_traits.hpp
+1
-1
libcaf_core/caf/read_inspector.hpp
libcaf_core/caf/read_inspector.hpp
+7
-7
libcaf_core/caf/serializer.hpp
libcaf_core/caf/serializer.hpp
+4
-3
libcaf_core/caf/write_inspector.hpp
libcaf_core/caf/write_inspector.hpp
+4
-4
No files found.
examples/custom_type/custom_types_1.cpp
View file @
48e941b1
...
@@ -90,7 +90,7 @@ void caf_main(actor_system& system, const config&) {
...
@@ -90,7 +90,7 @@ void caf_main(actor_system& system, const config&) {
f1
.
b
.
resize
(
1
);
f1
.
b
.
resize
(
1
);
f1
.
b
.
back
().
push_back
(
42
);
f1
.
b
.
back
().
push_back
(
42
);
// I/O buffer
// I/O buffer
vector
<
char
>
buf
;
binary_serializer
::
container_type
buf
;
// write f1 to buffer
// write f1 to buffer
binary_serializer
bs
{
system
,
buf
};
binary_serializer
bs
{
system
,
buf
};
auto
e
=
bs
(
f1
);
auto
e
=
bs
(
f1
);
...
...
libcaf_core/caf/binary_deserializer.hpp
View file @
48e941b1
...
@@ -20,7 +20,6 @@
...
@@ -20,7 +20,6 @@
#include <cstddef>
#include <cstddef>
#include <string>
#include <string>
#include <string_view>
#include <tuple>
#include <tuple>
#include <utility>
#include <utility>
...
@@ -28,6 +27,7 @@
...
@@ -28,6 +27,7 @@
#include "caf/fwd.hpp"
#include "caf/fwd.hpp"
#include "caf/sec.hpp"
#include "caf/sec.hpp"
#include "caf/span.hpp"
#include "caf/span.hpp"
#include "caf/string_view.hpp"
#include "caf/write_inspector.hpp"
#include "caf/write_inspector.hpp"
namespace
caf
{
namespace
caf
{
...
@@ -55,12 +55,14 @@ public:
...
@@ -55,12 +55,14 @@ public:
binary_deserializer
(
execution_unit
*
ctx
,
const
void
*
buf
,
binary_deserializer
(
execution_unit
*
ctx
,
const
void
*
buf
,
size_t
size
)
noexcept
size_t
size
)
noexcept
:
binary_deserializer
(
ctx
,
span
{
reinterpret_cast
<
const
byte
*>
(
buf
),
size
})
{
:
binary_deserializer
(
ctx
,
make_span
(
reinterpret_cast
<
const
byte
*>
(
buf
),
size
))
{
// nop
// nop
}
}
binary_deserializer
(
actor_system
&
sys
,
const
void
*
buf
,
size_t
size
)
noexcept
binary_deserializer
(
actor_system
&
sys
,
const
void
*
buf
,
size_t
size
)
noexcept
:
binary_deserializer
(
sys
,
span
{
reinterpret_cast
<
const
byte
*>
(
buf
),
size
})
{
:
binary_deserializer
(
sys
,
make_span
(
reinterpret_cast
<
const
byte
*>
(
buf
),
size
))
{
// nop
// nop
}
}
...
...
libcaf_core/caf/binary_serializer.hpp
View file @
48e941b1
...
@@ -124,7 +124,8 @@ public:
...
@@ -124,7 +124,8 @@ public:
void
apply
(
span
<
const
byte
>
x
);
void
apply
(
span
<
const
byte
>
x
);
template
<
class
T
>
template
<
class
T
>
std
::
enable_if_t
<
std
::
is_integral_v
<
T
>
&&
std
::
is_signed_v
<
T
>>
apply
(
T
x
)
{
std
::
enable_if_t
<
std
::
is_integral
<
T
>::
value
&&
std
::
is_signed
<
T
>::
value
>
apply
(
T
x
)
{
return
apply
(
static_cast
<
std
::
make_unsigned_t
<
T
>>
(
x
));
return
apply
(
static_cast
<
std
::
make_unsigned_t
<
T
>>
(
x
));
}
}
...
...
libcaf_core/caf/detail/type_traits.hpp
View file @
48e941b1
...
@@ -729,7 +729,7 @@ template <class T>
...
@@ -729,7 +729,7 @@ template <class T>
struct
is_stl_tuple_type
{
struct
is_stl_tuple_type
{
template
<
class
U
>
template
<
class
U
>
static
auto
sfinae
(
U
*
)
static
auto
sfinae
(
U
*
)
->
decltype
(
std
::
bool_constant
<
std
::
tuple_size
<
U
>::
value
>=
0
>
{});
->
decltype
(
std
::
integral_constant
<
bool
,
std
::
tuple_size
<
U
>::
value
>=
0
>
{});
template
<
class
U
>
template
<
class
U
>
static
auto
sfinae
(...)
->
std
::
false_type
;
static
auto
sfinae
(...)
->
std
::
false_type
;
...
...
libcaf_core/caf/read_inspector.hpp
View file @
48e941b1
...
@@ -77,21 +77,21 @@ public:
...
@@ -77,21 +77,21 @@ public:
}
else
{
}
else
{
CAF_READ_INSPECTOR_TRY
(
dref
.
apply
(
x
))
CAF_READ_INSPECTOR_TRY
(
dref
.
apply
(
x
))
}
}
}
else
if
constexpr
(
std
::
is_integral
_v
<
type
>
)
{
}
else
if
constexpr
(
std
::
is_integral
<
type
>::
value
)
{
using
squashed_type
=
detail
::
squashed_int_t
<
type
>
;
using
squashed_type
=
detail
::
squashed_int_t
<
type
>
;
CAF_READ_INSPECTOR_TRY
(
dref
.
apply
(
static_cast
<
squashed_type
>
(
x
)))
CAF_READ_INSPECTOR_TRY
(
dref
.
apply
(
static_cast
<
squashed_type
>
(
x
)))
}
else
if
constexpr
(
std
::
is_array
<
type
>::
value
)
{
}
else
if
constexpr
(
std
::
is_array
<
type
>::
value
)
{
CAF_READ_INSPECTOR_TRY
(
apply_array
(
dref
,
x
))
CAF_READ_INSPECTOR_TRY
(
apply_array
(
dref
,
x
))
}
else
if
constexpr
(
detail
::
is_stl_tuple_type
_v
<
type
>
)
{
}
else
if
constexpr
(
detail
::
is_stl_tuple_type
<
type
>::
value
)
{
std
::
make_index_sequence
<
std
::
tuple_size
_v
<
type
>
>
seq
;
std
::
make_index_sequence
<
std
::
tuple_size
<
type
>::
value
>
seq
;
CAF_READ_INSPECTOR_TRY
(
apply_tuple
(
dref
,
x
,
seq
))
CAF_READ_INSPECTOR_TRY
(
apply_tuple
(
dref
,
x
,
seq
))
}
else
if
constexpr
(
detail
::
is_map_like
_v
<
type
>
)
{
}
else
if
constexpr
(
detail
::
is_map_like
<
type
>::
value
)
{
CAF_READ_INSPECTOR_TRY
(
dref
.
begin_sequence
(
x
.
size
()))
CAF_READ_INSPECTOR_TRY
(
dref
.
begin_sequence
(
x
.
size
()))
for
(
const
auto
&
[
key
,
value
]
:
x
)
{
for
(
const
auto
&
kvp
:
x
)
{
CAF_READ_INSPECTOR_TRY
(
dref
(
k
ey
,
value
))
CAF_READ_INSPECTOR_TRY
(
dref
(
k
vp
.
first
,
kvp
.
second
))
}
}
CAF_READ_INSPECTOR_TRY
(
dref
.
end_sequence
())
CAF_READ_INSPECTOR_TRY
(
dref
.
end_sequence
())
}
else
if
constexpr
(
detail
::
is_list_like
_v
<
type
>
)
{
}
else
if
constexpr
(
detail
::
is_list_like
<
type
>::
value
)
{
CAF_READ_INSPECTOR_TRY
(
dref
.
begin_sequence
(
x
.
size
()))
CAF_READ_INSPECTOR_TRY
(
dref
.
begin_sequence
(
x
.
size
()))
for
(
const
auto
&
value
:
x
)
{
for
(
const
auto
&
value
:
x
)
{
CAF_READ_INSPECTOR_TRY
(
dref
(
value
))
CAF_READ_INSPECTOR_TRY
(
dref
(
value
))
...
...
libcaf_core/caf/serializer.hpp
View file @
48e941b1
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
#include <cstddef>
#include <cstddef>
#include <cstdint>
#include <cstdint>
#include <string
_view
>
#include <string>
#include <tuple>
#include <tuple>
#include <utility>
#include <utility>
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
#include "caf/read_inspector.hpp"
#include "caf/read_inspector.hpp"
#include "caf/sec.hpp"
#include "caf/sec.hpp"
#include "caf/span.hpp"
#include "caf/span.hpp"
#include "caf/string_view.hpp"
namespace
caf
{
namespace
caf
{
...
@@ -125,10 +126,10 @@ public:
...
@@ -125,10 +126,10 @@ public:
virtual
result_type
apply
(
string_view
x
)
=
0
;
virtual
result_type
apply
(
string_view
x
)
=
0
;
/// @copydoc apply
/// @copydoc apply
virtual
result_type
apply
(
std
::
u16string_view
x
)
=
0
;
virtual
result_type
apply
(
const
std
::
u16string
&
x
)
=
0
;
/// @copydoc apply
/// @copydoc apply
virtual
result_type
apply
(
std
::
u32string_view
x
)
=
0
;
virtual
result_type
apply
(
const
std
::
u32string
&
x
)
=
0
;
template
<
class
Enum
,
class
=
std
::
enable_if_t
<
std
::
is_enum
<
Enum
>
::
value
>>
template
<
class
Enum
,
class
=
std
::
enable_if_t
<
std
::
is_enum
<
Enum
>
::
value
>>
result_type
apply
(
Enum
x
)
{
result_type
apply
(
Enum
x
)
{
...
...
libcaf_core/caf/write_inspector.hpp
View file @
48e941b1
...
@@ -69,13 +69,13 @@ public:
...
@@ -69,13 +69,13 @@ public:
// skip element
// skip element
}
else
if
constexpr
(
detail
::
can_apply_v
<
Subtype
,
decltype
(
x
)
>
)
{
}
else
if
constexpr
(
detail
::
can_apply_v
<
Subtype
,
decltype
(
x
)
>
)
{
CAF_WRITE_INSPECTOR_TRY
(
dref
.
apply
(
x
))
CAF_WRITE_INSPECTOR_TRY
(
dref
.
apply
(
x
))
}
else
if
constexpr
(
std
::
is_integral
_v
<
type
>
)
{
}
else
if
constexpr
(
std
::
is_integral
<
type
>::
value
)
{
using
squashed_type
=
detail
::
squashed_int_t
<
type
>
;
using
squashed_type
=
detail
::
squashed_int_t
<
type
>
;
CAF_WRITE_INSPECTOR_TRY
(
dref
.
apply
(
reinterpret_cast
<
squashed_type
&>
(
x
)))
CAF_WRITE_INSPECTOR_TRY
(
dref
.
apply
(
reinterpret_cast
<
squashed_type
&>
(
x
)))
}
else
if
constexpr
(
std
::
is_array
<
type
>::
value
)
{
}
else
if
constexpr
(
std
::
is_array
<
type
>::
value
)
{
CAF_WRITE_INSPECTOR_TRY
(
apply_array
(
dref
,
x
))
CAF_WRITE_INSPECTOR_TRY
(
apply_array
(
dref
,
x
))
}
else
if
constexpr
(
detail
::
is_stl_tuple_type_v
<
type
>
)
{
}
else
if
constexpr
(
detail
::
is_stl_tuple_type_v
<
type
>
)
{
std
::
make_index_sequence
<
std
::
tuple_size
_v
<
type
>
>
seq
;
std
::
make_index_sequence
<
std
::
tuple_size
<
type
>::
value
>
seq
;
CAF_WRITE_INSPECTOR_TRY
(
apply_tuple
(
dref
,
x
,
seq
))
CAF_WRITE_INSPECTOR_TRY
(
apply_tuple
(
dref
,
x
,
seq
))
}
else
if
constexpr
(
detail
::
is_map_like_v
<
type
>
)
{
}
else
if
constexpr
(
detail
::
is_map_like_v
<
type
>
)
{
x
.
clear
();
x
.
clear
();
...
@@ -99,8 +99,8 @@ public:
...
@@ -99,8 +99,8 @@ public:
}
}
CAF_WRITE_INSPECTOR_TRY
(
dref
.
end_sequence
())
CAF_WRITE_INSPECTOR_TRY
(
dref
.
end_sequence
())
}
else
{
}
else
{
static_assert
(
std
::
is_lvalue_reference
_v
<
decltype
(
x
)
>
//
static_assert
(
std
::
is_lvalue_reference
<
decltype
(
x
)
>::
value
//
&&
!
std
::
is_const
_v
<
decltype
(
x
)
>
);
&&
!
std
::
is_const
<
decltype
(
x
)
>::
value
);
static_assert
(
detail
::
is_inspectable
<
Subtype
,
type
>::
value
);
static_assert
(
detail
::
is_inspectable
<
Subtype
,
type
>::
value
);
using
caf
::
detail
::
inspect
;
using
caf
::
detail
::
inspect
;
CAF_WRITE_INSPECTOR_TRY
(
inspect
(
dref
,
x
));
CAF_WRITE_INSPECTOR_TRY
(
inspect
(
dref
,
x
));
...
...
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