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
9abec963
Commit
9abec963
authored
Oct 21, 2014
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove obsolete class detail::tuple_dummy
parent
e5a74850
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
80 deletions
+18
-80
libcaf_core/caf/detail/tuple_dummy.hpp
libcaf_core/caf/detail/tuple_dummy.hpp
+0
-55
libcaf_core/caf/match_expr.hpp
libcaf_core/caf/match_expr.hpp
+8
-19
libcaf_core/caf/message.hpp
libcaf_core/caf/message.hpp
+2
-6
libcaf_core/src/message.cpp
libcaf_core/src/message.cpp
+8
-0
No files found.
libcaf_core/caf/detail/tuple_dummy.hpp
deleted
100644 → 0
View file @
e5a74850
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ Actor *
* | |___ / ___ \| _| Framework *
* \____/_/ \_|_| *
* *
* Copyright (C) 2011 - 2014 *
* Dominik Charousset <dominik.charousset (at) haw-hamburg.de> *
* *
* Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software *
* License 1.0. See accompanying files LICENSE and LICENCE_ALTERNATIVE. *
* *
* If you did not receive a copy of the license files, see *
* http://opensource.org/licenses/BSD-3-Clause and *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#ifndef CAF_DETAIL_TUPLE_DUMMY_HPP
#define CAF_DETAIL_TUPLE_DUMMY_HPP
#include "caf/fwd.hpp"
#include "caf/detail/type_list.hpp"
#include "caf/detail/message_iterator.hpp"
namespace
caf
{
namespace
detail
{
struct
tuple_dummy
{
using
types
=
detail
::
empty_type_list
;
using
const_iterator
=
message_iterator
<
tuple_dummy
>
;
inline
size_t
size
()
const
{
return
0
;
}
inline
void
*
mutable_at
(
size_t
)
{
return
nullptr
;
}
inline
const
void
*
at
(
size_t
)
const
{
return
nullptr
;
}
inline
const
uniform_type_info
*
type_at
(
size_t
)
const
{
return
nullptr
;
}
inline
const
std
::
type_info
*
type_token
()
const
{
return
&
typeid
(
detail
::
empty_type_list
);
}
inline
bool
dynamically_typed
()
const
{
return
false
;
}
inline
const_iterator
begin
()
const
{
return
{
this
};
}
inline
const_iterator
end
()
const
{
return
{
this
,
0
};
}
};
}
// namespace detail
}
// namespace caf
#endif // CAF_DETAIL_TUPLE_DUMMY_HPP
libcaf_core/caf/match_expr.hpp
View file @
9abec963
...
...
@@ -37,7 +37,6 @@
#include "caf/detail/matches.hpp"
#include "caf/detail/type_list.hpp"
#include "caf/detail/lifted_fun.hpp"
#include "caf/detail/tuple_dummy.hpp"
#include "caf/detail/pseudo_tuple.hpp"
#include "caf/detail/behavior_impl.hpp"
...
...
@@ -547,14 +546,12 @@ inline const message& detach_if_needed(const message& tup, std::false_type) {
return
tup
;
}
template
<
class
Ptr
>
void
*
fetch_native_data
(
Ptr
&
ptr
,
std
::
true_type
)
{
return
ptr
->
mutable_native_data
();
inline
void
*
fetch_native_data
(
message
&
msg
,
std
::
true_type
)
{
return
msg
.
empty
()
?
nullptr
:
msg
.
vals
()
->
mutable_native_data
();
}
template
<
class
Ptr
>
const
void
*
fetch_native_data
(
const
Ptr
&
ptr
,
std
::
false_type
)
{
return
ptr
->
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
>
...
...
@@ -723,23 +720,15 @@ class match_expr {
template
<
class
Tuple
>
result_type
apply
(
Tuple
&
tup
)
{
idx_token_type
idx_token
;
if
(
tup
.
empty
())
{
detail
::
tuple_dummy
td
;
auto
td_token_ptr
=
td
.
type_token
();
auto
td_bitmask
=
get_cache_entry
(
td_token_ptr
,
td
);
return
detail
::
unroll_expr
<
result_type
>
(
m_cases
,
td_bitmask
,
idx_token
,
*
td_token_ptr
,
false
,
static_cast
<
void
*>
(
nullptr
),
td
);
}
std
::
integral_constant
<
bool
,
has_manipulator
>
mutator_token
;
// returns either a reference or a new object
using
detached
=
decltype
(
detail
::
detach_if_needed
(
tup
,
mutator_token
));
detached
tref
=
detail
::
detach_if_needed
(
tup
,
mutator_token
);
auto
&
vals
=
tref
.
vals
();
auto
ndp
=
fetch_native_data
(
vals
,
mutator_token
);
auto
token_ptr
=
vals
->
type_token
();
auto
bitmask
=
get_cache_entry
(
token_ptr
,
*
vals
);
auto
dynamically_typed
=
vals
->
dynamically_typed
();
auto
ndp
=
detail
::
fetch_native_data
(
tref
,
mutator_token
);
auto
token_ptr
=
tref
.
type_token
();
auto
bitmask
=
get_cache_entry
(
token_ptr
,
tref
);
auto
dynamically_typed
=
tref
.
dynamically_typed
();
return
detail
::
unroll_expr
<
result_type
>
(
m_cases
,
bitmask
,
idx_token
,
*
token_ptr
,
dynamically_typed
,
ndp
,
*
vals
);
...
...
libcaf_core/caf/message.hpp
View file @
9abec963
...
...
@@ -220,17 +220,13 @@ class message {
* The type token `&typeid(void)` indicates that this tuple is dynamically
* typed, i.e., the types where not available at compile time.
*/
inline
const
std
::
type_info
*
type_token
()
const
{
return
m_vals
->
type_token
();
}
const
std
::
type_info
*
type_token
()
const
;
/**
* Checks whether this tuple is dynamically typed, i.e.,
* its types were not known at compile time.
*/
inline
bool
dynamically_typed
()
const
{
return
m_vals
->
dynamically_typed
();
}
bool
dynamically_typed
()
const
;
/**
* Applies @p handler to this message and returns the result
...
...
libcaf_core/src/message.cpp
View file @
9abec963
...
...
@@ -95,4 +95,12 @@ optional<message> message::apply(message_handler handler) {
return
handler
(
*
this
);
}
const
std
::
type_info
*
message
::
type_token
()
const
{
return
m_vals
?
m_vals
->
type_token
()
:
&
typeid
(
detail
::
empty_type_list
);
}
bool
message
::
dynamically_typed
()
const
{
return
m_vals
?
m_vals
->
dynamically_typed
()
:
false
;
}
}
// namespace caf
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