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
aa877453
Commit
aa877453
authored
Sep 11, 2012
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
relaxed to_string to take any of libcppa's native types
parent
e69a42c4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
4 deletions
+34
-4
cppa/to_string.hpp
cppa/to_string.hpp
+34
-4
No files found.
cppa/to_string.hpp
View file @
aa877453
...
@@ -31,11 +31,18 @@
...
@@ -31,11 +31,18 @@
#ifndef CPPA_TO_STRING_HPP
#ifndef CPPA_TO_STRING_HPP
#define CPPA_TO_STRING_HPP
#define CPPA_TO_STRING_HPP
#include <type_traits>
#include "cppa/atom.hpp" // included for to_string(atom_value)
#include "cppa/atom.hpp" // included for to_string(atom_value)
#include "cppa/actor.hpp"
#include "cppa/group.hpp"
#include "cppa/object.hpp"
#include "cppa/object.hpp"
#include "cppa/channel.hpp"
#include "cppa/anything.hpp"
#include "cppa/any_tuple.hpp"
#include "cppa/any_tuple.hpp"
#include "cppa/intrusive_ptr.hpp"
#include "cppa/uniform_type_info.hpp"
#include "cppa/uniform_type_info.hpp"
#include "cppa/
detail/to_uniform_name
.hpp"
#include "cppa/
process_information
.hpp"
namespace
cppa
{
namespace
cppa
{
...
@@ -43,13 +50,36 @@ namespace detail {
...
@@ -43,13 +50,36 @@ namespace detail {
std
::
string
to_string_impl
(
const
void
*
what
,
const
uniform_type_info
*
utype
);
std
::
string
to_string_impl
(
const
void
*
what
,
const
uniform_type_info
*
utype
);
template
<
typename
T
>
struct
has_cppa_to_string
:
std
::
false_type
{
};
template
<
>
struct
has_cppa_to_string
<
any_tuple
>
:
std
::
true_type
{
};
template
<
>
struct
has_cppa_to_string
<
addressed_message
>
:
std
::
true_type
{
};
template
<
>
struct
has_cppa_to_string
<
actor_ptr
>
:
std
::
true_type
{
};
template
<
>
struct
has_cppa_to_string
<
group_ptr
>
:
std
::
true_type
{
};
template
<
>
struct
has_cppa_to_string
<
channel_ptr
>
:
std
::
true_type
{
};
template
<
>
struct
has_cppa_to_string
<
process_information_ptr
>
:
std
::
true_type
{
};
}
// namespace detail
}
// namespace detail
/**
/**
* @brief Converts a
tuple
to a string.
* @brief Converts a
ny of libcppa's core types
to a string.
*/
*/
inline
std
::
string
to_string
(
const
any_tuple
&
what
)
{
template
<
typename
T
>
return
detail
::
to_string_impl
(
&
what
,
uniform_typeid
<
any_tuple
>
());
inline
std
::
string
to_string
(
const
T
&
what
,
typename
std
::
enable_if
<
detail
::
has_cppa_to_string
<
T
>::
value
>::
type
*
=
0
)
{
return
detail
::
to_string_impl
(
&
what
,
uniform_typeid
<
T
>
());
}
}
/**
/**
...
...
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