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
3935def8
Commit
3935def8
authored
Feb 16, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove dead code and coding style nitpicks
parent
99d78cb8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
55 deletions
+71
-55
libcaf_core/caf/detail/message_data.hpp
libcaf_core/caf/detail/message_data.hpp
+67
-31
libcaf_core/caf/detail/tuple_vals.hpp
libcaf_core/caf/detail/tuple_vals.hpp
+0
-8
libcaf_core/caf/match_expr.hpp
libcaf_core/caf/match_expr.hpp
+0
-8
libcaf_core/src/message_data.cpp
libcaf_core/src/message_data.cpp
+4
-8
No files found.
libcaf_core/caf/detail/message_data.hpp
View file @
3935def8
...
...
@@ -17,8 +17,8 @@
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#ifndef CAF_
ABSTRACT_TUPLE
_HPP
#define CAF_
ABSTRACT_TUPLE
_HPP
#ifndef CAF_
DETAIL_MESSAGE_DATA
_HPP
#define CAF_
DETAIL_MESSAGE_DATA
_HPP
#include <string>
#include <iterator>
...
...
@@ -37,57 +37,96 @@ namespace detail {
class
message_data
:
public
ref_counted
{
public:
// mutators
message_data
()
=
default
;
message_data
(
const
message_data
&
)
=
default
;
~
message_data
();
/****************************************************************************
* modifiers *
****************************************************************************/
virtual
void
*
mutable_at
(
size_t
pos
)
=
0
;
virtual
void
*
mutable_native_data
();
// accessors
/****************************************************************************
* observers *
****************************************************************************/
// computes "@<>+..." formatted type name
std
::
string
tuple_type_names
()
const
;
// compares each element using uniform_type_info objects
bool
equals
(
const
message_data
&
other
)
const
;
virtual
size_t
size
()
const
=
0
;
virtual
message_data
*
copy
()
const
=
0
;
virtual
const
void
*
at
(
size_t
pos
)
const
=
0
;
std
::
string
tuple_type_names
()
const
;
/**
* Tries to match element at position `pos` to given RTTI.
* @param pos Index of element in question.
* @param typenr Number of queried type or `0` for custom types.
* @param rtti Queried type or `nullptr` for builtin types.
*/
// Tries to match element at position `pos` to given RTTI.
virtual
bool
match_element
(
size_t
pos
,
uint16_t
typenr
,
const
std
::
type_info
*
rtti
)
const
=
0
;
virtual
uint32_t
type_token
()
const
=
0
;
// returns either tdata<...> object or nullptr (default) if tuple
// is not a 'native' implementation
virtual
const
void
*
native_data
()
const
;
virtual
const
char
*
uniform_name_at
(
size_t
pos
)
const
=
0
;
virtual
uint16_t
type_nr_at
(
size_t
pos
)
const
=
0
;
bool
equals
(
const
message_data
&
other
)
const
;
/****************************************************************************
* nested types *
****************************************************************************/
class
ptr
{
public:
ptr
()
=
default
;
ptr
(
ptr
&&
)
=
default
;
ptr
(
const
ptr
&
)
=
default
;
ptr
&
operator
=
(
ptr
&&
)
=
default
;
ptr
&
operator
=
(
const
ptr
&
)
=
default
;
inline
explicit
ptr
(
message_data
*
p
)
:
m_ptr
(
p
)
{}
inline
explicit
ptr
(
message_data
*
p
)
:
m_ptr
(
p
)
{
// nop
}
/**************************************************************************
* modifiers *
**************************************************************************/
inline
void
swap
(
ptr
&
other
)
{
m_ptr
.
swap
(
other
.
m_ptr
);
}
inline
void
detach
()
{
static_cast
<
void
>
(
get_detached
());
}
inline
void
reset
(
message_data
*
p
=
nullptr
,
bool
add_ref
=
true
)
{
m_ptr
.
reset
(
p
,
add_ref
);
}
inline
message_data
*
operator
->
()
{
return
get_detached
();
}
inline
message_data
&
operator
*
()
{
return
*
get_detached
();
}
inline
const
message_data
*
operator
->
()
const
{
return
m_ptr
.
get
();
}
inline
const
message_data
&
operator
*
()
const
{
return
*
m_ptr
.
get
();
}
inline
void
swap
(
ptr
&
other
)
{
m_ptr
.
swap
(
other
.
m_ptr
);
}
inline
void
reset
(
message_data
*
p
=
nullptr
)
{
m_ptr
.
reset
(
p
);
}
inline
message_data
*
release
()
{
return
m_ptr
.
release
();
}
inline
void
detach
()
{
static_cast
<
void
>
(
get_detached
());
}
inline
message_data
*
operator
->
()
{
return
get_detached
();
}
inline
message_data
&
operator
*
()
{
return
*
get_detached
();
}
/**************************************************************************
* observers *
**************************************************************************/
inline
const
message_data
*
operator
->
()
const
{
return
m_ptr
.
get
();
}
inline
const
message_data
&
operator
*
()
const
{
return
*
m_ptr
.
get
();
}
inline
explicit
operator
bool
()
const
{
return
static_cast
<
bool
>
(
m_ptr
);
...
...
@@ -98,15 +137,12 @@ class message_data : public ref_counted {
}
private:
message_data
*
get_detached
();
intrusive_ptr
<
message_data
>
m_ptr
;
};
};
}
// namespace detail
}
// namespace caf
#endif // CAF_
ABSTRACT_TUPLE
_HPP
#endif // CAF_
DETAIL_MESSAGE_DATA
_HPP
libcaf_core/caf/detail/tuple_vals.hpp
View file @
3935def8
...
...
@@ -86,14 +86,6 @@ class tuple_vals : public message_data {
// nop
}
const
void
*
native_data
()
const
override
{
return
&
m_data
;
}
void
*
mutable_native_data
()
override
{
return
&
m_data
;
}
data_type
&
data
()
{
return
m_data
;
}
...
...
libcaf_core/caf/match_expr.hpp
View file @
3935def8
...
...
@@ -249,14 +249,6 @@ inline void detach_if_needed(const message&, std::false_type) {
// nop
}
inline
void
*
fetch_native_data
(
message
&
msg
,
std
::
true_type
)
{
return
msg
.
empty
()
?
nullptr
:
msg
.
vals
()
->
mutable_native_data
();
}
inline
const
void
*
fetch_native_data
(
const
message
&
msg
,
std
::
false_type
)
{
return
msg
.
empty
()
?
nullptr
:
msg
.
vals
()
->
native_data
();
}
template
<
class
T
>
struct
is_manipulator_case
{
// static constexpr bool value = T::second_type::manipulates_args;
...
...
libcaf_core/src/message_data.cpp
View file @
3935def8
...
...
@@ -24,6 +24,10 @@
namespace
caf
{
namespace
detail
{
message_data
::~
message_data
()
{
// nop
}
bool
message_data
::
equals
(
const
message_data
&
other
)
const
{
if
(
this
==
&
other
)
{
return
true
;
...
...
@@ -52,14 +56,6 @@ bool message_data::equals(const message_data& other) const {
return
true
;
}
const
void
*
message_data
::
native_data
()
const
{
return
nullptr
;
}
void
*
message_data
::
mutable_native_data
()
{
return
nullptr
;
}
std
::
string
message_data
::
tuple_type_names
()
const
{
std
::
string
result
=
"@<>"
;
for
(
size_t
i
=
0
;
i
<
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