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
c5800cda
Commit
c5800cda
authored
Sep 14, 2012
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable announced types to have members of any builtin type
parent
7868b279
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
3 deletions
+32
-3
cppa/detail/default_uniform_type_info_impl.hpp
cppa/detail/default_uniform_type_info_impl.hpp
+32
-3
No files found.
cppa/detail/default_uniform_type_info_impl.hpp
View file @
c5800cda
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#include "cppa/util/rm_ref.hpp"
#include "cppa/util/rm_ref.hpp"
#include "cppa/util/void_type.hpp"
#include "cppa/util/void_type.hpp"
#include "cppa/util/is_builtin.hpp"
#include "cppa/util/is_iterable.hpp"
#include "cppa/util/is_iterable.hpp"
#include "cppa/util/is_primitive.hpp"
#include "cppa/util/is_primitive.hpp"
#include "cppa/util/is_forward_iterator.hpp"
#include "cppa/util/is_forward_iterator.hpp"
...
@@ -96,6 +97,27 @@ class is_stl_compliant_map {
...
@@ -96,6 +97,27 @@ class is_stl_compliant_map {
};
};
template
<
typename
T
>
class
builtin_member
:
public
util
::
abstract_uniform_type_info
<
T
>
{
public:
builtin_member
()
:
m_decorated
(
uniform_typeid
<
T
>
())
{
}
void
serialize
(
const
void
*
obj
,
serializer
*
s
)
const
{
m_decorated
->
serialize
(
obj
,
s
);
}
void
deserialize
(
void
*
obj
,
deserializer
*
d
)
const
{
m_decorated
->
deserialize
(
obj
,
d
);
}
private:
const
uniform_type_info
*
m_decorated
;
};
template
<
typename
T
>
template
<
typename
T
>
class
default_uniform_type_info_impl
:
public
util
::
abstract_uniform_type_info
<
T
>
{
class
default_uniform_type_info_impl
:
public
util
::
abstract_uniform_type_info
<
T
>
{
...
@@ -265,7 +287,14 @@ class default_uniform_type_info_impl : public util::abstract_uniform_type_info<T
...
@@ -265,7 +287,14 @@ class default_uniform_type_info_impl : public util::abstract_uniform_type_info<T
}
}
template
<
typename
R
,
class
C
,
typename
...
Args
>
template
<
typename
R
,
class
C
,
typename
...
Args
>
typename
std
::
enable_if
<
is_invalid
<
R
>::
value
>::
type
typename
std
::
enable_if
<
is_invalid
<
R
>::
value
&&
util
::
is_builtin
<
R
>::
value
>::
type
push_back
(
R
C
::*
mem_ptr
,
Args
&&
...
args
)
{
m_members
.
push_back
({
new
builtin_member
<
R
>
(),
mem_ptr
});
push_back
(
std
::
forward
<
Args
>
(
args
)...);
}
template
<
typename
R
,
class
C
,
typename
...
Args
>
typename
std
::
enable_if
<
is_invalid
<
R
>::
value
&&
!
util
::
is_builtin
<
R
>::
value
>::
type
push_back
(
R
C
::*
,
Args
&&
...)
{
push_back
(
R
C
::*
,
Args
&&
...)
{
static_assert
(
util
::
is_primitive
<
R
>::
value
,
static_assert
(
util
::
is_primitive
<
R
>::
value
,
"T is neither a primitive type nor a "
"T is neither a primitive type nor a "
...
...
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