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
2a83c142
Commit
2a83c142
authored
Aug 03, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove `uniform_type_info::as_message`
parent
cf73d125
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
20 deletions
+7
-20
libcaf_core/caf/abstract_uniform_type_info.hpp
libcaf_core/caf/abstract_uniform_type_info.hpp
+0
-4
libcaf_core/caf/uniform_type_info.hpp
libcaf_core/caf/uniform_type_info.hpp
+1
-4
libcaf_core/src/message.cpp
libcaf_core/src/message.cpp
+1
-1
libcaf_core/src/uniform_type_info_map.cpp
libcaf_core/src/uniform_type_info_map.cpp
+5
-11
No files found.
libcaf_core/caf/abstract_uniform_type_info.hpp
View file @
2a83c142
...
...
@@ -37,10 +37,6 @@ public:
return
name_
.
c_str
();
}
message
as_message
(
void
*
instance
)
const
override
{
return
make_message
(
deref
(
instance
));
}
bool
equal_to
(
const
std
::
type_info
&
tinfo
)
const
override
{
return
native_
==
&
tinfo
||
*
native_
==
tinfo
;
}
...
...
libcaf_core/caf/uniform_type_info.hpp
View file @
2a83c142
...
...
@@ -170,7 +170,7 @@ public:
/// Returns a vector with all known (announced) types.
static
std
::
vector
<
const
uniform_type_info
*>
instances
();
/// Creates a copy of `other`.
/// Creates a copy of `other`
or a new instance if `other == nullptr`
.
virtual
uniform_value
create
(
const
uniform_value
&
other
=
uniform_value
{})
const
=
0
;
...
...
@@ -209,9 +209,6 @@ public:
/// @pre `instance` has the type of `this`.
virtual
void
deserialize
(
void
*
instance
,
deserializer
*
source
)
const
=
0
;
/// Returns `instance` encapsulated as an `message`.
virtual
message
as_message
(
void
*
instance
)
const
=
0
;
/// Returns a unique number for builtin types or 0.
uint16_t
type_nr
()
const
{
return
type_nr_
;
...
...
libcaf_core/src/message.cpp
View file @
2a83c142
...
...
@@ -70,7 +70,7 @@ void message::deserialize(deserializer& source) {
auto
uval
=
uti
->
create
();
uti
->
deserialize
(
uval
->
val
,
&
source
);
source
.
end_object
();
*
this
=
uti
->
as_message
(
uval
->
val
);
*
this
=
*
reinterpret_cast
<
message
*>
(
uval
->
val
);
}
void
message
::
reset
(
raw_ptr
new_ptr
,
bool
add_ref
)
{
...
...
libcaf_core/src/uniform_type_info_map.cpp
View file @
2a83c142
...
...
@@ -382,10 +382,6 @@ public:
return
create_impl
<
T
>
(
other
);
}
message
as_message
(
void
*
instance
)
const
override
{
return
make_message
(
deref
(
instance
));
}
static
inline
const
T
&
deref
(
const
void
*
ptr
)
{
return
*
reinterpret_cast
<
const
T
*>
(
ptr
);
}
...
...
@@ -436,17 +432,14 @@ public:
const
char
*
name
()
const
override
{
return
static_name
();
}
message
as_message
(
void
*
instance
)
const
override
{
return
make_message
(
deref
(
instance
));
}
protected:
bool
equals
(
const
void
*
lhs
,
const
void
*
rhs
)
const
override
{
return
deref
(
lhs
)
==
deref
(
rhs
);
}
uniform_value
create
(
const
uniform_value
&
other
)
const
override
{
return
create_impl
<
T
>
(
other
);
}
private:
inline
static
const
T
&
deref
(
const
void
*
ptr
)
{
return
*
reinterpret_cast
<
const
T
*>
(
ptr
);
...
...
@@ -476,6 +469,7 @@ public:
}
}
}
uniform_value
create
(
const
uniform_value
&
other
)
const
override
{
auto
res
=
create_impl
<
message
>
(
other
);
if
(
!
other
)
{
...
...
@@ -486,12 +480,11 @@ public:
}
return
res
;
}
message
as_message
(
void
*
ptr
)
const
override
{
return
*
cast
(
ptr
);
}
const
char
*
name
()
const
override
{
return
name_
.
c_str
();
}
void
serialize
(
const
void
*
ptr
,
serializer
*
sink
)
const
override
{
auto
&
msg
=
*
cast
(
ptr
);
CAF_ASSERT
(
msg
.
size
()
==
elements_
.
size
());
...
...
@@ -499,6 +492,7 @@ public:
elements_
[
i
]
->
serialize
(
msg
.
at
(
i
),
sink
);
}
}
void
deserialize
(
void
*
ptr
,
deserializer
*
source
)
const
override
{
message_builder
mb
;
for
(
size_t
i
=
0
;
i
<
elements_
.
size
();
++
i
)
{
...
...
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