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
e94c2c79
Commit
e94c2c79
authored
Jan 23, 2014
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common_actor_ops -> untyped_actor_handle
parent
de326fd9
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
30 deletions
+31
-30
CMakeLists.txt
CMakeLists.txt
+1
-1
cppa.files
cppa.files
+2
-2
cppa/actor.hpp
cppa/actor.hpp
+11
-10
cppa/actor_addr.hpp
cppa/actor_addr.hpp
+5
-5
cppa/untyped_actor_handle.hpp
cppa/untyped_actor_handle.hpp
+6
-6
src/actor.cpp
src/actor.cpp
+1
-1
src/untyped_actor_handle.cpp
src/untyped_actor_handle.cpp
+5
-5
No files found.
CMakeLists.txt
View file @
e94c2c79
...
@@ -149,7 +149,6 @@ set(LIBCPPA_SRC
...
@@ -149,7 +149,6 @@ set(LIBCPPA_SRC
src/buffer.cpp
src/buffer.cpp
src/blocking_untyped_actor.cpp
src/blocking_untyped_actor.cpp
src/channel.cpp
src/channel.cpp
src/common_actor_ops.cpp
src/context_switching_resume.cpp
src/context_switching_resume.cpp
src/continuable.cpp
src/continuable.cpp
src/decorated_tuple.cpp
src/decorated_tuple.cpp
...
@@ -206,6 +205,7 @@ set(LIBCPPA_SRC
...
@@ -206,6 +205,7 @@ set(LIBCPPA_SRC
src/unicast_network.cpp
src/unicast_network.cpp
src/uniform_type_info.cpp
src/uniform_type_info.cpp
src/uniform_type_info_map.cpp
src/uniform_type_info_map.cpp
src/untyped_actor_handle.cpp
src/untyped_actor.cpp
src/untyped_actor.cpp
src/weak_ptr_anchor.cpp
src/weak_ptr_anchor.cpp
src/yield_interface.cpp
)
src/yield_interface.cpp
)
...
...
cppa.files
View file @
e94c2c79
...
@@ -15,7 +15,7 @@ cppa/binary_deserializer.hpp
...
@@ -15,7 +15,7 @@ cppa/binary_deserializer.hpp
cppa/binary_serializer.hpp
cppa/binary_serializer.hpp
cppa/blocking_untyped_actor.hpp
cppa/blocking_untyped_actor.hpp
cppa/channel.hpp
cppa/channel.hpp
cppa/
common_actor_ops
.hpp
cppa/
untyped_actor_handle
.hpp
cppa/config.hpp
cppa/config.hpp
cppa/policy/context_switching_resume.hpp
cppa/policy/context_switching_resume.hpp
cppa/cow_ptr.hpp
cppa/cow_ptr.hpp
...
@@ -228,7 +228,7 @@ src/binary_serializer.cpp
...
@@ -228,7 +228,7 @@ src/binary_serializer.cpp
src/broker.cpp
src/broker.cpp
src/buffer.cpp
src/buffer.cpp
src/channel.cpp
src/channel.cpp
src/
common_actor_ops
.cpp
src/
untyped_actor_handle
.cpp
src/context_switching_resume.cpp
src/context_switching_resume.cpp
src/continuable.cpp
src/continuable.cpp
src/decorated_tuple.cpp
src/decorated_tuple.cpp
...
...
cppa/actor.hpp
View file @
e94c2c79
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
#include "cppa/intrusive_ptr.hpp"
#include "cppa/intrusive_ptr.hpp"
#include "cppa/abstract_actor.hpp"
#include "cppa/abstract_actor.hpp"
#include "cppa/
common_actor_ops
.hpp"
#include "cppa/
untyped_actor_handle
.hpp"
#include "cppa/util/comparable.hpp"
#include "cppa/util/comparable.hpp"
#include "cppa/util/type_traits.hpp"
#include "cppa/util/type_traits.hpp"
...
@@ -69,22 +69,23 @@ class actor : util::comparable<actor> {
...
@@ -69,22 +69,23 @@ class actor : util::comparable<actor> {
public:
public:
// common_actor_ops does not provide a virtual destructor -> no new members
// untyped_actor_handle does not provide a virtual destructor
class
ops
:
public
common_actor_ops
{
// -> no new members
class
handle
:
public
untyped_actor_handle
{
friend
class
actor
;
friend
class
actor
;
typedef
common_actor_ops
super
;
typedef
untyped_actor_handle
super
;
public:
public:
ops
()
=
default
;
handle
()
=
default
;
void
enqueue
(
const
message_header
&
hdr
,
any_tuple
msg
)
const
;
void
enqueue
(
const
message_header
&
hdr
,
any_tuple
msg
)
const
;
private:
private:
inline
ops
(
abstract_actor_ptr
ptr
)
:
super
(
std
::
move
(
ptr
))
{
}
inline
handle
(
abstract_actor_ptr
ptr
)
:
super
(
std
::
move
(
ptr
))
{
}
};
};
...
@@ -114,11 +115,11 @@ class actor : util::comparable<actor> {
...
@@ -114,11 +115,11 @@ class actor : util::comparable<actor> {
inline
bool
operator
!
()
const
;
inline
bool
operator
!
()
const
;
inline
ops
*
operator
->
()
const
{
inline
const
handle
*
operator
->
()
const
{
// this const cast is safe, because
common_actor_ops
cannot be
// this const cast is safe, because
untyped_actor_handle
cannot be
// modified anyways and the offered operations are intended to
// modified anyways and the offered operations are intended to
// be called on const elements
// be called on const elements
return
const_cast
<
ops
*>
(
&
m_ops
)
;
return
&
m_ops
;
}
}
intptr_t
compare
(
const
actor
&
other
)
const
;
intptr_t
compare
(
const
actor
&
other
)
const
;
...
@@ -127,7 +128,7 @@ class actor : util::comparable<actor> {
...
@@ -127,7 +128,7 @@ class actor : util::comparable<actor> {
actor
(
abstract_actor
*
);
actor
(
abstract_actor
*
);
ops
m_ops
;
handle
m_ops
;
};
};
...
...
cppa/actor_addr.hpp
View file @
e94c2c79
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
#include "cppa/intrusive_ptr.hpp"
#include "cppa/intrusive_ptr.hpp"
#include "cppa/abstract_actor.hpp"
#include "cppa/abstract_actor.hpp"
#include "cppa/
common_actor_ops
.hpp"
#include "cppa/
untyped_actor_handle
.hpp"
#include "cppa/util/comparable.hpp"
#include "cppa/util/comparable.hpp"
...
@@ -90,18 +90,18 @@ class actor_addr : util::comparable<actor_addr>
...
@@ -90,18 +90,18 @@ class actor_addr : util::comparable<actor_addr>
return
compare
(
other
.
get
());
return
compare
(
other
.
get
());
}
}
inline
common_actor_ops
*
operator
->
()
const
{
inline
untyped_actor_handle
*
operator
->
()
const
{
// this const cast is safe, because
common_actor_ops
cannot be
// this const cast is safe, because
untyped_actor_handle
cannot be
// modified anyways and the offered operations are intended to
// modified anyways and the offered operations are intended to
// be called on const elements
// be called on const elements
return
const_cast
<
common_actor_ops
*>
(
&
m_ops
);
return
const_cast
<
untyped_actor_handle
*>
(
&
m_ops
);
}
}
private:
private:
explicit
actor_addr
(
abstract_actor
*
);
explicit
actor_addr
(
abstract_actor
*
);
common_actor_ops
m_ops
;
untyped_actor_handle
m_ops
;
};
};
...
...
cppa/
common_actor_ops
.hpp
→
cppa/
untyped_actor_handle
.hpp
View file @
e94c2c79
...
@@ -43,7 +43,7 @@ namespace detail { class raw_access; }
...
@@ -43,7 +43,7 @@ namespace detail { class raw_access; }
* @brief Encapsulates actor operations that are valid for both {@link actor}
* @brief Encapsulates actor operations that are valid for both {@link actor}
* and {@link actor_addr} handles.
* and {@link actor_addr} handles.
*/
*/
class
common_actor_ops
{
class
untyped_actor_handle
{
friend
class
actor
;
friend
class
actor
;
friend
class
actor_addr
;
friend
class
actor_addr
;
...
@@ -51,7 +51,7 @@ class common_actor_ops {
...
@@ -51,7 +51,7 @@ class common_actor_ops {
public:
public:
common_actor_ops
()
=
default
;
untyped_actor_handle
()
=
default
;
inline
bool
attach
(
attachable_ptr
ptr
);
inline
bool
attach
(
attachable_ptr
ptr
);
...
@@ -83,7 +83,7 @@ class common_actor_ops {
...
@@ -83,7 +83,7 @@ class common_actor_ops {
protected:
protected:
inline
common_actor_ops
(
abstract_actor_ptr
ptr
)
:
m_ptr
(
std
::
move
(
ptr
))
{
}
inline
untyped_actor_handle
(
abstract_actor_ptr
ptr
)
:
m_ptr
(
std
::
move
(
ptr
))
{
}
abstract_actor_ptr
m_ptr
;
abstract_actor_ptr
m_ptr
;
...
@@ -104,17 +104,17 @@ struct functor_attachable : attachable {
...
@@ -104,17 +104,17 @@ struct functor_attachable : attachable {
};
};
template
<
typename
F
>
template
<
typename
F
>
bool
common_actor_ops
::
attach_functor
(
F
&&
f
)
{
bool
untyped_actor_handle
::
attach_functor
(
F
&&
f
)
{
typedef
typename
util
::
rm_const_and_ref
<
F
>::
type
f_type
;
typedef
typename
util
::
rm_const_and_ref
<
F
>::
type
f_type
;
typedef
functor_attachable
<
f_type
>
impl
;
typedef
functor_attachable
<
f_type
>
impl
;
return
attach
(
attachable_ptr
{
new
impl
(
std
::
forward
<
F
>
(
f
))});
return
attach
(
attachable_ptr
{
new
impl
(
std
::
forward
<
F
>
(
f
))});
}
}
inline
actor_id
common_actor_ops
::
id
()
const
{
inline
actor_id
untyped_actor_handle
::
id
()
const
{
return
(
m_ptr
)
?
m_ptr
->
id
()
:
0
;
return
(
m_ptr
)
?
m_ptr
->
id
()
:
0
;
}
}
inline
bool
common_actor_ops
::
attach
(
attachable_ptr
ptr
)
{
inline
bool
untyped_actor_handle
::
attach
(
attachable_ptr
ptr
)
{
return
m_ptr
?
m_ptr
->
attach
(
std
::
move
(
ptr
))
:
false
;
return
m_ptr
?
m_ptr
->
attach
(
std
::
move
(
ptr
))
:
false
;
}
}
...
...
src/actor.cpp
View file @
e94c2c79
...
@@ -52,7 +52,7 @@ actor::actor(abstract_actor* ptr) : m_ops(ptr) { }
...
@@ -52,7 +52,7 @@ actor::actor(abstract_actor* ptr) : m_ops(ptr) { }
actor
::
actor
(
const
invalid_actor_t
&
)
:
m_ops
(
nullptr
)
{
}
actor
::
actor
(
const
invalid_actor_t
&
)
:
m_ops
(
nullptr
)
{
}
void
actor
::
ops
::
enqueue
(
const
message_header
&
hdr
,
any_tuple
msg
)
const
{
void
actor
::
handle
::
enqueue
(
const
message_header
&
hdr
,
any_tuple
msg
)
const
{
if
(
m_ptr
)
m_ptr
->
enqueue
(
hdr
,
std
::
move
(
msg
));
if
(
m_ptr
)
m_ptr
->
enqueue
(
hdr
,
std
::
move
(
msg
));
}
}
...
...
src/
common_actor_ops
.cpp
→
src/
untyped_actor_handle
.cpp
View file @
e94c2c79
...
@@ -29,19 +29,19 @@
...
@@ -29,19 +29,19 @@
#include "cppa/actor_addr.hpp"
#include "cppa/actor_addr.hpp"
#include "cppa/
common_actor_ops
.hpp"
#include "cppa/
untyped_actor_handle
.hpp"
namespace
cppa
{
namespace
cppa
{
actor_addr
common_actor_ops
::
address
()
const
{
actor_addr
untyped_actor_handle
::
address
()
const
{
return
m_ptr
?
m_ptr
->
address
()
:
actor_addr
{};
return
m_ptr
?
m_ptr
->
address
()
:
actor_addr
{};
}
}
const
node_id
&
common_actor_ops
::
node
()
const
{
const
node_id
&
untyped_actor_handle
::
node
()
const
{
return
m_ptr
?
m_ptr
->
node
()
:
*
node_id
::
get
();
return
m_ptr
?
m_ptr
->
node
()
:
*
node_id
::
get
();
}
}
bool
common_actor_ops
::
is_remote
()
const
{
bool
untyped_actor_handle
::
is_remote
()
const
{
return
m_ptr
?
m_ptr
->
is_proxy
()
:
false
;
return
m_ptr
?
m_ptr
->
is_proxy
()
:
false
;
}
}
...
...
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