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
1511ff95
Commit
1511ff95
authored
Jan 13, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove remnants of demangle, announce set<string>
parent
22f345f1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
94 deletions
+43
-94
libcaf_core/caf/detail/abstract_uniform_type_info.hpp
libcaf_core/caf/detail/abstract_uniform_type_info.hpp
+2
-2
libcaf_core/caf/detail/uniform_type_info_map.hpp
libcaf_core/caf/detail/uniform_type_info_map.hpp
+0
-9
libcaf_core/src/uniform_type_info_map.cpp
libcaf_core/src/uniform_type_info_map.cpp
+41
-83
No files found.
libcaf_core/caf/detail/abstract_uniform_type_info.hpp
View file @
1511ff95
...
...
@@ -60,8 +60,8 @@ class abstract_uniform_type_info : public uniform_type_info {
protected:
abstract_uniform_type_info
(
std
::
string
tname
)
{
m_name
=
detail
::
mapped_name_by_decorated_name
(
std
::
move
(
tname
));
abstract_uniform_type_info
(
std
::
string
tname
)
:
m_name
(
std
::
move
(
tname
))
{
// nop
}
static
inline
const
T
&
deref
(
const
void
*
ptr
)
{
...
...
libcaf_core/caf/detail/uniform_type_info_map.hpp
View file @
1511ff95
...
...
@@ -45,15 +45,6 @@ class uniform_type_info;
namespace
caf
{
namespace
detail
{
const
char
*
mapped_name_by_decorated_name
(
const
char
*
decorated_name
);
std
::
string
mapped_name_by_decorated_name
(
std
::
string
&&
decorated_name
);
inline
const
char
*
mapped_name_by_decorated_name
(
const
std
::
string
&
decorated_name
)
{
return
mapped_name_by_decorated_name
(
decorated_name
.
c_str
());
}
// lookup table for integer types
extern
const
char
*
mapped_int_names
[][
2
];
...
...
libcaf_core/src/uniform_type_info_map.cpp
View file @
1511ff95
...
...
@@ -53,43 +53,34 @@ namespace caf {
namespace
detail
{
namespace
{
const
char
*
mapped_type_names
[][
2
]
=
{
{
"bool"
,
"bool"
},
{
"caf::actor"
,
"@actor"
},
{
"caf::actor_addr"
,
"@addr"
},
{
"caf::atom_value"
,
"@atom"
},
{
"caf::channel"
,
"@channel"
},
{
"caf::down_msg"
,
"@down"
},
{
"caf::duration"
,
"@duration"
},
{
"caf::exit_msg"
,
"@exit"
},
{
"caf::group"
,
"@group"
},
{
"caf::group_down_msg"
,
"@group_down"
},
{
"caf::message"
,
"@message"
},
{
"caf::message_id"
,
"@message_id"
},
{
"caf::node_id"
,
"@node"
},
{
"caf::sync_exited_msg"
,
"@sync_exited"
},
{
"caf::sync_timeout_msg"
,
"@sync_timeout"
},
{
"caf::timeout_msg"
,
"@timeout"
},
{
"caf::unit_t"
,
"@unit"
},
{
"double"
,
"double"
},
{
"float"
,
"float"
},
{
"long double"
,
"@ldouble"
},
// std::string
{
"std::basic_string<@i8,std::char_traits<@i8>,std::allocator<@i8>>"
,
"@str"
},
// std::u16string
{
"std::basic_string<@u16,std::char_traits<@u16>,std::allocator<@u16>>"
,
"@u16str"
},
// std::u32string
{
"std::basic_string<@u32,std::char_traits<@u32>,std::allocator<@u32>>"
,
"@u32str"
},
// std::map<std::string,std::string>
{
"std::map<@str,@str,std::less<@str>,"
"std::allocator<std::pair<const @str,@str>>>"
,
"@strmap"
},
// std::vector<char>
{
"std::vector<@i8,std::allocator<@i8>>"
,
"@charbuf"
},
// std::vector<std::string>
{
"std::vector<@str,std::allocator<@str>>"
,
"@strvec"
}
const
char
*
mapped_type_names
[]
=
{
"bool"
,
"@actor"
,
"@addr"
,
"@atom"
,
"@channel"
,
"@down"
,
"@duration"
,
"@exit"
,
"@group"
,
"@group_down"
,
"@message"
,
"@message_id"
,
"@node"
,
"@sync_exited"
,
"@sync_timeout"
,
"@timeout"
,
"@unit"
,
"double"
,
"float"
,
"@ldouble"
,
"@str"
,
"@u16str"
,
"@u32str"
,
"@strmap"
,
"@charbuf"
,
"@strvec"
,
"@strset"
};
// the order of this table must be *identical* to mapped_type_names
using
static_type_table
=
type_list
<
bool
,
...
...
@@ -117,12 +108,13 @@ using static_type_table = type_list<bool,
std
::
u32string
,
std
::
map
<
std
::
string
,
std
::
string
>
,
std
::
vector
<
char
>
,
std
::
vector
<
std
::
string
>>
;
std
::
vector
<
std
::
string
>
,
std
::
set
<
std
::
string
>>
;
}
// namespace <anonymous>
template
<
class
T
>
constexpr
const
char
*
mapped_name
()
{
return
mapped_type_names
[
detail
::
tl_find
<
static_type_table
,
T
>::
value
]
[
1
]
;
return
mapped_type_names
[
detail
::
tl_find
<
static_type_table
,
T
>::
value
];
}
// maps sizeof(T) => {unsigned name, signed name}
...
...
@@ -138,31 +130,6 @@ constexpr const char* mapped_name() {
{
"@u64"
,
"@i64"
}
};
const
char
*
mapped_name_by_decorated_name
(
const
char
*
cstr
)
{
using
namespace
std
;
auto
cmp
=
[
&
](
const
char
**
lhs
)
{
return
strcmp
(
lhs
[
0
],
cstr
)
==
0
;
};
auto
e
=
end
(
mapped_type_names
);
auto
i
=
find_if
(
begin
(
mapped_type_names
),
e
,
cmp
);
if
(
i
!=
e
){
return
(
*
i
)[
1
];
}
// for some reason, GCC returns "std::string" as RTTI type name
// instead of std::basic_string<...>, this also affects clang-compiled
// code when used with GCC's libstdc++
if
(
strcmp
(
"std::string"
,
cstr
)
==
0
)
{
return
mapped_name
<
std
::
string
>
();
}
return
cstr
;
// no mapping found
}
std
::
string
mapped_name_by_decorated_name
(
std
::
string
&&
str
)
{
auto
res
=
mapped_name_by_decorated_name
(
str
.
c_str
());
if
(
res
==
str
.
c_str
())
{
return
std
::
move
(
str
);
}
return
res
;
}
namespace
{
inline
bool
operator
==
(
const
unit_t
&
,
const
unit_t
&
)
{
...
...
@@ -454,28 +421,18 @@ inline void deserialize_impl(const sync_timeout_msg&, deserializer*) {
// nop
}
inline
void
serialize_impl
(
const
std
::
map
<
std
::
string
,
std
::
string
>&
smap
,
serializer
*
sink
)
{
default_serialize_policy
sp
;
sp
(
smap
,
sink
);
}
inline
void
deserialize_impl
(
std
::
map
<
std
::
string
,
std
::
string
>&
smap
,
deserializer
*
source
)
{
default_serialize_policy
sp
;
sp
(
smap
,
source
);
}
template
<
class
T
>
inline
void
serialize_impl
(
const
std
::
vector
<
T
>&
vec
,
serializer
*
sink
)
{
typename
std
::
enable_if
<
is_iterable
<
T
>::
value
>::
type
serialize_impl
(
const
T
&
iterable
,
serializer
*
sink
)
{
default_serialize_policy
sp
;
sp
(
vec
,
sink
);
sp
(
iterable
,
sink
);
}
template
<
class
T
>
inline
void
deserialize_impl
(
std
::
vector
<
T
>&
vec
,
deserializer
*
source
)
{
typename
std
::
enable_if
<
is_iterable
<
T
>::
value
>::
type
deserialize_impl
(
T
&
iterable
,
deserializer
*
sink
)
{
default_serialize_policy
sp
;
sp
(
vec
,
source
);
sp
(
iterable
,
sink
);
}
bool
types_equal
(
const
std
::
type_info
*
lhs
,
const
std
::
type_info
*
rhs
)
{
...
...
@@ -831,7 +788,8 @@ class utim_impl : public uniform_type_info_map {
int_tinfo
<
int64_t
>
,
int_tinfo
<
uint64_t
>
,
uti_impl
<
charbuf
>
,
uti_impl
<
strvec
>>
;
uti_impl
<
strvec
>
,
uti_impl
<
std
::
set
<
std
::
string
>>>
;
builtin_types
m_storage
;
...
...
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