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
1191e362
Commit
1191e362
authored
Apr 04, 2016
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix conversion of scoped_actor on older compilers
parent
468fe088
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
28 deletions
+46
-28
libcaf_core/caf/actor.hpp
libcaf_core/caf/actor.hpp
+10
-5
libcaf_core/caf/channel.hpp
libcaf_core/caf/channel.hpp
+2
-0
libcaf_core/caf/detail/spawn_fwd.hpp
libcaf_core/caf/detail/spawn_fwd.hpp
+2
-3
libcaf_core/caf/scoped_actor.hpp
libcaf_core/caf/scoped_actor.hpp
+2
-16
libcaf_core/src/actor.cpp
libcaf_core/src/actor.cpp
+10
-0
libcaf_core/src/channel.cpp
libcaf_core/src/channel.cpp
+20
-4
No files found.
libcaf_core/caf/actor.hpp
View file @
1191e362
...
@@ -49,12 +49,15 @@ constexpr invalid_actor_t invalid_actor = invalid_actor_t{};
...
@@ -49,12 +49,15 @@ constexpr invalid_actor_t invalid_actor = invalid_actor_t{};
template
<
class
T
>
template
<
class
T
>
struct
is_convertible_to_actor
{
struct
is_convertible_to_actor
{
using
type
=
typename
std
::
remove_pointer
<
T
>::
type
;
static
constexpr
bool
value
=
static
constexpr
bool
value
=
!
std
::
is_base_of
<
statically_typed_actor_base
,
type
>::
value
!
std
::
is_base_of
<
statically_typed_actor_base
,
T
>::
value
&&
(
std
::
is_base_of
<
actor_proxy
,
type
>::
value
&&
(
std
::
is_base_of
<
actor_proxy
,
T
>::
value
||
std
::
is_base_of
<
local_actor
,
type
>::
value
||
std
::
is_base_of
<
local_actor
,
T
>::
value
);
||
std
::
is_same
<
scoped_actor
,
type
>::
value
);
};
template
<
>
struct
is_convertible_to_actor
<
scoped_actor
>
:
std
::
true_type
{
// nop
};
};
/// Identifies an untyped actor. Can be used with derived types
/// Identifies an untyped actor. Can be used with derived types
...
@@ -95,6 +98,7 @@ public:
...
@@ -95,6 +98,7 @@ public:
// nop
// nop
}
}
actor
(
const
scoped_actor
&
);
actor
(
const
invalid_actor_t
&
);
actor
(
const
invalid_actor_t
&
);
template
<
class
T
>
template
<
class
T
>
...
@@ -113,6 +117,7 @@ public:
...
@@ -113,6 +117,7 @@ public:
return
*
this
;
return
*
this
;
}
}
actor
&
operator
=
(
const
scoped_actor
&
x
);
actor
&
operator
=
(
const
invalid_actor_t
&
);
actor
&
operator
=
(
const
invalid_actor_t
&
);
/// Returns the address of the stored actor.
/// Returns the address of the stored actor.
...
...
libcaf_core/caf/channel.hpp
View file @
1191e362
...
@@ -59,6 +59,7 @@ public:
...
@@ -59,6 +59,7 @@ public:
channel
(
const
actor
&
);
channel
(
const
actor
&
);
channel
(
const
group
&
);
channel
(
const
group
&
);
channel
(
const
scoped_actor
&
);
channel
(
const
invalid_channel_t
&
);
channel
(
const
invalid_channel_t
&
);
template
<
class
T
>
template
<
class
T
>
...
@@ -75,6 +76,7 @@ public:
...
@@ -75,6 +76,7 @@ public:
channel
&
operator
=
(
const
actor
&
);
channel
&
operator
=
(
const
actor
&
);
channel
&
operator
=
(
const
group
&
);
channel
&
operator
=
(
const
group
&
);
channel
&
operator
=
(
const
scoped_actor
&
);
channel
&
operator
=
(
const
invalid_channel_t
&
);
channel
&
operator
=
(
const
invalid_channel_t
&
);
inline
explicit
operator
bool
()
const
noexcept
{
inline
explicit
operator
bool
()
const
noexcept
{
...
...
libcaf_core/caf/detail/spawn_fwd.hpp
View file @
1191e362
...
@@ -21,10 +21,9 @@
...
@@ -21,10 +21,9 @@
#define CAF_DETAIL_SPAWN_FWD_HPP
#define CAF_DETAIL_SPAWN_FWD_HPP
#include <functional>
#include <functional>
#include <type_traits>
#include "caf/fwd.hpp"
#include "caf/actor.hpp"
#include "caf/detail/type_traits.hpp"
namespace
caf
{
namespace
caf
{
namespace
detail
{
namespace
detail
{
...
...
libcaf_core/caf/scoped_actor.hpp
View file @
1191e362
...
@@ -20,10 +20,8 @@
...
@@ -20,10 +20,8 @@
#ifndef CAF_SCOPED_ACTOR_HPP
#ifndef CAF_SCOPED_ACTOR_HPP
#define CAF_SCOPED_ACTOR_HPP
#define CAF_SCOPED_ACTOR_HPP
#include "caf/actor.hpp"
#include "caf/actor_system.hpp"
#include "caf/channel.hpp"
#include "caf/intrusive_ptr.hpp"
#include "caf/behavior.hpp"
#include "caf/actor_cast.hpp"
#include "caf/blocking_actor.hpp"
#include "caf/blocking_actor.hpp"
#include "caf/scoped_execution_unit.hpp"
#include "caf/scoped_execution_unit.hpp"
...
@@ -53,18 +51,6 @@ public:
...
@@ -53,18 +51,6 @@ public:
return
self_
.
get
();
return
self_
.
get
();
}
}
inline
operator
channel
()
const
{
return
actor_cast
<
channel
>
(
self_
);
}
inline
operator
actor
()
const
{
return
actor_cast
<
actor
>
(
self_
);
}
inline
operator
actor_addr
()
const
{
return
self_
->
address
();
}
inline
actor_addr
address
()
const
{
inline
actor_addr
address
()
const
{
return
self_
->
address
();
return
self_
->
address
();
}
}
...
...
libcaf_core/src/actor.cpp
View file @
1191e362
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include "caf/actor_proxy.hpp"
#include "caf/actor_proxy.hpp"
#include "caf/local_actor.hpp"
#include "caf/local_actor.hpp"
#include "caf/deserializer.hpp"
#include "caf/deserializer.hpp"
#include "caf/scoped_actor.hpp"
#include "caf/blocking_actor.hpp"
#include "caf/blocking_actor.hpp"
#include "caf/event_based_actor.hpp"
#include "caf/event_based_actor.hpp"
...
@@ -36,6 +37,10 @@
...
@@ -36,6 +37,10 @@
namespace
caf
{
namespace
caf
{
actor
::
actor
(
const
scoped_actor
&
x
)
:
ptr_
(
x
.
get
())
{
// nop
}
actor
::
actor
(
const
invalid_actor_t
&
)
:
ptr_
(
nullptr
)
{
actor
::
actor
(
const
invalid_actor_t
&
)
:
ptr_
(
nullptr
)
{
// nop
// nop
}
}
...
@@ -48,6 +53,11 @@ actor::actor(abstract_actor* ptr, bool add_ref) : ptr_(ptr, add_ref) {
...
@@ -48,6 +53,11 @@ actor::actor(abstract_actor* ptr, bool add_ref) : ptr_(ptr, add_ref) {
// nop
// nop
}
}
actor
&
actor
::
operator
=
(
const
scoped_actor
&
x
)
{
ptr_
.
reset
(
x
.
get
());
return
*
this
;
}
actor
&
actor
::
operator
=
(
const
invalid_actor_t
&
)
{
actor
&
actor
::
operator
=
(
const
invalid_actor_t
&
)
{
ptr_
.
reset
();
ptr_
.
reset
();
return
*
this
;
return
*
this
;
...
...
libcaf_core/src/channel.cpp
View file @
1191e362
...
@@ -26,17 +26,28 @@
...
@@ -26,17 +26,28 @@
#include "caf/actor_cast.hpp"
#include "caf/actor_cast.hpp"
#include "caf/local_actor.hpp"
#include "caf/local_actor.hpp"
#include "caf/actor_system.hpp"
#include "caf/actor_system.hpp"
#include "caf/scoped_actor.hpp"
#include "caf/abstract_actor.hpp"
#include "caf/abstract_actor.hpp"
#include "caf/abstract_group.hpp"
#include "caf/abstract_group.hpp"
#include "caf/proxy_registry.hpp"
#include "caf/proxy_registry.hpp"
namespace
caf
{
namespace
caf
{
channel
::
channel
(
const
actor
&
x
)
:
ptr_
(
actor_cast
<
abstract_channel
*>
(
x
))
{
namespace
{
using
ch_pointer
=
abstract_channel
*
;
}
// namespace <anonymous>
channel
::
channel
(
const
actor
&
x
)
:
ptr_
(
actor_cast
<
ch_pointer
>
(
x
))
{
// nop
// nop
}
}
channel
::
channel
(
const
group
&
x
)
:
ptr_
(
actor_cast
<
abstract_channel
*>
(
x
))
{
channel
::
channel
(
const
group
&
x
)
:
ptr_
(
actor_cast
<
ch_pointer
>
(
x
))
{
// nop
}
channel
::
channel
(
const
scoped_actor
&
x
)
:
ptr_
(
actor_cast
<
ch_pointer
>
(
x
))
{
// nop
// nop
}
}
...
@@ -58,12 +69,17 @@ channel::channel(local_actor* ptr) : ptr_(ptr) {
...
@@ -58,12 +69,17 @@ channel::channel(local_actor* ptr) : ptr_(ptr) {
}
}
channel
&
channel
::
operator
=
(
const
actor
&
x
)
{
channel
&
channel
::
operator
=
(
const
actor
&
x
)
{
ptr_
.
reset
(
actor_cast
<
abstract_channel
*
>
(
x
));
ptr_
.
reset
(
actor_cast
<
ch_pointer
>
(
x
));
return
*
this
;
return
*
this
;
}
}
channel
&
channel
::
operator
=
(
const
group
&
x
)
{
channel
&
channel
::
operator
=
(
const
group
&
x
)
{
ptr_
.
reset
(
actor_cast
<
abstract_channel
*>
(
x
));
ptr_
.
reset
(
actor_cast
<
ch_pointer
>
(
x
));
return
*
this
;
}
channel
&
channel
::
operator
=
(
const
scoped_actor
&
x
)
{
ptr_
.
reset
(
actor_cast
<
ch_pointer
>
(
x
));
return
*
this
;
return
*
this
;
}
}
...
...
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