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
ac19cd13
Commit
ac19cd13
authored
Jan 29, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor `tuple_type_names()`: return string value
parent
1b7f9e56
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
5 additions
and
27 deletions
+5
-27
libcaf_core/caf/detail/decorated_tuple.hpp
libcaf_core/caf/detail/decorated_tuple.hpp
+0
-2
libcaf_core/caf/detail/message_data.hpp
libcaf_core/caf/detail/message_data.hpp
+1
-3
libcaf_core/caf/detail/tuple_vals.hpp
libcaf_core/caf/detail/tuple_vals.hpp
+0
-6
libcaf_core/src/decorated_tuple.cpp
libcaf_core/src/decorated_tuple.cpp
+0
-6
libcaf_core/src/message_data.cpp
libcaf_core/src/message_data.cpp
+3
-3
libcaf_core/src/uniform_type_info_map.cpp
libcaf_core/src/uniform_type_info_map.cpp
+1
-7
No files found.
libcaf_core/caf/detail/decorated_tuple.hpp
View file @
ac19cd13
...
...
@@ -72,8 +72,6 @@ class decorated_tuple : public message_data {
const
char
*
uniform_name_at
(
size_t
pos
)
const
override
;
const
std
::
string
*
tuple_type_names
()
const
override
;
uint16_t
type_nr_at
(
size_t
pos
)
const
override
;
private:
...
...
libcaf_core/caf/detail/message_data.hpp
View file @
ac19cd13
...
...
@@ -55,7 +55,7 @@ class message_data : public ref_counted {
virtual
const
void
*
at
(
size_t
pos
)
const
=
0
;
virtual
const
std
::
string
*
tuple_type_names
()
const
=
0
;
std
::
string
tuple_type_names
()
const
;
/**
* Tries to match element at position `pos` to given RTTI.
...
...
@@ -132,8 +132,6 @@ class message_data : public ref_counted {
};
};
std
::
string
get_tuple_type_names
(
const
detail
::
message_data
&
);
}
// namespace detail
}
// namespace caf
...
...
libcaf_core/caf/detail/tuple_vals.hpp
View file @
ac19cd13
...
...
@@ -120,12 +120,6 @@ class tuple_vals : public message_data {
return
const_cast
<
void
*>
(
at
(
pos
));
}
const
std
::
string
*
tuple_type_names
()
const
override
{
// produced name is equal for all instances
static
std
::
string
result
=
get_tuple_type_names
(
*
this
);
return
&
result
;
}
bool
match_element
(
size_t
pos
,
uint16_t
typenr
,
const
std
::
type_info
*
rtti
)
const
override
{
CAF_REQUIRE
(
pos
<
size
());
...
...
libcaf_core/src/decorated_tuple.cpp
View file @
ac19cd13
...
...
@@ -91,11 +91,5 @@ decorated_tuple::decorated_tuple(pointer d, size_t offset)
init
(
offset
);
}
const
std
::
string
*
decorated_tuple
::
tuple_type_names
()
const
{
// produced name is equal for all instances
static
std
::
string
result
=
get_tuple_type_names
(
*
this
);
return
&
result
;
}
}
// namespace detail
}
// namespace caf
libcaf_core/src/message_data.cpp
View file @
ac19cd13
...
...
@@ -62,11 +62,11 @@ void* message_data::mutable_native_data() {
return
nullptr
;
}
std
::
string
get_tuple_type_names
(
const
detail
::
message_data
&
tup
)
{
std
::
string
message_data
::
tuple_type_names
()
const
{
std
::
string
result
=
"@<>"
;
for
(
size_t
i
=
0
;
i
<
tup
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
size
();
++
i
)
{
result
+=
"+"
;
result
+=
tup
.
uniform_name_at
(
i
);
result
+=
uniform_name_at
(
i
);
}
return
result
;
}
...
...
libcaf_core/src/uniform_type_info_map.cpp
View file @
ac19cd13
...
...
@@ -232,13 +232,7 @@ void deserialize_impl(channel& ptrref, deserializer* source) {
void
serialize_impl
(
const
message
&
tup
,
serializer
*
sink
)
{
std
::
string
dynamic_name
;
// used if tup holds an object_array
// ttn can be nullptr even if tuple is not empty (in case of object_array)
const
std
::
string
*
ttn
=
tup
.
empty
()
?
nullptr
:
tup
.
tuple_type_names
();
const
char
*
tname
=
ttn
?
ttn
->
data
()
:
(
tup
.
empty
()
?
"@<>"
:
nullptr
);
if
(
!
tname
)
{
// tuple is not empty, i.e., we are dealing with an object array
dynamic_name
=
detail
::
get_tuple_type_names
(
*
tup
.
vals
());
tname
=
dynamic_name
.
c_str
();
}
std
::
string
tname
=
tup
.
empty
()
?
"@<>"
:
tup
.
tuple_type_names
();
auto
uti_map
=
detail
::
singletons
::
get_uniform_type_info_map
();
auto
uti
=
uti_map
->
by_uniform_name
(
tname
);
if
(
uti
==
nullptr
)
{
...
...
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