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
5b69972e
Commit
5b69972e
authored
Jun 15, 2012
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
maintenance & documentation
parent
f5767cc0
Changes
184
Show whitespace changes
Inline
Side-by-side
Showing
184 changed files
with
1054 additions
and
1334 deletions
+1054
-1334
CMakeLists.txt
CMakeLists.txt
+2
-3
benchmarks/actor_creation.cpp
benchmarks/actor_creation.cpp
+2
-2
benchmarks/distributed.cpp
benchmarks/distributed.cpp
+2
-2
benchmarks/mailbox_performance.cpp
benchmarks/mailbox_performance.cpp
+1
-1
benchmarks/mixed_case.cpp
benchmarks/mixed_case.cpp
+6
-6
cppa.files
cppa.files
+4
-7
cppa/abstract_actor.hpp
cppa/abstract_actor.hpp
+3
-3
cppa/abstract_event_based_actor.hpp
cppa/abstract_event_based_actor.hpp
+4
-4
cppa/actor.hpp
cppa/actor.hpp
+3
-3
cppa/actor_proxy.hpp
cppa/actor_proxy.hpp
+5
-4
cppa/announce.hpp
cppa/announce.hpp
+3
-3
cppa/any_tuple.hpp
cppa/any_tuple.hpp
+3
-3
cppa/anything.hpp
cppa/anything.hpp
+3
-3
cppa/atom.hpp
cppa/atom.hpp
+3
-3
cppa/attachable.hpp
cppa/attachable.hpp
+3
-3
cppa/behavior.hpp
cppa/behavior.hpp
+3
-3
cppa/binary_deserializer.hpp
cppa/binary_deserializer.hpp
+3
-3
cppa/binary_serializer.hpp
cppa/binary_serializer.hpp
+3
-3
cppa/channel.hpp
cppa/channel.hpp
+3
-3
cppa/context_switching_actor.hpp
cppa/context_switching_actor.hpp
+44
-22
cppa/cow_ptr.hpp
cppa/cow_ptr.hpp
+59
-47
cppa/cow_tuple.hpp
cppa/cow_tuple.hpp
+3
-3
cppa/cppa.hpp
cppa/cppa.hpp
+14
-6
cppa/deserializer.hpp
cppa/deserializer.hpp
+3
-3
cppa/detail/abstract_scheduled_actor.hpp
cppa/detail/abstract_scheduled_actor.hpp
+3
-3
cppa/detail/abstract_tuple.hpp
cppa/detail/abstract_tuple.hpp
+3
-3
cppa/detail/actor_count.hpp
cppa/detail/actor_count.hpp
+3
-3
cppa/detail/actor_proxy_cache.hpp
cppa/detail/actor_proxy_cache.hpp
+3
-3
cppa/detail/actor_registry.hpp
cppa/detail/actor_registry.hpp
+3
-3
cppa/detail/addressed_message.hpp
cppa/detail/addressed_message.hpp
+3
-3
cppa/detail/atom_val.hpp
cppa/detail/atom_val.hpp
+3
-3
cppa/detail/boxed.hpp
cppa/detail/boxed.hpp
+3
-3
cppa/detail/buffer.hpp
cppa/detail/buffer.hpp
+3
-3
cppa/detail/channel.hpp
cppa/detail/channel.hpp
+4
-4
cppa/detail/container_tuple_view.hpp
cppa/detail/container_tuple_view.hpp
+3
-3
cppa/detail/decorated_tuple.hpp
cppa/detail/decorated_tuple.hpp
+3
-3
cppa/detail/default_uniform_type_info_impl.hpp
cppa/detail/default_uniform_type_info_impl.hpp
+3
-3
cppa/detail/demangle.hpp
cppa/detail/demangle.hpp
+3
-3
cppa/detail/disablable_delete.hpp
cppa/detail/disablable_delete.hpp
+3
-3
cppa/detail/empty_tuple.hpp
cppa/detail/empty_tuple.hpp
+3
-3
cppa/detail/filter_result.hpp
cppa/detail/filter_result.hpp
+3
-3
cppa/detail/get_behavior.hpp
cppa/detail/get_behavior.hpp
+3
-3
cppa/detail/group_manager.hpp
cppa/detail/group_manager.hpp
+3
-3
cppa/detail/implicit_conversions.hpp
cppa/detail/implicit_conversions.hpp
+3
-3
cppa/detail/invokable.hpp
cppa/detail/invokable.hpp
+0
-282
cppa/detail/list_member.hpp
cppa/detail/list_member.hpp
+3
-3
cppa/detail/mailman.hpp
cppa/detail/mailman.hpp
+3
-3
cppa/detail/map_member.hpp
cppa/detail/map_member.hpp
+3
-3
cppa/detail/matches.hpp
cppa/detail/matches.hpp
+3
-3
cppa/detail/mock_scheduler.hpp
cppa/detail/mock_scheduler.hpp
+3
-3
cppa/detail/native_socket.hpp
cppa/detail/native_socket.hpp
+3
-3
cppa/detail/nestable_receive_policy.hpp
cppa/detail/nestable_receive_policy.hpp
+3
-3
cppa/detail/network_manager.hpp
cppa/detail/network_manager.hpp
+3
-3
cppa/detail/object_array.hpp
cppa/detail/object_array.hpp
+3
-3
cppa/detail/object_impl.hpp
cppa/detail/object_impl.hpp
+16
-16
cppa/detail/pair_member.hpp
cppa/detail/pair_member.hpp
+3
-3
cppa/detail/post_office.hpp
cppa/detail/post_office.hpp
+3
-3
cppa/detail/primitive_member.hpp
cppa/detail/primitive_member.hpp
+3
-3
cppa/detail/projection.hpp
cppa/detail/projection.hpp
+3
-3
cppa/detail/pseudo_tuple.hpp
cppa/detail/pseudo_tuple.hpp
+3
-3
cppa/detail/ptype_to_type.hpp
cppa/detail/ptype_to_type.hpp
+3
-3
cppa/detail/receive_loop_helper.hpp
cppa/detail/receive_loop_helper.hpp
+3
-6
cppa/detail/recursive_queue_node.hpp
cppa/detail/recursive_queue_node.hpp
+3
-3
cppa/detail/ref_counted_impl.hpp
cppa/detail/ref_counted_impl.hpp
+3
-3
cppa/detail/scheduled_actor_dummy.hpp
cppa/detail/scheduled_actor_dummy.hpp
+4
-4
cppa/detail/serialize_tuple.hpp
cppa/detail/serialize_tuple.hpp
+3
-3
cppa/detail/singleton_manager.hpp
cppa/detail/singleton_manager.hpp
+3
-3
cppa/detail/swap_bytes.hpp
cppa/detail/swap_bytes.hpp
+3
-3
cppa/detail/tdata.hpp
cppa/detail/tdata.hpp
+3
-3
cppa/detail/thread_pool_scheduler.hpp
cppa/detail/thread_pool_scheduler.hpp
+3
-3
cppa/detail/to_uniform_name.hpp
cppa/detail/to_uniform_name.hpp
+3
-3
cppa/detail/tuple_cast_impl.hpp
cppa/detail/tuple_cast_impl.hpp
+3
-3
cppa/detail/tuple_iterator.hpp
cppa/detail/tuple_iterator.hpp
+3
-3
cppa/detail/tuple_vals.hpp
cppa/detail/tuple_vals.hpp
+3
-3
cppa/detail/tuple_view.hpp
cppa/detail/tuple_view.hpp
+3
-3
cppa/detail/type_to_ptype.hpp
cppa/detail/type_to_ptype.hpp
+3
-3
cppa/detail/types_array.hpp
cppa/detail/types_array.hpp
+33
-3
cppa/detail/unboxed.hpp
cppa/detail/unboxed.hpp
+3
-3
cppa/detail/uniform_type_info_map.hpp
cppa/detail/uniform_type_info_map.hpp
+3
-3
cppa/detail/value_guard.hpp
cppa/detail/value_guard.hpp
+3
-3
cppa/detail/yield_interface.hpp
cppa/detail/yield_interface.hpp
+3
-3
cppa/either.hpp
cppa/either.hpp
+3
-3
cppa/event_based_actor.hpp
cppa/event_based_actor.hpp
+31
-4
cppa/event_based_actor_base.hpp
cppa/event_based_actor_base.hpp
+3
-3
cppa/exception.hpp
cppa/exception.hpp
+3
-3
cppa/exit_reason.hpp
cppa/exit_reason.hpp
+3
-3
cppa/from_string.hpp
cppa/from_string.hpp
+3
-3
cppa/fsm_actor.hpp
cppa/fsm_actor.hpp
+3
-3
cppa/get.hpp
cppa/get.hpp
+3
-3
cppa/group.hpp
cppa/group.hpp
+3
-3
cppa/guard_expr.hpp
cppa/guard_expr.hpp
+3
-3
cppa/intrusive/forward_iterator.hpp
cppa/intrusive/forward_iterator.hpp
+7
-7
cppa/intrusive/single_reader_queue.hpp
cppa/intrusive/single_reader_queue.hpp
+3
-3
cppa/intrusive/singly_linked_list.hpp
cppa/intrusive/singly_linked_list.hpp
+3
-3
cppa/intrusive_ptr.hpp
cppa/intrusive_ptr.hpp
+45
-95
cppa/local_actor.hpp
cppa/local_actor.hpp
+86
-54
cppa/match.hpp
cppa/match.hpp
+3
-3
cppa/match_expr.hpp
cppa/match_expr.hpp
+4
-3
cppa/object.hpp
cppa/object.hpp
+3
-3
cppa/on.hpp
cppa/on.hpp
+3
-4
cppa/option.hpp
cppa/option.hpp
+3
-3
cppa/partial_function.hpp
cppa/partial_function.hpp
+3
-4
cppa/pattern.hpp
cppa/pattern.hpp
+3
-3
cppa/primitive_type.hpp
cppa/primitive_type.hpp
+3
-3
cppa/primitive_variant.hpp
cppa/primitive_variant.hpp
+12
-58
cppa/process_information.hpp
cppa/process_information.hpp
+3
-3
cppa/receive.hpp
cppa/receive.hpp
+3
-3
cppa/ref_counted.hpp
cppa/ref_counted.hpp
+3
-3
cppa/scheduled_actor.hpp
cppa/scheduled_actor.hpp
+16
-15
cppa/scheduler.hpp
cppa/scheduler.hpp
+3
-9
cppa/scheduling_hint.hpp
cppa/scheduling_hint.hpp
+3
-3
cppa/self.hpp
cppa/self.hpp
+3
-3
cppa/serializer.hpp
cppa/serializer.hpp
+3
-3
cppa/stacked_event_based_actor.hpp
cppa/stacked_event_based_actor.hpp
+20
-11
cppa/thread_mapped_actor.hpp
cppa/thread_mapped_actor.hpp
+26
-15
cppa/to_string.hpp
cppa/to_string.hpp
+3
-3
cppa/tpartial_function.hpp
cppa/tpartial_function.hpp
+3
-3
cppa/tuple_cast.hpp
cppa/tuple_cast.hpp
+3
-3
cppa/uniform_type_info.hpp
cppa/uniform_type_info.hpp
+3
-3
cppa/util/abstract_uniform_type_info.hpp
cppa/util/abstract_uniform_type_info.hpp
+3
-3
cppa/util/apply_args.hpp
cppa/util/apply_args.hpp
+3
-3
cppa/util/apply_tuple.hpp
cppa/util/apply_tuple.hpp
+3
-3
cppa/util/arg_match_t.hpp
cppa/util/arg_match_t.hpp
+33
-3
cppa/util/at.hpp
cppa/util/at.hpp
+3
-3
cppa/util/comparable.hpp
cppa/util/comparable.hpp
+3
-3
cppa/util/compare_tuples.hpp
cppa/util/compare_tuples.hpp
+3
-3
cppa/util/conjunction.hpp
cppa/util/conjunction.hpp
+3
-3
cppa/util/deduce_ref_type.hpp
cppa/util/deduce_ref_type.hpp
+3
-3
cppa/util/disjunction.hpp
cppa/util/disjunction.hpp
+3
-3
cppa/util/duration.hpp
cppa/util/duration.hpp
+3
-3
cppa/util/element_at.hpp
cppa/util/element_at.hpp
+3
-3
cppa/util/fiber.hpp
cppa/util/fiber.hpp
+3
-3
cppa/util/fixed_vector.hpp
cppa/util/fixed_vector.hpp
+3
-3
cppa/util/if_else.hpp
cppa/util/if_else.hpp
+3
-3
cppa/util/is_array_of.hpp
cppa/util/is_array_of.hpp
+3
-3
cppa/util/is_builtin.hpp
cppa/util/is_builtin.hpp
+33
-3
cppa/util/is_comparable.hpp
cppa/util/is_comparable.hpp
+3
-3
cppa/util/is_forward_iterator.hpp
cppa/util/is_forward_iterator.hpp
+3
-3
cppa/util/is_iterable.hpp
cppa/util/is_iterable.hpp
+3
-3
cppa/util/is_legal_tuple_type.hpp
cppa/util/is_legal_tuple_type.hpp
+3
-3
cppa/util/is_manipulator.hpp
cppa/util/is_manipulator.hpp
+3
-3
cppa/util/is_mutable_ref.hpp
cppa/util/is_mutable_ref.hpp
+3
-3
cppa/util/is_primitive.hpp
cppa/util/is_primitive.hpp
+3
-3
cppa/util/left_or_right.hpp
cppa/util/left_or_right.hpp
+3
-3
cppa/util/producer_consumer_list.hpp
cppa/util/producer_consumer_list.hpp
+3
-3
cppa/util/projection.hpp
cppa/util/projection.hpp
+0
-40
cppa/util/pt_dispatch.hpp
cppa/util/pt_dispatch.hpp
+3
-3
cppa/util/pt_token.hpp
cppa/util/pt_token.hpp
+3
-3
cppa/util/purge_refs.hpp
cppa/util/purge_refs.hpp
+3
-3
cppa/util/replace_type.hpp
cppa/util/replace_type.hpp
+3
-3
cppa/util/ripemd_160.hpp
cppa/util/ripemd_160.hpp
+3
-3
cppa/util/rm_option.hpp
cppa/util/rm_option.hpp
+3
-3
cppa/util/rm_ref.hpp
cppa/util/rm_ref.hpp
+3
-3
cppa/util/shared_lock_guard.hpp
cppa/util/shared_lock_guard.hpp
+3
-3
cppa/util/shared_spinlock.hpp
cppa/util/shared_spinlock.hpp
+3
-3
cppa/util/static_foreach.hpp
cppa/util/static_foreach.hpp
+3
-3
cppa/util/tbind.hpp
cppa/util/tbind.hpp
+3
-3
cppa/util/type_list.hpp
cppa/util/type_list.hpp
+3
-3
cppa/util/type_pair.hpp
cppa/util/type_pair.hpp
+3
-3
cppa/util/upgrade_lock_guard.hpp
cppa/util/upgrade_lock_guard.hpp
+3
-3
cppa/util/void_type.hpp
cppa/util/void_type.hpp
+3
-3
cppa/util/wrapped.hpp
cppa/util/wrapped.hpp
+3
-3
examples/math_actor_example.cpp
examples/math_actor_example.cpp
+1
-1
src/abstract_event_based_actor.cpp
src/abstract_event_based_actor.cpp
+5
-6
src/context_switching_actor.cpp
src/context_switching_actor.cpp
+29
-27
src/invokable.cpp
src/invokable.cpp
+0
-46
src/mock_scheduler.cpp
src/mock_scheduler.cpp
+2
-2
src/network_manager.cpp
src/network_manager.cpp
+4
-3
src/partial_function.cpp
src/partial_function.cpp
+1
-3
src/primitive_variant.cpp
src/primitive_variant.cpp
+1
-1
src/scheduled_actor.cpp
src/scheduled_actor.cpp
+5
-8
src/scheduled_actor_dummy.cpp
src/scheduled_actor_dummy.cpp
+8
-13
src/scheduler.cpp
src/scheduler.cpp
+3
-5
src/self.cpp
src/self.cpp
+3
-3
src/singleton_manager.cpp
src/singleton_manager.cpp
+25
-13
src/stacked_event_based_actor.cpp
src/stacked_event_based_actor.cpp
+0
-4
src/thread_mapped_actor.cpp
src/thread_mapped_actor.cpp
+13
-13
src/thread_pool_scheduler.cpp
src/thread_pool_scheduler.cpp
+27
-36
src/uniform_type_info.cpp
src/uniform_type_info.cpp
+2
-3
unit_testing/ping_pong.cpp
unit_testing/ping_pong.cpp
+1
-1
unit_testing/test__pattern.cpp
unit_testing/test__pattern.cpp
+0
-1
unit_testing/test__primitive_variant.cpp
unit_testing/test__primitive_variant.cpp
+6
-7
unit_testing/test__spawn.cpp
unit_testing/test__spawn.cpp
+3
-3
unit_testing/test__tuple.cpp
unit_testing/test__tuple.cpp
+0
-1
No files found.
CMakeLists.txt
View file @
5b69972e
...
@@ -20,7 +20,7 @@ set(LIBCPPA_SRC
...
@@ -20,7 +20,7 @@ set(LIBCPPA_SRC
src/binary_deserializer.cpp
src/binary_deserializer.cpp
src/binary_serializer.cpp
src/binary_serializer.cpp
src/channel.cpp
src/channel.cpp
src/
converted_thread_context
.cpp
src/
thread_mapped_actor
.cpp
src/cppa.cpp
src/cppa.cpp
src/demangle.cpp
src/demangle.cpp
src/deserializer.cpp
src/deserializer.cpp
...
@@ -31,7 +31,6 @@ set(LIBCPPA_SRC
...
@@ -31,7 +31,6 @@ set(LIBCPPA_SRC
src/fiber.cpp
src/fiber.cpp
src/group.cpp
src/group.cpp
src/group_manager.cpp
src/group_manager.cpp
src/invokable.cpp
src/local_actor.cpp
src/local_actor.cpp
src/mailman.cpp
src/mailman.cpp
src/mock_scheduler.cpp
src/mock_scheduler.cpp
...
@@ -60,7 +59,7 @@ set(LIBCPPA_SRC
...
@@ -60,7 +59,7 @@ set(LIBCPPA_SRC
src/unicast_network.cpp
src/unicast_network.cpp
src/uniform_type_info.cpp
src/uniform_type_info.cpp
src/yield_interface.cpp
src/yield_interface.cpp
src/
yield
ing_actor.cpp
src/
context_switch
ing_actor.cpp
)
)
set
(
boost_context third_party/boost_context/
)
set
(
boost_context third_party/boost_context/
)
...
...
benchmarks/actor_creation.cpp
View file @
5b69972e
...
@@ -51,7 +51,7 @@ struct testee : fsm_actor<testee> {
...
@@ -51,7 +51,7 @@ struct testee : fsm_actor<testee> {
init_state
=
(
init_state
=
(
on
(
atom
(
"spread"
),
0
)
>>
[
=
]()
{
on
(
atom
(
"spread"
),
0
)
>>
[
=
]()
{
send
(
parent
,
atom
(
"result"
),
(
uint32_t
)
1
);
send
(
parent
,
atom
(
"result"
),
(
uint32_t
)
1
);
quit
_normal
();
quit
();
},
},
on
<
atom
(
"spread"
),
int
>
()
>>
[
=
](
int
x
)
{
on
<
atom
(
"spread"
),
int
>
()
>>
[
=
](
int
x
)
{
any_tuple
msg
=
make_cow_tuple
(
atom
(
"spread"
),
x
-
1
);
any_tuple
msg
=
make_cow_tuple
(
atom
(
"spread"
),
x
-
1
);
...
@@ -62,7 +62,7 @@ struct testee : fsm_actor<testee> {
...
@@ -62,7 +62,7 @@ struct testee : fsm_actor<testee> {
become
(
become
(
on
<
atom
(
"result"
),
uint32_t
>
()
>>
[
=
](
uint32_t
r2
)
{
on
<
atom
(
"result"
),
uint32_t
>
()
>>
[
=
](
uint32_t
r2
)
{
send
(
parent
,
atom
(
"result"
),
r1
+
r2
);
send
(
parent
,
atom
(
"result"
),
r1
+
r2
);
quit
_normal
();
quit
();
}
}
);
);
}
}
...
...
benchmarks/distributed.cpp
View file @
5b69972e
...
@@ -134,7 +134,7 @@ struct ping_actor : fsm_actor<ping_actor> {
...
@@ -134,7 +134,7 @@ struct ping_actor : fsm_actor<ping_actor> {
become
(
become
(
on
<
atom
(
"pong"
),
uint32_t
>
().
when
(
_x2
==
uint32_t
(
0
))
>>
[
=
]()
{
on
<
atom
(
"pong"
),
uint32_t
>
().
when
(
_x2
==
uint32_t
(
0
))
>>
[
=
]()
{
send
(
parent
,
atom
(
"done"
));
send
(
parent
,
atom
(
"done"
));
quit
_normal
();
quit
();
},
},
on
(
atom
(
"pong"
),
arg_match
)
>>
[
=
](
uint32_t
value
)
{
on
(
atom
(
"pong"
),
arg_match
)
>>
[
=
](
uint32_t
value
)
{
reply
(
atom
(
"ping"
),
value
-
1
);
reply
(
atom
(
"ping"
),
value
-
1
);
...
@@ -206,7 +206,7 @@ struct server_actor : fsm_actor<server_actor> {
...
@@ -206,7 +206,7 @@ struct server_actor : fsm_actor<server_actor> {
},
},
on
(
atom
(
"shutdown"
))
>>
[
=
]()
{
on
(
atom
(
"shutdown"
))
>>
[
=
]()
{
m_pongs
.
clear
();
m_pongs
.
clear
();
quit
_normal
();
quit
();
},
},
others
()
>>
[
=
]()
{
others
()
>>
[
=
]()
{
cout
<<
"unexpected: "
<<
to_string
(
last_dequeued
())
<<
endl
;
cout
<<
"unexpected: "
<<
to_string
(
last_dequeued
())
<<
endl
;
...
...
benchmarks/mailbox_performance.cpp
View file @
5b69972e
...
@@ -53,7 +53,7 @@ struct fsm_receiver : fsm_actor<fsm_receiver> {
...
@@ -53,7 +53,7 @@ struct fsm_receiver : fsm_actor<fsm_receiver> {
on
(
atom
(
"msg"
))
>>
[
=
]()
{
on
(
atom
(
"msg"
))
>>
[
=
]()
{
++
m_value
;
++
m_value
;
if
(
m_value
==
max
)
{
if
(
m_value
==
max
)
{
quit
_normal
();
quit
();
}
}
}
}
);
);
...
...
benchmarks/mixed_case.cpp
View file @
5b69972e
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
#include "cppa/match.hpp"
#include "cppa/match.hpp"
#include "cppa/fsm_actor.hpp"
#include "cppa/fsm_actor.hpp"
#include "cppa/detail/mock_scheduler.hpp"
#include "cppa/detail/mock_scheduler.hpp"
#include "cppa/
detail/yield
ing_actor.hpp"
#include "cppa/
context_switch
ing_actor.hpp"
using
std
::
cout
;
using
std
::
cout
;
using
std
::
cerr
;
using
std
::
cerr
;
...
@@ -73,7 +73,7 @@ struct fsm_worker : fsm_actor<fsm_worker> {
...
@@ -73,7 +73,7 @@ struct fsm_worker : fsm_actor<fsm_worker> {
send
(
mc
,
atom
(
"result"
),
factorize
(
what
));
send
(
mc
,
atom
(
"result"
),
factorize
(
what
));
},
},
on
(
atom
(
"done"
))
>>
[
=
]()
{
on
(
atom
(
"done"
))
>>
[
=
]()
{
quit
_normal
();
quit
();
}
}
);
);
}
}
...
@@ -86,7 +86,7 @@ struct fsm_chain_link : fsm_actor<fsm_chain_link> {
...
@@ -86,7 +86,7 @@ struct fsm_chain_link : fsm_actor<fsm_chain_link> {
init_state
=
(
init_state
=
(
on
<
atom
(
"token"
),
int
>
()
>>
[
=
](
int
v
)
{
on
<
atom
(
"token"
),
int
>
()
>>
[
=
](
int
v
)
{
next
<<
std
::
move
(
last_dequeued
());
next
<<
std
::
move
(
last_dequeued
());
if
(
v
==
0
)
quit
_normal
();
if
(
v
==
0
)
quit
();
}
}
);
);
}
}
...
@@ -120,7 +120,7 @@ struct fsm_chain_master : fsm_actor<fsm_chain_master> {
...
@@ -120,7 +120,7 @@ struct fsm_chain_master : fsm_actor<fsm_chain_master> {
else
{
else
{
send
(
worker
,
atom
(
"done"
));
send
(
worker
,
atom
(
"done"
));
send
(
mc
,
atom
(
"masterdone"
));
send
(
mc
,
atom
(
"masterdone"
));
quit
_normal
();
quit
();
}
}
},
},
on
<
atom
(
"token"
),
int
>
()
>>
[
=
](
int
v
)
{
on
<
atom
(
"token"
),
int
>
()
>>
[
=
](
int
v
)
{
...
@@ -138,11 +138,11 @@ struct fsm_supervisor : fsm_actor<fsm_supervisor> {
...
@@ -138,11 +138,11 @@ struct fsm_supervisor : fsm_actor<fsm_supervisor> {
fsm_supervisor
(
int
num_msgs
)
:
left
(
num_msgs
)
{
fsm_supervisor
(
int
num_msgs
)
:
left
(
num_msgs
)
{
init_state
=
(
init_state
=
(
on
(
atom
(
"masterdone"
))
>>
[
=
]()
{
on
(
atom
(
"masterdone"
))
>>
[
=
]()
{
if
(
--
left
==
0
)
quit
_normal
();
if
(
--
left
==
0
)
quit
();
},
},
on
<
atom
(
"result"
),
factors
>
()
>>
[
=
](
const
factors
&
vec
)
{
on
<
atom
(
"result"
),
factors
>
()
>>
[
=
](
const
factors
&
vec
)
{
check_factors
(
vec
);
check_factors
(
vec
);
if
(
--
left
==
0
)
quit
_normal
();
if
(
--
left
==
0
)
quit
();
}
}
);
);
}
}
...
...
cppa.files
View file @
5b69972e
...
@@ -46,7 +46,7 @@ cppa/detail/boxed.hpp
...
@@ -46,7 +46,7 @@ cppa/detail/boxed.hpp
cppa/detail/buffer.hpp
cppa/detail/buffer.hpp
cppa/detail/channel.hpp
cppa/detail/channel.hpp
cppa/detail/container_tuple_view.hpp
cppa/detail/container_tuple_view.hpp
cppa/
detail/converted_thread_context
.hpp
cppa/
thread_mapped_actor
.hpp
cppa/detail/decorated_tuple.hpp
cppa/detail/decorated_tuple.hpp
cppa/detail/default_uniform_type_info_impl.hpp
cppa/detail/default_uniform_type_info_impl.hpp
cppa/detail/demangle.hpp
cppa/detail/demangle.hpp
...
@@ -56,7 +56,6 @@ cppa/detail/filter_result.hpp
...
@@ -56,7 +56,6 @@ cppa/detail/filter_result.hpp
cppa/detail/get_behavior.hpp
cppa/detail/get_behavior.hpp
cppa/detail/group_manager.hpp
cppa/detail/group_manager.hpp
cppa/detail/implicit_conversions.hpp
cppa/detail/implicit_conversions.hpp
cppa/detail/invokable.hpp
cppa/detail/list_member.hpp
cppa/detail/list_member.hpp
cppa/detail/mailman.hpp
cppa/detail/mailman.hpp
cppa/detail/map_member.hpp
cppa/detail/map_member.hpp
...
@@ -92,7 +91,7 @@ cppa/detail/unboxed.hpp
...
@@ -92,7 +91,7 @@ cppa/detail/unboxed.hpp
cppa/detail/uniform_type_info_map.hpp
cppa/detail/uniform_type_info_map.hpp
cppa/detail/value_guard.hpp
cppa/detail/value_guard.hpp
cppa/detail/yield_interface.hpp
cppa/detail/yield_interface.hpp
cppa/
detail/yield
ing_actor.hpp
cppa/
context_switch
ing_actor.hpp
cppa/either.hpp
cppa/either.hpp
cppa/event_based_actor.hpp
cppa/event_based_actor.hpp
cppa/event_based_actor_base.hpp
cppa/event_based_actor_base.hpp
...
@@ -157,7 +156,6 @@ cppa/util/is_mutable_ref.hpp
...
@@ -157,7 +156,6 @@ cppa/util/is_mutable_ref.hpp
cppa/util/is_primitive.hpp
cppa/util/is_primitive.hpp
cppa/util/left_or_right.hpp
cppa/util/left_or_right.hpp
cppa/util/producer_consumer_list.hpp
cppa/util/producer_consumer_list.hpp
cppa/util/projection.hpp
cppa/util/pt_dispatch.hpp
cppa/util/pt_dispatch.hpp
cppa/util/pt_token.hpp
cppa/util/pt_token.hpp
cppa/util/purge_refs.hpp
cppa/util/purge_refs.hpp
...
@@ -206,7 +204,7 @@ src/attachable.cpp
...
@@ -206,7 +204,7 @@ src/attachable.cpp
src/binary_deserializer.cpp
src/binary_deserializer.cpp
src/binary_serializer.cpp
src/binary_serializer.cpp
src/channel.cpp
src/channel.cpp
src/
converted_thread_context
.cpp
src/
thread_mapped_actor
.cpp
src/cppa.cpp
src/cppa.cpp
src/demangle.cpp
src/demangle.cpp
src/deserializer.cpp
src/deserializer.cpp
...
@@ -217,7 +215,6 @@ src/exception.cpp
...
@@ -217,7 +215,6 @@ src/exception.cpp
src/fiber.cpp
src/fiber.cpp
src/group.cpp
src/group.cpp
src/group_manager.cpp
src/group_manager.cpp
src/invokable.cpp
src/local_actor.cpp
src/local_actor.cpp
src/mailman.cpp
src/mailman.cpp
src/mock_scheduler.cpp
src/mock_scheduler.cpp
...
@@ -246,7 +243,7 @@ src/to_uniform_name.cpp
...
@@ -246,7 +243,7 @@ src/to_uniform_name.cpp
src/unicast_network.cpp
src/unicast_network.cpp
src/uniform_type_info.cpp
src/uniform_type_info.cpp
src/yield_interface.cpp
src/yield_interface.cpp
src/
yield
ing_actor.cpp
src/
context_switch
ing_actor.cpp
unit_testing/main.cpp
unit_testing/main.cpp
unit_testing/ping_pong.cpp
unit_testing/ping_pong.cpp
unit_testing/ping_pong.hpp
unit_testing/ping_pong.hpp
...
...
cppa/abstract_actor.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef ABSTRACT_ACTOR_HPP
#ifndef
CPPA_
ABSTRACT_ACTOR_HPP
#define ABSTRACT_ACTOR_HPP
#define
CPPA_
ABSTRACT_ACTOR_HPP
#include "cppa/config.hpp"
#include "cppa/config.hpp"
...
@@ -275,4 +275,4 @@ class abstract_actor : public Base {
...
@@ -275,4 +275,4 @@ class abstract_actor : public Base {
}
// namespace cppa
}
// namespace cppa
#endif // ABSTRACT_ACTOR_HPP
#endif //
CPPA_
ABSTRACT_ACTOR_HPP
cppa/abstract_event_based_actor.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef
EVENT_DRIVEN
_ACTOR_HPP
#ifndef
CPPA_ABSTRACT_EVENT_BASED
_ACTOR_HPP
#define
EVENT_DRIVEN
_ACTOR_HPP
#define
CPPA_ABSTRACT_EVENT_BASED
_ACTOR_HPP
#include <stack>
#include <stack>
#include <memory>
#include <memory>
...
@@ -57,7 +57,7 @@ class abstract_event_based_actor : public detail::abstract_scheduled_actor {
...
@@ -57,7 +57,7 @@ class abstract_event_based_actor : public detail::abstract_scheduled_actor {
void
dequeue
(
partial_function
&
);
//override
void
dequeue
(
partial_function
&
);
//override
void
resume
(
util
::
fiber
*
,
scheduler
::
callback
*
cb
);
//override
resume_result
resume
(
util
::
fiber
*
);
//override
/**
/**
* @brief Initializes the actor by defining an initial behavior.
* @brief Initializes the actor by defining an initial behavior.
...
@@ -130,4 +130,4 @@ class abstract_event_based_actor : public detail::abstract_scheduled_actor {
...
@@ -130,4 +130,4 @@ class abstract_event_based_actor : public detail::abstract_scheduled_actor {
}
// namespace cppa
}
// namespace cppa
#endif //
EVENT_DRIVEN
_ACTOR_HPP
#endif //
CPPA_ABSTRACT_EVENT_BASED
_ACTOR_HPP
cppa/actor.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef ACTOR_HPP
#ifndef
CPPA_
ACTOR_HPP
#define ACTOR_HPP
#define
CPPA_
ACTOR_HPP
#include <memory>
#include <memory>
#include <cstdint>
#include <cstdint>
...
@@ -283,4 +283,4 @@ bool actor::attach_functor(F&& ftor) {
...
@@ -283,4 +283,4 @@ bool actor::attach_functor(F&& ftor) {
}
// namespace cppa
}
// namespace cppa
#endif // ACTOR_HPP
#endif //
CPPA_
ACTOR_HPP
cppa/actor_proxy.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef ACTOR_PROXY_HPP
#ifndef
CPPA_
ACTOR_PROXY_HPP
#define ACTOR_PROXY_HPP
#define
CPPA_
ACTOR_PROXY_HPP
#include "cppa/actor.hpp"
#include "cppa/actor.hpp"
#include "cppa/abstract_actor.hpp"
#include "cppa/abstract_actor.hpp"
...
@@ -39,7 +39,7 @@ namespace cppa {
...
@@ -39,7 +39,7 @@ namespace cppa {
#ifdef CPPA_DOCUMENTATION
#ifdef CPPA_DOCUMENTATION
/**
/**
* @brief Represents a remote
A
ctor.
* @brief Represents a remote
a
ctor.
*/
*/
class
actor_proxy
:
public
actor
{
};
class
actor_proxy
:
public
actor
{
};
...
@@ -81,9 +81,10 @@ class actor_proxy : public abstract_actor<actor> {
...
@@ -81,9 +81,10 @@ class actor_proxy : public abstract_actor<actor> {
/**
/**
* @brief A smart pointer to an {@link actor_proxy} instance.
* @brief A smart pointer to an {@link actor_proxy} instance.
* @relates actor_proxy
*/
*/
typedef
intrusive_ptr
<
actor_proxy
>
actor_proxy_ptr
;
typedef
intrusive_ptr
<
actor_proxy
>
actor_proxy_ptr
;
}
// namespace cppa
}
// namespace cppa
#endif // ACTOR_PROXY_HPP
#endif //
CPPA_
ACTOR_PROXY_HPP
cppa/announce.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef ANNOUNCE_HPP
#ifndef
CPPA_
ANNOUNCE_HPP
#define ANNOUNCE_HPP
#define
CPPA_
ANNOUNCE_HPP
#include <typeinfo>
#include <typeinfo>
...
@@ -169,4 +169,4 @@ inline bool announce(const Args&... args) {
...
@@ -169,4 +169,4 @@ inline bool announce(const Args&... args) {
}
// namespace cppa
}
// namespace cppa
#endif // ANNOUNCE_HPP
#endif //
CPPA_
ANNOUNCE_HPP
cppa/any_tuple.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef ANY_TUPLE_HPP
#ifndef
CPPA_
ANY_TUPLE_HPP
#define ANY_TUPLE_HPP
#define
CPPA_
ANY_TUPLE_HPP
#include <type_traits>
#include <type_traits>
...
@@ -268,4 +268,4 @@ inline any_tuple make_any_tuple(Args&&... args) {
...
@@ -268,4 +268,4 @@ inline any_tuple make_any_tuple(Args&&... args) {
}
// namespace cppa
}
// namespace cppa
#endif // ANY_TUPLE_HPP
#endif //
CPPA_
ANY_TUPLE_HPP
cppa/anything.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef
LIB
CPPA_ANYTHING_HPP
#ifndef CPPA_ANYTHING_HPP
#define
LIB
CPPA_ANYTHING_HPP
#define CPPA_ANYTHING_HPP
#include <type_traits>
#include <type_traits>
...
@@ -65,4 +65,4 @@ struct is_anything {
...
@@ -65,4 +65,4 @@ struct is_anything {
}
// namespace cppa
}
// namespace cppa
#endif // ANYTHING_HPP
#endif //
CPPA_
ANYTHING_HPP
cppa/atom.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef ATOM_HPP
#ifndef
CPPA_
ATOM_HPP
#define ATOM_HPP
#define
CPPA_
ATOM_HPP
#include <string>
#include <string>
...
@@ -63,4 +63,4 @@ constexpr atom_value atom(char const (&str) [Size]) {
...
@@ -63,4 +63,4 @@ constexpr atom_value atom(char const (&str) [Size]) {
}
// namespace cppa
}
// namespace cppa
#endif // ATOM_HPP
#endif //
CPPA_
ATOM_HPP
cppa/attachable.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef ATTACHABLE_HPP
#ifndef
CPPA_
ATTACHABLE_HPP
#define ATTACHABLE_HPP
#define
CPPA_
ATTACHABLE_HPP
#include <cstdint>
#include <cstdint>
#include <typeinfo>
#include <typeinfo>
...
@@ -88,4 +88,4 @@ class attachable {
...
@@ -88,4 +88,4 @@ class attachable {
}
// namespace cppa
}
// namespace cppa
#endif // ATTACHABLE_HPP
#endif //
CPPA_
ATTACHABLE_HPP
cppa/behavior.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef BEHAVIOR_HPP
#ifndef
CPPA_
BEHAVIOR_HPP
#define BEHAVIOR_HPP
#define
CPPA_
BEHAVIOR_HPP
#include <functional>
#include <functional>
#include <type_traits>
#include <type_traits>
...
@@ -175,4 +175,4 @@ struct select_bhvr {
...
@@ -175,4 +175,4 @@ struct select_bhvr {
}
// namespace cppa
}
// namespace cppa
#endif // BEHAVIOR_HPP
#endif //
CPPA_
BEHAVIOR_HPP
cppa/binary_deserializer.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef BINARY_DESERIALIZER_HPP
#ifndef
CPPA_
BINARY_DESERIALIZER_HPP
#define BINARY_DESERIALIZER_HPP
#define
CPPA_
BINARY_DESERIALIZER_HPP
#include "cppa/deserializer.hpp"
#include "cppa/deserializer.hpp"
...
@@ -66,4 +66,4 @@ class binary_deserializer : public deserializer {
...
@@ -66,4 +66,4 @@ class binary_deserializer : public deserializer {
}
// namespace cppa
}
// namespace cppa
#endif // BINARY_DESERIALIZER_HPP
#endif //
CPPA_
BINARY_DESERIALIZER_HPP
cppa/binary_serializer.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef BINARY_SERIALIZER_HPP
#ifndef
CPPA_
BINARY_SERIALIZER_HPP
#define BINARY_SERIALIZER_HPP
#define
CPPA_
BINARY_SERIALIZER_HPP
#include <utility>
#include <utility>
#include "cppa/serializer.hpp"
#include "cppa/serializer.hpp"
...
@@ -94,4 +94,4 @@ class binary_serializer : public serializer {
...
@@ -94,4 +94,4 @@ class binary_serializer : public serializer {
}
// namespace cppa
}
// namespace cppa
#endif // BINARY_SERIALIZER_HPP
#endif //
CPPA_
BINARY_SERIALIZER_HPP
cppa/channel.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef CHANNEL_HPP
#ifndef C
PPA_C
HANNEL_HPP
#define CHANNEL_HPP
#define C
PPA_C
HANNEL_HPP
#include "cppa/ref_counted.hpp"
#include "cppa/ref_counted.hpp"
#include "cppa/intrusive_ptr.hpp"
#include "cppa/intrusive_ptr.hpp"
...
@@ -77,4 +77,4 @@ typedef intrusive_ptr<channel> channel_ptr;
...
@@ -77,4 +77,4 @@ typedef intrusive_ptr<channel> channel_ptr;
}
// namespace cppa
}
// namespace cppa
#endif // CHANNEL_HPP
#endif // C
PPA_C
HANNEL_HPP
cppa/
detail/yield
ing_actor.hpp
→
cppa/
context_switch
ing_actor.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef
YIELD
ING_ACTOR_HPP
#ifndef
CPPA_CONTEXT_SWITCH
ING_ACTOR_HPP
#define
YIELD
ING_ACTOR_HPP
#define
CPPA_CONTEXT_SWITCH
ING_ACTOR_HPP
#include "cppa/config.hpp"
#include "cppa/config.hpp"
...
@@ -44,50 +44,72 @@
...
@@ -44,50 +44,72 @@
#include "cppa/detail/nestable_receive_policy.hpp"
#include "cppa/detail/nestable_receive_policy.hpp"
#include "cppa/detail/abstract_scheduled_actor.hpp"
#include "cppa/detail/abstract_scheduled_actor.hpp"
namespace
cppa
{
namespace
detail
{
namespace
cppa
{
class
yielding_actor
:
public
abstract_scheduled_actor
{
#ifdef CPPA_DOCUMENTATION
friend
class
nestable_receive_policy
;
/**
* @brief Context-switching actor implementation.
*/
class
context_switching_actor
:
public
scheduled_actor
{
typedef
abstract_scheduled_actor
super
;
protected:
/**
* @brief Implements the actor's behavior.
* Reimplemented this function for a class-based context-switching
* actor. Returning from this member function will end the
* execution of the actor.
*/
virtual
void
run
();
};
#else
class
context_switching_actor
:
public
detail
::
abstract_scheduled_actor
{
friend
class
detail
::
nestable_receive_policy
;
typedef
detail
::
abstract_scheduled_actor
super
;
public:
public:
yield
ing_actor
(
std
::
function
<
void
()
>
fun
);
context_switch
ing_actor
(
std
::
function
<
void
()
>
fun
);
void
dequeue
(
behavior
&
bhvr
);
//override
void
dequeue
(
behavior
&
bhvr
);
//override
void
dequeue
(
partial_function
&
fun
);
//override
void
dequeue
(
partial_function
&
fun
);
//override
void
resume
(
util
::
fiber
*
from
,
scheduler
::
callback
*
callback
);
//override
resume_result
resume
(
util
::
fiber
*
from
);
//override
inline
void
push_timeout
()
{
protected:
++
m_active_timeout_id
;
}
inline
void
pop_timeout
()
{
context_switching_actor
();
--
m_active_timeout_id
;
}
private:
virtual
void
run
();
typedef
std
::
unique_ptr
<
recursive_queue_node
>
queue_node_ptr
;
private:
void
run
();
// required by detail::nestable_receive_policy
detail
::
recursive_queue_node
*
receive_node
();
inline
void
push_timeout
()
{
++
m_active_timeout_id
;
}
inline
void
pop_timeout
()
{
--
m_active_timeout_id
;
}
// required by util::fiber
static
void
trampoline
(
void
*
_this
);
static
void
trampoline
(
void
*
_this
);
// members
util
::
fiber
m_fiber
;
util
::
fiber
m_fiber
;
std
::
function
<
void
()
>
m_behavior
;
std
::
function
<
void
()
>
m_behavior
;
nestable_receive_policy
m_recv_policy
;
detail
::
nestable_receive_policy
m_recv_policy
;
recursive_queue_node
*
receive_node
();
};
};
}
}
// namespace cppa::detail
#endif // CPPA_DOCUMENTATION
}
// namespace cppa
#endif // CPPA_DISABLE_CONTEXT_SWITCHING
#endif // CPPA_DISABLE_CONTEXT_SWITCHING
#endif //
YIELD
ING_ACTOR_HPP
#endif //
CPPA_CONTEXT_SWITCH
ING_ACTOR_HPP
cppa/cow_ptr.hpp
View file @
5b69972e
...
@@ -28,13 +28,15 @@
...
@@ -28,13 +28,15 @@
\******************************************************************************/
\******************************************************************************/
#ifndef COW_PTR_HPP
#ifndef C
PPA_C
OW_PTR_HPP
#define COW_PTR_HPP
#define C
PPA_C
OW_PTR_HPP
#include <cstddef>
#include <stdexcept>
#include <stdexcept>
#include <type_traits>
#include <type_traits>
#include "cppa/intrusive_ptr.hpp"
#include "cppa/intrusive_ptr.hpp"
#include "cppa/util/comparable.hpp"
namespace
cppa
{
namespace
cppa
{
...
@@ -46,83 +48,93 @@ namespace cppa {
...
@@ -46,83 +48,93 @@ namespace cppa {
* {@link ref_counted}.
* {@link ref_counted}.
*/
*/
template
<
typename
T
>
template
<
typename
T
>
class
cow_ptr
{
class
cow_ptr
:
util
::
comparable
<
cow_ptr
<
T
>
>
,
util
::
comparable
<
cow_ptr
<
T
>
,
const
T
*>
,
util
::
comparable
<
cow_ptr
<
T
>
,
std
::
nullptr_t
>
{
public:
public:
template
<
typename
Y
>
typedef
T
*
pointer
;
explicit
cow_ptr
(
Y
*
raw_ptr
)
:
m_ptr
(
raw_ptr
)
{
}
typedef
const
T
*
const_pointer
;
typedef
T
element_type
;
typedef
T
&
reference
;
typedef
const
T
&
const_reference
;
explicit
cow_ptr
(
T
*
raw_ptr
)
:
m_ptr
(
raw_ptr
)
{
}
constexpr
cow_ptr
()
:
m_ptr
(
)
{
}
cow_ptr
(
cow_ptr
&&
other
)
:
m_ptr
(
std
::
move
(
other
.
m_ptr
)
)
{
}
cow_ptr
(
pointer
raw_ptr
)
:
m_ptr
(
raw_ptr
)
{
}
cow_ptr
(
const
cow_ptr
&
other
)
:
m_ptr
(
other
.
m_ptr
)
{
}
cow_ptr
(
cow_ptr
&&
)
=
default
;
cow_ptr
(
const
cow_ptr
&
)
=
default
;
cow_ptr
&
operator
=
(
cow_ptr
&&
)
=
default
;
cow_ptr
&
operator
=
(
const
cow_ptr
&
)
=
default
;
template
<
typename
Y
>
template
<
typename
Y
>
cow_ptr
(
const
cow_ptr
<
Y
>&
other
)
:
m_ptr
(
const_cast
<
Y
*>
(
other
.
get
()))
{
}
cow_ptr
(
cow_ptr
<
Y
>
other
)
:
m_ptr
(
other
.
m_ptr
.
release
())
{
static_assert
(
std
::
is_convertible
<
Y
*
,
T
*>::
value
,
inline
void
swap
(
cow_ptr
&
other
)
{
"Y* is not assignable to T*"
);
m_ptr
.
swap
(
other
.
m_ptr
);
}
}
cow_ptr
&
operator
=
(
cow_ptr
&&
other
)
{
inline
void
swap
(
cow_ptr
&
other
)
{
m_ptr
.
swap
(
other
.
m_ptr
);
}
swap
(
other
);
return
*
this
;
}
cow_ptr
&
operator
=
(
const
cow_ptr
&
other
)
{
cow_ptr
tmp
{
other
};
swap
(
tmp
);
return
*
this
;
}
template
<
typename
Y
>
template
<
typename
Y
>
cow_ptr
&
operator
=
(
const
cow_ptr
<
Y
>&
other
)
{
cow_ptr
&
operator
=
(
cow_ptr
<
Y
>
other
)
{
cow_ptr
tmp
{
other
};
m_ptr
=
std
::
move
(
other
.
m_ptr
);
swap
(
tmp
);
return
*
this
;
return
*
this
;
}
}
void
detach
()
{
(
void
)
detached_ptr
();
void
detach
()
{
static_cast
<
void
>
(
get_detached
());
}
}
inline
void
reset
(
T
*
value
=
nullptr
)
{
m_ptr
.
reset
(
value
);
}
inline
void
reset
(
T
*
value
=
nullptr
)
{
m_ptr
.
reset
(
value
);
}
inline
T
*
get
()
{
return
(
m_ptr
)
?
detached_ptr
()
:
nullptr
;
}
// non-const access (detaches this pointer)
inline
pointer
get
()
{
return
(
m_ptr
)
?
get_detached
()
:
nullptr
;
}
inline
T
&
operator
*
()
{
return
*
detached_ptr
();
}
inline
pointer
operator
->
()
{
return
get_detached
();
}
inline
reference
operator
*
()
{
return
*
get_detached
();
}
inline
T
*
operator
->
()
{
return
detached_ptr
();
}
inline
const
T
*
get
()
const
{
return
ptr
();
}
inline
const
T
&
operator
*
()
const
{
return
*
ptr
();
}
inline
const
T
*
operator
->
()
const
{
return
ptr
();
}
// const access (does not detach this pointer)
inline
const_pointer
get
()
const
{
return
m_ptr
.
get
();
}
inline
const_pointer
operator
->
()
const
{
return
get
();
}
inline
const_reference
operator
*
()
const
{
return
*
get
();
}
inline
explicit
operator
bool
()
const
{
return
static_cast
<
bool
>
(
m_ptr
);
}
inline
explicit
operator
bool
()
const
{
return
static_cast
<
bool
>
(
m_ptr
);
}
template
<
typename
Arg
>
inline
ptrdiff_t
compare
(
Arg
&&
what
)
const
{
return
m_ptr
.
compare
(
std
::
forward
<
Arg
>
(
what
));
}
private:
private:
intrusive_ptr
<
T
>
m_ptr
;
intrusive_ptr
<
T
>
m_ptr
;
T
*
detached_ptr
()
{
pointer
get_detached
()
{
T
*
ptr
=
m_ptr
.
get
();
auto
ptr
=
m_ptr
.
get
();
if
(
!
ptr
->
unique
())
{
if
(
!
ptr
->
unique
())
{
//T* new_ptr = detail::copy_of(ptr, copy_of_token());
pointer
new_ptr
=
ptr
->
copy
();
T
*
new_ptr
=
ptr
->
copy
();
reset
(
new_ptr
);
cow_ptr
tmp
(
new_ptr
);
swap
(
tmp
);
return
new_ptr
;
return
new_ptr
;
}
}
return
ptr
;
return
ptr
;
}
}
inline
const
T
*
ptr
()
const
{
return
m_ptr
.
get
();
}
};
};
/**
* @relates cow_ptr
*/
template
<
typename
X
,
typename
Y
>
inline
bool
operator
==
(
const
cow_ptr
<
X
>&
lhs
,
const
cow_ptr
<
Y
>&
rhs
)
{
return
lhs
.
get
()
==
rhs
.
get
();
}
/**
* @relates cow_ptr
*/
template
<
typename
X
,
typename
Y
>
inline
bool
operator
!=
(
const
cow_ptr
<
X
>&
lhs
,
const
cow_ptr
<
Y
>&
rhs
)
{
return
!
(
lhs
==
rhs
);
}
}
// namespace cppa
}
// namespace cppa
#endif // COW_PTR_HPP
#endif // C
PPA_C
OW_PTR_HPP
cppa/cow_tuple.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef CPPA_TUPLE_HPP
#ifndef CPPA_
COW_
TUPLE_HPP
#define CPPA_TUPLE_HPP
#define CPPA_
COW_
TUPLE_HPP
#include <cstddef>
#include <cstddef>
#include <string>
#include <string>
...
@@ -257,4 +257,4 @@ inline bool operator!=(const cow_tuple<LhsTypes...>& lhs,
...
@@ -257,4 +257,4 @@ inline bool operator!=(const cow_tuple<LhsTypes...>& lhs,
}
// namespace cppa
}
// namespace cppa
#endif
#endif
// CPPA_COW_TUPLE_HPP
cppa/cppa.hpp
View file @
5b69972e
...
@@ -89,18 +89,26 @@
...
@@ -89,18 +89,26 @@
*
*
* The usual build steps on Linux and Mac OS X are:
* The usual build steps on Linux and Mac OS X are:
*
*
* - <tt>mkdir build</tt>
*- <tt>mkdir build</tt>
* - <tt>cd build</tt>
*- <tt>cd build</tt>
* - <tt>cmake ..</tt>
*- <tt>cmake ..</tt>
* - <tt>make</tt> (as root, optionally)
*- <tt>make</tt>
* - <tt>make install</tt> (as root, optionally)
*- <tt>make install</tt> (as root, optionally)
*
* Please run the unit tests as well to verify that @p libcppa works properly.
*
*- <tt>./bin/unit_tests</tt>
*
* Please submit a bug report that includes (a) your compiler version,
* (b) your OS, and (c) the output of the unit tests if an error occurs.
*
*
* Windows is not supported yet, because MVSC++ doesn't implement the
* Windows is not supported yet, because MVSC++ doesn't implement the
* C++11 features needed to compile @p libcppa.
* C++11 features needed to compile @p libcppa.
*
*
* Please read the <b>Manual</b> for an introduction to @p libcppa.
* Please read the <b>Manual</b> for an introduction to @p libcppa.
* It is available online at
* It is available online at
* http://neverlord.github.com/libcppa/manual/
* http://neverlord.github.com/libcppa/manual/index.html or as PDF version at
* http://neverlord.github.com/libcppa/manual/libcppa_manual.pdf
*
*
* @section IntroHelloWorld Hello World Example
* @section IntroHelloWorld Hello World Example
*
*
...
...
cppa/deserializer.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef DESERIALIZER_HPP
#ifndef
CPPA_
DESERIALIZER_HPP
#define DESERIALIZER_HPP
#define
CPPA_
DESERIALIZER_HPP
#include <string>
#include <string>
#include <cstddef>
#include <cstddef>
...
@@ -121,4 +121,4 @@ deserializer& operator>>(deserializer& d, object& storage);
...
@@ -121,4 +121,4 @@ deserializer& operator>>(deserializer& d, object& storage);
}
// namespace cppa
}
// namespace cppa
#endif // DESERIALIZER_HPP
#endif //
CPPA_
DESERIALIZER_HPP
cppa/detail/abstract_scheduled_actor.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef SCHEDULED_ACTOR_HPP
#ifndef
CPPA_
SCHEDULED_ACTOR_HPP
#define SCHEDULED_ACTOR_HPP
#define
CPPA_
SCHEDULED_ACTOR_HPP
#include <iostream>
#include <iostream>
...
@@ -182,4 +182,4 @@ class abstract_scheduled_actor : public abstract_actor<scheduled_actor> {
...
@@ -182,4 +182,4 @@ class abstract_scheduled_actor : public abstract_actor<scheduled_actor> {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // SCHEDULED_ACTOR_HPP
#endif //
CPPA_
SCHEDULED_ACTOR_HPP
cppa/detail/abstract_tuple.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef ABSTRACT_TUPLE_HPP
#ifndef
CPPA_
ABSTRACT_TUPLE_HPP
#define ABSTRACT_TUPLE_HPP
#define
CPPA_
ABSTRACT_TUPLE_HPP
#include <iterator>
#include <iterator>
#include <typeinfo>
#include <typeinfo>
...
@@ -128,4 +128,4 @@ constexpr types_only_eq_type types_only_eq;
...
@@ -128,4 +128,4 @@ constexpr types_only_eq_type types_only_eq;
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // ABSTRACT_TUPLE_HPP
#endif //
CPPA_
ABSTRACT_TUPLE_HPP
cppa/detail/actor_count.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef ACTOR_COUNT_HPP
#ifndef
CPPA_
ACTOR_COUNT_HPP
#define ACTOR_COUNT_HPP
#define
CPPA_
ACTOR_COUNT_HPP
#include <cstddef>
#include <cstddef>
...
@@ -45,4 +45,4 @@ void actor_count_wait_until(size_t expected);
...
@@ -45,4 +45,4 @@ void actor_count_wait_until(size_t expected);
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // ACTOR_COUNT_HPP
#endif //
CPPA_
ACTOR_COUNT_HPP
cppa/detail/actor_proxy_cache.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef ACTOR_PROXY_CACHE_HPP
#ifndef
CPPA_
ACTOR_PROXY_CACHE_HPP
#define ACTOR_PROXY_CACHE_HPP
#define
CPPA_
ACTOR_PROXY_CACHE_HPP
#include <mutex>
#include <mutex>
#include <thread>
#include <thread>
...
@@ -99,4 +99,4 @@ actor_proxy_cache& get_actor_proxy_cache();
...
@@ -99,4 +99,4 @@ actor_proxy_cache& get_actor_proxy_cache();
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // ACTOR_PROXY_CACHE_HPP
#endif //
CPPA_
ACTOR_PROXY_CACHE_HPP
cppa/detail/actor_registry.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef ACTOR_REGISTRY_HPP
#ifndef
CPPA_
ACTOR_REGISTRY_HPP
#define ACTOR_REGISTRY_HPP
#define
CPPA_
ACTOR_REGISTRY_HPP
#include <map>
#include <map>
#include <mutex>
#include <mutex>
...
@@ -86,4 +86,4 @@ class actor_registry {
...
@@ -86,4 +86,4 @@ class actor_registry {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // ACTOR_REGISTRY_HPP
#endif //
CPPA_
ACTOR_REGISTRY_HPP
cppa/detail/addressed_message.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef ADDRESSED_MESSAGE_HPP
#ifndef
CPPA_
ADDRESSED_MESSAGE_HPP
#define ADDRESSED_MESSAGE_HPP
#define
CPPA_
ADDRESSED_MESSAGE_HPP
#include "cppa/actor.hpp"
#include "cppa/actor.hpp"
#include "cppa/channel.hpp"
#include "cppa/channel.hpp"
...
@@ -97,4 +97,4 @@ inline bool operator!=(const addressed_message& lhs, const addressed_message& rh
...
@@ -97,4 +97,4 @@ inline bool operator!=(const addressed_message& lhs, const addressed_message& rh
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // ADDRESSED_MESSAGE_HPP
#endif //
CPPA_
ADDRESSED_MESSAGE_HPP
cppa/detail/atom_val.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef ATOM_VAL_HPP
#ifndef
CPPA_
ATOM_VAL_HPP
#define ATOM_VAL_HPP
#define
CPPA_
ATOM_VAL_HPP
namespace
cppa
{
namespace
detail
{
namespace
cppa
{
namespace
detail
{
...
@@ -68,4 +68,4 @@ constexpr std::uint64_t atom_val(const char* cstr, std::uint64_t interim = 0) {
...
@@ -68,4 +68,4 @@ constexpr std::uint64_t atom_val(const char* cstr, std::uint64_t interim = 0) {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // ATOM_VAL_HPP
#endif //
CPPA_
ATOM_VAL_HPP
cppa/detail/boxed.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef BOXED_HPP
#ifndef
CPPA_
BOXED_HPP
#define BOXED_HPP
#define
CPPA_
BOXED_HPP
#include "cppa/anything.hpp"
#include "cppa/anything.hpp"
#include "cppa/util/wrapped.hpp"
#include "cppa/util/wrapped.hpp"
...
@@ -78,4 +78,4 @@ struct is_boxed<util::wrapped<T>(*)()> {
...
@@ -78,4 +78,4 @@ struct is_boxed<util::wrapped<T>(*)()> {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // BOXED_HPP
#endif //
CPPA_
BOXED_HPP
cppa/detail/buffer.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef BUFFER_HPP
#ifndef
CPPA_
BUFFER_HPP
#define BUFFER_HPP
#define
CPPA_
BUFFER_HPP
#include <ios> // std::ios_base::failure
#include <ios> // std::ios_base::failure
#include <iostream>
#include <iostream>
...
@@ -173,4 +173,4 @@ class buffer {
...
@@ -173,4 +173,4 @@ class buffer {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // BUFFER_HPP
#endif //
CPPA_
BUFFER_HPP
cppa/detail/channel.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef CHANNEL_HPP
#ifndef C
PPA_C
HANNEL_HPP
#define CHANNEL_HPP
#define C
PPA_C
HANNEL_HPP
#include "cppa/ref_counted.hpp"
#include "cppa/ref_counted.hpp"
...
@@ -44,4 +44,4 @@ struct channel : ref_counted {
...
@@ -44,4 +44,4 @@ struct channel : ref_counted {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // CHANNEL_HPP
#endif // C
PPA_C
HANNEL_HPP
cppa/detail/container_tuple_view.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef CONTAINER_TUPLE_VIEW_HPP
#ifndef C
PPA_C
ONTAINER_TUPLE_VIEW_HPP
#define CONTAINER_TUPLE_VIEW_HPP
#define C
PPA_C
ONTAINER_TUPLE_VIEW_HPP
#include <iostream>
#include <iostream>
...
@@ -89,4 +89,4 @@ class container_tuple_view : public abstract_tuple {
...
@@ -89,4 +89,4 @@ class container_tuple_view : public abstract_tuple {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // CONTAINER_TUPLE_VIEW_HPP
#endif // C
PPA_C
ONTAINER_TUPLE_VIEW_HPP
cppa/detail/decorated_tuple.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef DECORATED_TUPLE_HPP
#ifndef
CPPA_
DECORATED_TUPLE_HPP
#define DECORATED_TUPLE_HPP
#define
CPPA_
DECORATED_TUPLE_HPP
#include <vector>
#include <vector>
#include <algorithm>
#include <algorithm>
...
@@ -144,4 +144,4 @@ struct decorated_cow_tuple_from_type_list< util::type_list<Types...> > {
...
@@ -144,4 +144,4 @@ struct decorated_cow_tuple_from_type_list< util::type_list<Types...> > {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // DECORATED_TUPLE_HPP
#endif //
CPPA_
DECORATED_TUPLE_HPP
cppa/detail/default_uniform_type_info_impl.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef DEFAULT_UNIFORM_TYPE_INFO_IMPL_HPP
#ifndef
CPPA_
DEFAULT_UNIFORM_TYPE_INFO_IMPL_HPP
#define DEFAULT_UNIFORM_TYPE_INFO_IMPL_HPP
#define
CPPA_
DEFAULT_UNIFORM_TYPE_INFO_IMPL_HPP
#include "cppa/anything.hpp"
#include "cppa/anything.hpp"
...
@@ -334,4 +334,4 @@ class default_uniform_type_info_impl : public util::abstract_uniform_type_info<T
...
@@ -334,4 +334,4 @@ class default_uniform_type_info_impl : public util::abstract_uniform_type_info<T
}
}
// namespace detail
}
}
// namespace detail
#endif // DEFAULT_UNIFORM_TYPE_INFO_IMPL_HPP
#endif //
CPPA_
DEFAULT_UNIFORM_TYPE_INFO_IMPL_HPP
cppa/detail/demangle.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef DEMANGLE_HPP
#ifndef
CPPA_
DEMANGLE_HPP
#define DEMANGLE_HPP
#define
CPPA_
DEMANGLE_HPP
#include <string>
#include <string>
...
@@ -39,4 +39,4 @@ std::string demangle(const char* typeid_name);
...
@@ -39,4 +39,4 @@ std::string demangle(const char* typeid_name);
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // DEMANGLE_HPP
#endif //
CPPA_
DEMANGLE_HPP
cppa/detail/disablable_delete.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef DISABLABLE_DELETE_HPP
#ifndef
CPPA_
DISABLABLE_DELETE_HPP
#define DISABLABLE_DELETE_HPP
#define
CPPA_
DISABLABLE_DELETE_HPP
namespace
cppa
{
namespace
detail
{
namespace
cppa
{
namespace
detail
{
...
@@ -52,4 +52,4 @@ class disablable_delete {
...
@@ -52,4 +52,4 @@ class disablable_delete {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // DISABLABLE_DELETE_HPP
#endif //
CPPA_
DISABLABLE_DELETE_HPP
cppa/detail/empty_tuple.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef EMPTY_TUPLE_HPP
#ifndef
CPPA_
EMPTY_TUPLE_HPP
#define EMPTY_TUPLE_HPP
#define
CPPA_
EMPTY_TUPLE_HPP
#include "cppa/detail/abstract_tuple.hpp"
#include "cppa/detail/abstract_tuple.hpp"
...
@@ -54,4 +54,4 @@ class empty_tuple : public abstract_tuple {
...
@@ -54,4 +54,4 @@ class empty_tuple : public abstract_tuple {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // EMPTY_TUPLE_HPP
#endif //
CPPA_
EMPTY_TUPLE_HPP
cppa/detail/filter_result.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef FILTER_RESULT_HPP
#ifndef
CPPA_
FILTER_RESULT_HPP
#define FILTER_RESULT_HPP
#define
CPPA_
FILTER_RESULT_HPP
namespace
cppa
{
namespace
detail
{
namespace
cppa
{
namespace
detail
{
...
@@ -42,4 +42,4 @@ enum filter_result {
...
@@ -42,4 +42,4 @@ enum filter_result {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // FILTER_RESULT_HPP
#endif //
CPPA_
FILTER_RESULT_HPP
cppa/detail/get_behavior.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef GET_BEHAVIOR_HPP
#ifndef
CPPA_
GET_BEHAVIOR_HPP
#define GET_BEHAVIOR_HPP
#define
CPPA_
GET_BEHAVIOR_HPP
#include <type_traits>
#include <type_traits>
...
@@ -167,4 +167,4 @@ scheduled_actor* get_behavior(std::integral_constant<bool,false>,
...
@@ -167,4 +167,4 @@ scheduled_actor* get_behavior(std::integral_constant<bool,false>,
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // GET_BEHAVIOR_HPP
#endif //
CPPA_
GET_BEHAVIOR_HPP
cppa/detail/group_manager.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef GROUP_MANAGER_HPP
#ifndef
CPPA_
GROUP_MANAGER_HPP
#define GROUP_MANAGER_HPP
#define
CPPA_
GROUP_MANAGER_HPP
#include <map>
#include <map>
#include <mutex>
#include <mutex>
...
@@ -64,4 +64,4 @@ class group_manager {
...
@@ -64,4 +64,4 @@ class group_manager {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // GROUP_MANAGER_HPP
#endif //
CPPA_
GROUP_MANAGER_HPP
cppa/detail/implicit_conversions.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef IMPLICIT_CONVERSIONS_HPP
#ifndef
CPPA_
IMPLICIT_CONVERSIONS_HPP
#define IMPLICIT_CONVERSIONS_HPP
#define
CPPA_
IMPLICIT_CONVERSIONS_HPP
#include <string>
#include <string>
#include <type_traits>
#include <type_traits>
...
@@ -82,4 +82,4 @@ struct strip_and_convert {
...
@@ -82,4 +82,4 @@ struct strip_and_convert {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // IMPLICIT_CONVERSIONS_HPP
#endif //
CPPA_
IMPLICIT_CONVERSIONS_HPP
cppa/detail/invokable.hpp
deleted
100644 → 0
View file @
f5767cc0
/******************************************************************************\
* ___ __ *
* /\_ \ __/\ \ *
* \//\ \ /\_\ \ \____ ___ _____ _____ __ *
* \ \ \ \/\ \ \ '__`\ /'___\/\ '__`\/\ '__`\ /'__`\ *
* \_\ \_\ \ \ \ \L\ \/\ \__/\ \ \L\ \ \ \L\ \/\ \L\.\_ *
* /\____\\ \_\ \_,__/\ \____\\ \ ,__/\ \ ,__/\ \__/.\_\ *
* \/____/ \/_/\/___/ \/____/ \ \ \/ \ \ \/ \/__/\/_/ *
* \ \_\ \ \_\ *
* \/_/ \/_/ *
* *
* Copyright (C) 2011, 2012 *
* Dominik Charousset <dominik.charousset@haw-hamburg.de> *
* *
* This file is part of libcppa. *
* libcppa is free software: you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation, either version 3 of the License *
* or (at your option) any later version. *
* *
* libcppa is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with libcppa. If not, see <http://www.gnu.org/licenses/>. *
\******************************************************************************/
#ifndef INVOKABLE_HPP
#define INVOKABLE_HPP
#include <vector>
#include <memory>
#include <cstddef>
#include <cstdint>
#include "cppa/pattern.hpp"
#include "cppa/any_tuple.hpp"
#include "cppa/tuple_cast.hpp"
#include "cppa/util/duration.hpp"
#include "cppa/util/apply_tuple.hpp"
#include "cppa/util/fixed_vector.hpp"
#include "cppa/util/callable_trait.hpp"
#include "cppa/detail/matches.hpp"
namespace
cppa
{
namespace
detail
{
class
invokable
{
invokable
(
const
invokable
&
)
=
delete
;
invokable
&
operator
=
(
const
invokable
&
)
=
delete
;
public:
invokable
*
next
;
inline
invokable
()
:
next
(
nullptr
)
{
}
virtual
~
invokable
();
// Checks whether the types of @p value match the pattern.
virtual
bool
types_match
(
const
any_tuple
&
value
)
const
;
// Checks whether this invokable could be invoked with @p value.
virtual
bool
could_invoke
(
const
any_tuple
&
value
)
const
;
// Type checking.
virtual
bool
invoke
(
any_tuple
&
value
)
const
;
// Suppress type checking.
virtual
bool
unsafe_invoke
(
any_tuple
&
value
)
const
;
};
enum
mapping_policy
{
do_not_map
,
map_to_bool
,
map_to_option
};
template
<
mapping_policy
,
class
Pattern
>
// do_not_map
struct
pattern_policy
{
Pattern
m_pattern
;
template
<
typename
...
Args
>
pattern_policy
(
Args
&&
...
args
)
:
m_pattern
(
std
::
forward
<
Args
>
(
args
)...)
{
}
bool
types_match
(
const
any_tuple
&
value
)
const
{
return
matches_types
(
value
,
m_pattern
);
}
bool
could_invoke
(
const
any_tuple
&
value
)
const
{
return
matches
(
value
,
m_pattern
);
}
template
<
typename
Fun
>
bool
call
(
const
Fun
&
fun
,
any_tuple
&
value
)
const
{
fun
(
value
);
return
true
;
}
template
<
typename
Fun
>
bool
call_unsafe
(
const
Fun
&
fun
,
any_tuple
&
value
)
const
{
fun
(
value
);
return
true
;
}
};
template
<
class
Pattern
>
struct
pattern_policy
<
map_to_option
,
Pattern
>
{
Pattern
m_pattern
;
template
<
typename
...
Args
>
pattern_policy
(
Args
&&
...
args
)
:
m_pattern
(
std
::
forward
<
Args
>
(
args
)...)
{
}
bool
types_match
(
const
any_tuple
&
value
)
const
{
return
matches_types
(
value
,
m_pattern
);
}
bool
could_invoke
(
const
any_tuple
&
value
)
const
{
return
matches
(
value
,
m_pattern
);
}
template
<
typename
Fun
>
bool
call
(
const
Fun
&
fun
,
any_tuple
&
value
)
const
{
auto
result
=
moving_tuple_cast
(
value
,
m_pattern
);
if
(
result
)
{
util
::
apply_tuple
(
fun
,
*
result
);
return
true
;
}
return
false
;
}
template
<
typename
Fun
>
bool
call_unsafe
(
const
Fun
&
fun
,
any_tuple
&
value
)
const
{
auto
result
=
unsafe_tuple_cast
(
value
,
m_pattern
);
if
(
result
)
{
util
::
apply_tuple
(
fun
,
*
result
);
return
true
;
}
return
false
;
}
};
template
<
class
Pattern
>
struct
pattern_policy
<
map_to_bool
,
Pattern
>
{
Pattern
m_pattern
;
template
<
typename
...
Args
>
pattern_policy
(
Args
&&
...
args
)
:
m_pattern
(
std
::
forward
<
Args
>
(
args
)...)
{
}
bool
types_match
(
const
any_tuple
&
value
)
const
{
return
matches_types
(
value
,
m_pattern
);
}
bool
could_invoke
(
const
any_tuple
&
value
)
const
{
return
matches
(
value
,
m_pattern
);
}
template
<
typename
Fun
>
bool
call
(
const
Fun
&
fun
,
any_tuple
&
value
)
const
{
if
(
could_invoke
(
value
))
{
fun
();
return
true
;
}
return
false
;
}
template
<
typename
Fun
>
bool
call_unsafe
(
const
Fun
&
fun
,
any_tuple
&
value
)
const
{
if
(
could_invoke
(
value
))
{
fun
();
return
true
;
}
return
false
;
}
};
struct
dummy_policy
{
inline
bool
types_match
(
const
any_tuple
&
)
const
{
return
true
;
}
inline
bool
could_invoke
(
const
any_tuple
&
)
const
{
return
true
;
}
template
<
typename
Fun
>
inline
bool
call
(
const
Fun
&
fun
,
any_tuple
&
)
const
{
fun
();
return
true
;
}
template
<
typename
Fun
>
inline
bool
call_unsafe
(
const
Fun
&
fun
,
any_tuple
&
)
const
{
fun
();
return
true
;
}
};
template
<
typename
Fun
,
class
Policy
>
struct
invokable_impl
:
public
invokable
{
Fun
m_fun
;
Policy
m_policy
;
template
<
typename
Arg0
,
typename
...
Args
>
invokable_impl
(
Arg0
&&
arg0
,
Args
&&
...
args
)
:
m_fun
(
std
::
forward
<
Arg0
>
(
arg0
))
,
m_policy
(
std
::
forward
<
Args
>
(
args
)...)
{
}
bool
invoke
(
any_tuple
&
value
)
const
{
return
m_policy
.
call
(
m_fun
,
value
);
}
bool
unsafe_invoke
(
any_tuple
&
value
)
const
{
return
m_policy
.
call_unsafe
(
m_fun
,
value
);
}
bool
types_match
(
const
any_tuple
&
value
)
const
{
return
m_policy
.
types_match
(
value
);
}
bool
could_invoke
(
const
any_tuple
&
value
)
const
{
return
m_policy
.
could_invoke
(
value
);
}
};
template
<
class
ArgTypes
>
constexpr
mapping_policy
get_mapping_policy
()
{
return
(
ArgTypes
::
size
==
0
)
?
map_to_bool
:
((
std
::
is_same
<
typename
ArgTypes
::
head
,
any_tuple
>::
value
&&
ArgTypes
::
size
==
1
)
?
do_not_map
:
map_to_option
);
}
template
<
class
Container
>
struct
filtered
;
template
<
typename
...
Ts
>
struct
filtered
<
util
::
type_list
<
Ts
...
>
>
{
typedef
typename
util
::
tl_filter_not
<
util
::
type_list
<
Ts
...
>
,
is_anything
>::
type
types
;
};
template
<
typename
...
Ts
>
struct
filtered
<
pattern
<
Ts
...
>
>
{
typedef
typename
filtered
<
util
::
type_list
<
Ts
...
>>::
types
types
;
};
template
<
typename
Fun
,
class
Pattern
>
struct
select_invokable_impl
{
typedef
typename
util
::
get_arg_types
<
Fun
>::
types
qualified_arg_types
;
typedef
typename
util
::
tl_map
<
qualified_arg_types
,
util
::
rm_ref
>::
type
arg_types
;
static
constexpr
mapping_policy
mp
=
get_mapping_policy
<
arg_types
>
();
typedef
invokable_impl
<
Fun
,
pattern_policy
<
mp
,
Pattern
>
>
type
;
};
template
<
typename
Fun
>
struct
select_invokable_impl
<
Fun
,
pattern
<
anything
>
>
{
typedef
typename
util
::
get_arg_types
<
Fun
>::
types
qualified_arg_types
;
typedef
typename
util
::
tl_map
<
qualified_arg_types
,
util
::
rm_ref
>::
type
arg_types
;
typedef
typename
util
::
rm_ref
<
typename
arg_types
::
head
>::
type
arg0
;
static_assert
(
arg_types
::
size
<
2
,
"functor has too many arguments"
);
static_assert
(
arg_types
::
size
==
0
||
std
::
is_same
<
any_tuple
,
arg0
>::
value
,
"bad signature"
);
typedef
invokable_impl
<
Fun
,
dummy_policy
>
type
;
};
template
<
class
Pattern
,
typename
Fun
>
std
::
unique_ptr
<
invokable
>
get_invokable_impl
(
Fun
&&
fun
,
std
::
unique_ptr
<
value_matcher
>&&
vm
)
{
typedef
std
::
unique_ptr
<
invokable
>
result
;
if
(
vm
)
{
typedef
typename
select_invokable_impl
<
Fun
,
Pattern
>::
type
impl1
;
return
result
{
new
impl1
{
std
::
forward
<
Fun
>
(
fun
),
std
::
move
(
vm
)}};
}
typedef
typename
Pattern
::
types
pattern_types
;
typedef
typename
select_invokable_impl
<
Fun
,
pattern_types
>::
type
impl2
;
return
result
{
new
impl2
{
std
::
forward
<
Fun
>
(
fun
)}};
}
template
<
class
Pattern
,
typename
Fun
>
std
::
unique_ptr
<
invokable
>
get_invokable_impl
(
Fun
&&
fun
)
{
typedef
typename
Pattern
::
types
pattern_types
;
typedef
typename
select_invokable_impl
<
Fun
,
pattern_types
>::
type
impl
;
return
std
::
unique_ptr
<
invokable
>
{
new
impl
(
std
::
forward
<
Fun
>
(
fun
))};
}
}
}
// namespace cppa::detail
#endif // INVOKABLE_HPP
cppa/detail/list_member.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef LIST_MEMBER_HPP
#ifndef
CPPA_
LIST_MEMBER_HPP
#define LIST_MEMBER_HPP
#define
CPPA_
LIST_MEMBER_HPP
#include "cppa/util/is_primitive.hpp"
#include "cppa/util/is_primitive.hpp"
#include "cppa/util/abstract_uniform_type_info.hpp"
#include "cppa/util/abstract_uniform_type_info.hpp"
...
@@ -108,4 +108,4 @@ class list_member : public util::abstract_uniform_type_info<List> {
...
@@ -108,4 +108,4 @@ class list_member : public util::abstract_uniform_type_info<List> {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // LIST_MEMBER_HPP
#endif //
CPPA_
LIST_MEMBER_HPP
cppa/detail/mailman.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef MAILMAN_HPP
#ifndef
CPPA_
MAILMAN_HPP
#define MAILMAN_HPP
#define
CPPA_
MAILMAN_HPP
#include "cppa/any_tuple.hpp"
#include "cppa/any_tuple.hpp"
#include "cppa/actor_proxy.hpp"
#include "cppa/actor_proxy.hpp"
...
@@ -44,4 +44,4 @@ void mailman_loop();
...
@@ -44,4 +44,4 @@ void mailman_loop();
}}
// namespace cppa::detail
}}
// namespace cppa::detail
#endif // MAILMAN_HPP
#endif //
CPPA_
MAILMAN_HPP
cppa/detail/map_member.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef MAP_MEMBER_HPP
#ifndef
CPPA_
MAP_MEMBER_HPP
#define MAP_MEMBER_HPP
#define
CPPA_
MAP_MEMBER_HPP
#include <type_traits>
#include <type_traits>
#include "cppa/detail/pair_member.hpp"
#include "cppa/detail/pair_member.hpp"
...
@@ -147,4 +147,4 @@ class map_member : public util::abstract_uniform_type_info<Map> {
...
@@ -147,4 +147,4 @@ class map_member : public util::abstract_uniform_type_info<Map> {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // MAP_MEMBER_HPP
#endif //
CPPA_
MAP_MEMBER_HPP
cppa/detail/matches.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef MATCHES_HPP
#ifndef
CPPA_
MATCHES_HPP
#define MATCHES_HPP
#define
CPPA_
MATCHES_HPP
#include <numeric>
#include <numeric>
#include "cppa/pattern.hpp"
#include "cppa/pattern.hpp"
...
@@ -432,4 +432,4 @@ inline bool matches_types(const any_tuple& tup, const util::type_list<Ts...>&) {
...
@@ -432,4 +432,4 @@ inline bool matches_types(const any_tuple& tup, const util::type_list<Ts...>&) {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // MATCHES_HPP
#endif //
CPPA_
MATCHES_HPP
cppa/detail/mock_scheduler.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef MOCK_SCHEDULER_HPP
#ifndef
CPPA_
MOCK_SCHEDULER_HPP
#define MOCK_SCHEDULER_HPP
#define
CPPA_
MOCK_SCHEDULER_HPP
#include <thread>
#include <thread>
#include <utility>
#include <utility>
...
@@ -57,4 +57,4 @@ class mock_scheduler : public scheduler {
...
@@ -57,4 +57,4 @@ class mock_scheduler : public scheduler {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // MOCK_SCHEDULER_HPP
#endif //
CPPA_
MOCK_SCHEDULER_HPP
cppa/detail/native_socket.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef NATIVE_SOCKET_HPP
#ifndef
CPPA_
NATIVE_SOCKET_HPP
#define NATIVE_SOCKET_HPP
#define
CPPA_
NATIVE_SOCKET_HPP
#include "cppa/config.hpp"
#include "cppa/config.hpp"
...
@@ -59,4 +59,4 @@ namespace cppa { namespace detail {
...
@@ -59,4 +59,4 @@ namespace cppa { namespace detail {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // NATIVE_SOCKET_HPP
#endif //
CPPA_
NATIVE_SOCKET_HPP
cppa/detail/nestable_receive_policy.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef NESTABLE_RECEIVE_POLICY_HPP
#ifndef
CPPA_
NESTABLE_RECEIVE_POLICY_HPP
#define NESTABLE_RECEIVE_POLICY_HPP
#define
CPPA_
NESTABLE_RECEIVE_POLICY_HPP
#include <list>
#include <list>
#include <memory>
#include <memory>
...
@@ -169,4 +169,4 @@ class nestable_receive_policy {
...
@@ -169,4 +169,4 @@ class nestable_receive_policy {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // NESTABLE_RECEIVE_POLICY_HPP
#endif //
CPPA_
NESTABLE_RECEIVE_POLICY_HPP
cppa/detail/network_manager.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef NETWORK_MANAGER_HPP
#ifndef
CPPA_
NETWORK_MANAGER_HPP
#define NETWORK_MANAGER_HPP
#define
CPPA_
NETWORK_MANAGER_HPP
#include "cppa/detail/post_office.hpp"
#include "cppa/detail/post_office.hpp"
...
@@ -57,4 +57,4 @@ class network_manager {
...
@@ -57,4 +57,4 @@ class network_manager {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // NETWORK_MANAGER_HPP
#endif //
CPPA_
NETWORK_MANAGER_HPP
cppa/detail/object_array.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef OBJECT_ARRAY_HPP
#ifndef
CPPA_
OBJECT_ARRAY_HPP
#define OBJECT_ARRAY_HPP
#define
CPPA_
OBJECT_ARRAY_HPP
#include <vector>
#include <vector>
...
@@ -74,4 +74,4 @@ class object_array : public abstract_tuple {
...
@@ -74,4 +74,4 @@ class object_array : public abstract_tuple {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // OBJECT_ARRAY_HPP
#endif //
CPPA_
OBJECT_ARRAY_HPP
cppa/detail/object_impl.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef OBJECT_IMPL_HPP
#ifndef
CPPA_
OBJECT_IMPL_HPP
#define OBJECT_IMPL_HPP
#define
CPPA_
OBJECT_IMPL_HPP
#include "cppa/object.hpp"
#include "cppa/object.hpp"
...
@@ -61,4 +61,4 @@ struct obj_impl : object {
...
@@ -61,4 +61,4 @@ struct obj_impl : object {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // OBJECT_IMPL_HPP
#endif //
CPPA_
OBJECT_IMPL_HPP
cppa/detail/pair_member.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef PAIR_MEMBER_HPP
#ifndef
CPPA_
PAIR_MEMBER_HPP
#define PAIR_MEMBER_HPP
#define
CPPA_
PAIR_MEMBER_HPP
#include <utility>
#include <utility>
...
@@ -73,4 +73,4 @@ class pair_member : public util::abstract_uniform_type_info<std::pair<T1,T2>> {
...
@@ -73,4 +73,4 @@ class pair_member : public util::abstract_uniform_type_info<std::pair<T1,T2>> {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // PAIR_MEMBER_HPP
#endif //
CPPA_
PAIR_MEMBER_HPP
cppa/detail/post_office.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef POST_OFFICE_HPP
#ifndef
CPPA_
POST_OFFICE_HPP
#define POST_OFFICE_HPP
#define
CPPA_
POST_OFFICE_HPP
#include <memory>
#include <memory>
...
@@ -59,4 +59,4 @@ void post_office_close_socket(native_socket_type sfd);
...
@@ -59,4 +59,4 @@ void post_office_close_socket(native_socket_type sfd);
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // POST_OFFICE_HPP
#endif //
CPPA_
POST_OFFICE_HPP
cppa/detail/primitive_member.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef PRIMITIVE_MEMBER_HPP
#ifndef
CPPA_
PRIMITIVE_MEMBER_HPP
#define PRIMITIVE_MEMBER_HPP
#define
CPPA_
PRIMITIVE_MEMBER_HPP
#include "cppa/serializer.hpp"
#include "cppa/serializer.hpp"
#include "cppa/deserializer.hpp"
#include "cppa/deserializer.hpp"
...
@@ -63,4 +63,4 @@ class primitive_member : public util::abstract_uniform_type_info<T> {
...
@@ -63,4 +63,4 @@ class primitive_member : public util::abstract_uniform_type_info<T> {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // PRIMITIVE_MEMBER_HPP
#endif //
CPPA_
PRIMITIVE_MEMBER_HPP
cppa/detail/projection.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef PROJECTION_HPP
#ifndef
CPPA_
PROJECTION_HPP
#define PROJECTION_HPP
#define
CPPA_
PROJECTION_HPP
#include "cppa/option.hpp"
#include "cppa/option.hpp"
#include "cppa/guard_expr.hpp"
#include "cppa/guard_expr.hpp"
...
@@ -175,4 +175,4 @@ struct projection_from_type_list<ProjectionFuns, util::type_list<Args...> > {
...
@@ -175,4 +175,4 @@ struct projection_from_type_list<ProjectionFuns, util::type_list<Args...> > {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // PROJECTION_HPP
#endif //
CPPA_
PROJECTION_HPP
cppa/detail/pseudo_tuple.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef PSEUDO_TUPLE_HPP
#ifndef
CPPA_
PSEUDO_TUPLE_HPP
#define PSEUDO_TUPLE_HPP
#define
CPPA_
PSEUDO_TUPLE_HPP
#include "cppa/util/at.hpp"
#include "cppa/util/at.hpp"
...
@@ -81,4 +81,4 @@ typename util::at<N, Tn...>::type& get_ref(detail::pseudo_tuple<Tn...>& tv) {
...
@@ -81,4 +81,4 @@ typename util::at<N, Tn...>::type& get_ref(detail::pseudo_tuple<Tn...>& tv) {
}
// namespace cppa
}
// namespace cppa
#endif // PSEUDO_TUPLE_HPP
#endif //
CPPA_
PSEUDO_TUPLE_HPP
cppa/detail/ptype_to_type.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef PTYPE_TO_TYPE_HPP
#ifndef
CPPA_
PTYPE_TO_TYPE_HPP
#define PTYPE_TO_TYPE_HPP
#define
CPPA_
PTYPE_TO_TYPE_HPP
#include <cstdint>
#include <cstdint>
...
@@ -67,4 +67,4 @@ struct ptype_to_type :
...
@@ -67,4 +67,4 @@ struct ptype_to_type :
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // PTYPE_TO_TYPE_HPP
#endif //
CPPA_
PTYPE_TO_TYPE_HPP
cppa/detail/receive_loop_helper.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef RECEIVE_LOOP_HELPER_HPP
#ifndef
CPPA_
RECEIVE_LOOP_HELPER_HPP
#define RECEIVE_LOOP_HELPER_HPP
#define
CPPA_
RECEIVE_LOOP_HELPER_HPP
#include <new>
#include <new>
...
@@ -41,9 +41,6 @@
...
@@ -41,9 +41,6 @@
#include "cppa/util/tbind.hpp"
#include "cppa/util/tbind.hpp"
#include "cppa/util/type_list.hpp"
#include "cppa/util/type_list.hpp"
#include "cppa/detail/invokable.hpp"
namespace
cppa
{
namespace
detail
{
namespace
cppa
{
namespace
detail
{
template
<
typename
Statement
>
template
<
typename
Statement
>
...
@@ -136,4 +133,4 @@ class do_receive_helper {
...
@@ -136,4 +133,4 @@ class do_receive_helper {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // RECEIVE_LOOP_HELPER_HPP
#endif //
CPPA_
RECEIVE_LOOP_HELPER_HPP
cppa/detail/recursive_queue_node.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef RECURSIVE_QUEUE_NODE_HPP
#ifndef
CPPA_
RECURSIVE_QUEUE_NODE_HPP
#define RECURSIVE_QUEUE_NODE_HPP
#define
CPPA_
RECURSIVE_QUEUE_NODE_HPP
#include "cppa/actor.hpp"
#include "cppa/actor.hpp"
#include "cppa/any_tuple.hpp"
#include "cppa/any_tuple.hpp"
...
@@ -61,4 +61,4 @@ struct recursive_queue_node {
...
@@ -61,4 +61,4 @@ struct recursive_queue_node {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // RECURSIVE_QUEUE_NODE_HPP
#endif //
CPPA_
RECURSIVE_QUEUE_NODE_HPP
cppa/detail/ref_counted_impl.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef REF_COUNTED_IMPL_HPP
#ifndef
CPPA_
REF_COUNTED_IMPL_HPP
#define REF_COUNTED_IMPL_HPP
#define
CPPA_
REF_COUNTED_IMPL_HPP
namespace
cppa
{
namespace
detail
{
namespace
cppa
{
namespace
detail
{
...
@@ -58,4 +58,4 @@ class ref_counted_impl {
...
@@ -58,4 +58,4 @@ class ref_counted_impl {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // REF_COUNTED_IMPL_HPP
#endif //
CPPA_
REF_COUNTED_IMPL_HPP
cppa/detail/scheduled_actor_dummy.hpp
View file @
5b69972e
...
@@ -28,15 +28,15 @@
...
@@ -28,15 +28,15 @@
\******************************************************************************/
\******************************************************************************/
#ifndef SCHEDULED_ACTOR_DUMMY_HPP
#ifndef
CPPA_
SCHEDULED_ACTOR_DUMMY_HPP
#define SCHEDULED_ACTOR_DUMMY_HPP
#define
CPPA_
SCHEDULED_ACTOR_DUMMY_HPP
#include "cppa/detail/abstract_scheduled_actor.hpp"
#include "cppa/detail/abstract_scheduled_actor.hpp"
namespace
cppa
{
namespace
detail
{
namespace
cppa
{
namespace
detail
{
struct
scheduled_actor_dummy
:
abstract_scheduled_actor
{
struct
scheduled_actor_dummy
:
abstract_scheduled_actor
{
void
resume
(
util
::
fiber
*
,
scheduler
::
callback
*
);
resume_result
resume
(
util
::
fiber
*
);
void
quit
(
std
::
uint32_t
);
void
quit
(
std
::
uint32_t
);
void
dequeue
(
behavior
&
);
void
dequeue
(
behavior
&
);
void
dequeue
(
partial_function
&
);
void
dequeue
(
partial_function
&
);
...
@@ -50,4 +50,4 @@ struct scheduled_actor_dummy : abstract_scheduled_actor {
...
@@ -50,4 +50,4 @@ struct scheduled_actor_dummy : abstract_scheduled_actor {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // SCHEDULED_ACTOR_DUMMY_HPP
#endif //
CPPA_
SCHEDULED_ACTOR_DUMMY_HPP
cppa/detail/serialize_tuple.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef SERIALIZE_TUPLE_HPP
#ifndef
CPPA_
SERIALIZE_TUPLE_HPP
#define SERIALIZE_TUPLE_HPP
#define
CPPA_
SERIALIZE_TUPLE_HPP
#include <cstddef>
#include <cstddef>
...
@@ -58,4 +58,4 @@ struct serialize_tuple<util::type_list<>, Pos> {
...
@@ -58,4 +58,4 @@ struct serialize_tuple<util::type_list<>, Pos> {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // SERIALIZE_TUPLE_HPP
#endif //
CPPA_
SERIALIZE_TUPLE_HPP
cppa/detail/singleton_manager.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef SINGLETON_MANAGER_HPP
#ifndef
CPPA_
SINGLETON_MANAGER_HPP
#define SINGLETON_MANAGER_HPP
#define
CPPA_
SINGLETON_MANAGER_HPP
namespace
cppa
{
namespace
cppa
{
...
@@ -74,4 +74,4 @@ class singleton_manager {
...
@@ -74,4 +74,4 @@ class singleton_manager {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // SINGLETON_MANAGER_HPP
#endif //
CPPA_
SINGLETON_MANAGER_HPP
cppa/detail/swap_bytes.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef SWAP_BYTES_HPP
#ifndef
CPPA_
SWAP_BYTES_HPP
#define SWAP_BYTES_HPP
#define
CPPA_
SWAP_BYTES_HPP
#include <cstddef>
#include <cstddef>
...
@@ -68,4 +68,4 @@ inline T swap_bytes(T what) {
...
@@ -68,4 +68,4 @@ inline T swap_bytes(T what) {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // SWAP_BYTES_HPP
#endif //
CPPA_
SWAP_BYTES_HPP
cppa/detail/tdata.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef TDATA_HPP
#ifndef
CPPA_
TDATA_HPP
#define TDATA_HPP
#define
CPPA_
TDATA_HPP
#include <typeinfo>
#include <typeinfo>
#include <functional>
#include <functional>
...
@@ -439,4 +439,4 @@ typename util::at<N, Tn...>::type& get_ref(detail::tdata<Tn...>& tv) {
...
@@ -439,4 +439,4 @@ typename util::at<N, Tn...>::type& get_ref(detail::tdata<Tn...>& tv) {
}
// namespace cppa
}
// namespace cppa
#endif // TDATA_HPP
#endif //
CPPA_
TDATA_HPP
cppa/detail/thread_pool_scheduler.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef THREAD_POOL_SCHEDULER_HPP
#ifndef
CPPA_
THREAD_POOL_SCHEDULER_HPP
#define THREAD_POOL_SCHEDULER_HPP
#define
CPPA_
THREAD_POOL_SCHEDULER_HPP
#include <thread>
#include <thread>
...
@@ -77,4 +77,4 @@ class thread_pool_scheduler : public scheduler {
...
@@ -77,4 +77,4 @@ class thread_pool_scheduler : public scheduler {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // THREAD_POOL_SCHEDULER_HPP
#endif //
CPPA_
THREAD_POOL_SCHEDULER_HPP
cppa/detail/to_uniform_name.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef TO_UNIFORM_NAME_HPP
#ifndef
CPPA_
TO_UNIFORM_NAME_HPP
#define TO_UNIFORM_NAME_HPP
#define
CPPA_
TO_UNIFORM_NAME_HPP
#include <string>
#include <string>
#include <typeinfo>
#include <typeinfo>
...
@@ -41,4 +41,4 @@ std::string to_uniform_name(const std::type_info& tinfo);
...
@@ -41,4 +41,4 @@ std::string to_uniform_name(const std::type_info& tinfo);
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // TO_UNIFORM_NAME_HPP
#endif //
CPPA_
TO_UNIFORM_NAME_HPP
cppa/detail/tuple_cast_impl.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef TUPLE_CAST_IMPL_HPP
#ifndef
CPPA_
TUPLE_CAST_IMPL_HPP
#define TUPLE_CAST_IMPL_HPP
#define
CPPA_
TUPLE_CAST_IMPL_HPP
#include "cppa/pattern.hpp"
#include "cppa/pattern.hpp"
#include "cppa/any_tuple.hpp"
#include "cppa/any_tuple.hpp"
...
@@ -179,4 +179,4 @@ struct tuple_cast_impl<wildcard_position::leading, Result, T...> {
...
@@ -179,4 +179,4 @@ struct tuple_cast_impl<wildcard_position::leading, Result, T...> {
}
}
}
}
#endif // TUPLE_CAST_IMPL_HPP
#endif //
CPPA_
TUPLE_CAST_IMPL_HPP
cppa/detail/tuple_iterator.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef TUPLE_ITERATOR_HPP
#ifndef
CPPA_
TUPLE_ITERATOR_HPP
#define TUPLE_ITERATOR_HPP
#define
CPPA_
TUPLE_ITERATOR_HPP
#include <cstddef>
#include <cstddef>
...
@@ -109,4 +109,4 @@ class tuple_iterator {
...
@@ -109,4 +109,4 @@ class tuple_iterator {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // TUPLE_ITERATOR_HPP
#endif //
CPPA_
TUPLE_ITERATOR_HPP
cppa/detail/tuple_vals.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef TUPLE_VALS_HPP
#ifndef
CPPA_
TUPLE_VALS_HPP
#define TUPLE_VALS_HPP
#define
CPPA_
TUPLE_VALS_HPP
#include <stdexcept>
#include <stdexcept>
...
@@ -137,4 +137,4 @@ struct tuple_vals_from_type_list< util::type_list<Types...> > {
...
@@ -137,4 +137,4 @@ struct tuple_vals_from_type_list< util::type_list<Types...> > {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // TUPLE_VALS_HPP
#endif //
CPPA_
TUPLE_VALS_HPP
cppa/detail/tuple_view.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef TUPLE_VIEW_HPP
#ifndef
CPPA_
TUPLE_VIEW_HPP
#define TUPLE_VIEW_HPP
#define
CPPA_
TUPLE_VIEW_HPP
#include "cppa/util/static_foreach.hpp"
#include "cppa/util/static_foreach.hpp"
...
@@ -123,4 +123,4 @@ types_array<ElementTypes...> tuple_view<ElementTypes...>::m_types;
...
@@ -123,4 +123,4 @@ types_array<ElementTypes...> tuple_view<ElementTypes...>::m_types;
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // TUPLE_VIEW_HPP
#endif //
CPPA_
TUPLE_VIEW_HPP
cppa/detail/type_to_ptype.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef TYPE_TO_PTYPE_HPP
#ifndef
CPPA_
TYPE_TO_PTYPE_HPP
#define TYPE_TO_PTYPE_HPP
#define
CPPA_
TYPE_TO_PTYPE_HPP
#include <string>
#include <string>
#include <cstdint>
#include <cstdint>
...
@@ -93,4 +93,4 @@ struct type_to_ptype {
...
@@ -93,4 +93,4 @@ struct type_to_ptype {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // TYPE_TO_PTYPE_HPP
#endif //
CPPA_
TYPE_TO_PTYPE_HPP
cppa/detail/types_array.hpp
View file @
5b69972e
#ifndef TYPES_ARRAY_HPP
/******************************************************************************\
#define TYPES_ARRAY_HPP
* ___ __ *
* /\_ \ __/\ \ *
* \//\ \ /\_\ \ \____ ___ _____ _____ __ *
* \ \ \ \/\ \ \ '__`\ /'___\/\ '__`\/\ '__`\ /'__`\ *
* \_\ \_\ \ \ \ \L\ \/\ \__/\ \ \L\ \ \ \L\ \/\ \L\.\_ *
* /\____\\ \_\ \_,__/\ \____\\ \ ,__/\ \ ,__/\ \__/.\_\ *
* \/____/ \/_/\/___/ \/____/ \ \ \/ \ \ \/ \/__/\/_/ *
* \ \_\ \ \_\ *
* \/_/ \/_/ *
* *
* Copyright (C) 2011, 2012 *
* Dominik Charousset <dominik.charousset@haw-hamburg.de> *
* *
* This file is part of libcppa. *
* libcppa is free software: you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation, either version 3 of the License *
* or (at your option) any later version. *
* *
* libcppa is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with libcppa. If not, see <http://www.gnu.org/licenses/>. *
\******************************************************************************/
#ifndef CPPA_TYPES_ARRAY_HPP
#define CPPA_TYPES_ARRAY_HPP
#include <typeinfo>
#include <typeinfo>
...
@@ -163,4 +193,4 @@ const std::type_info* static_type_list<T...>::list = &typeid(util::type_list<T..
...
@@ -163,4 +193,4 @@ const std::type_info* static_type_list<T...>::list = &typeid(util::type_list<T..
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // TYPES_ARRAY_HPP
#endif //
CPPA_
TYPES_ARRAY_HPP
cppa/detail/unboxed.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef UNBOXED_HPP
#ifndef
CPPA_
UNBOXED_HPP
#define UNBOXED_HPP
#define
CPPA_
UNBOXED_HPP
#include <memory>
#include <memory>
...
@@ -70,4 +70,4 @@ struct unboxed<std::unique_ptr<util::guard<T>>> {
...
@@ -70,4 +70,4 @@ struct unboxed<std::unique_ptr<util::guard<T>>> {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // UNBOXED_HPP
#endif //
CPPA_
UNBOXED_HPP
cppa/detail/uniform_type_info_map.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef UNIFORM_TYPE_INFO_MAP_HPP
#ifndef
CPPA_
UNIFORM_TYPE_INFO_MAP_HPP
#define UNIFORM_TYPE_INFO_MAP_HPP
#define
CPPA_
UNIFORM_TYPE_INFO_MAP_HPP
#include <set>
#include <set>
#include <string>
#include <string>
...
@@ -90,4 +90,4 @@ class uniform_type_info_map {
...
@@ -90,4 +90,4 @@ class uniform_type_info_map {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // UNIFORM_TYPE_INFO_MAP_HPP
#endif //
CPPA_
UNIFORM_TYPE_INFO_MAP_HPP
cppa/detail/value_guard.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef VALUE_GUARD_HPP
#ifndef
CPPA_
VALUE_GUARD_HPP
#define VALUE_GUARD_HPP
#define
CPPA_
VALUE_GUARD_HPP
#include <type_traits>
#include <type_traits>
...
@@ -131,4 +131,4 @@ class value_guard {
...
@@ -131,4 +131,4 @@ class value_guard {
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // VALUE_GUARD_HPP
#endif //
CPPA_
VALUE_GUARD_HPP
cppa/detail/yield_interface.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef YIELD_INTERFACE_HPP
#ifndef
CPPA_
YIELD_INTERFACE_HPP
#define YIELD_INTERFACE_HPP
#define
CPPA_
YIELD_INTERFACE_HPP
#include "cppa/util/fiber.hpp"
#include "cppa/util/fiber.hpp"
...
@@ -54,4 +54,4 @@ yield_state call(util::fiber* what, util::fiber* from);
...
@@ -54,4 +54,4 @@ yield_state call(util::fiber* what, util::fiber* from);
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // YIELD_INTERFACE_HPP
#endif //
CPPA_
YIELD_INTERFACE_HPP
cppa/either.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef EITHER_HPP
#ifndef
CPPA_
EITHER_HPP
#define EITHER_HPP
#define
CPPA_
EITHER_HPP
#include <new>
#include <new>
#include <utility>
#include <utility>
...
@@ -252,4 +252,4 @@ bool operator!=(const Right& lhs, const either<Left, Right>& rhs) {
...
@@ -252,4 +252,4 @@ bool operator!=(const Right& lhs, const either<Left, Right>& rhs) {
}
// namespace cppa
}
// namespace cppa
#endif // EITHER_HPP
#endif //
CPPA_
EITHER_HPP
cppa/event_based_actor.hpp
View file @
5b69972e
...
@@ -28,17 +28,42 @@
...
@@ -28,17 +28,42 @@
\******************************************************************************/
\******************************************************************************/
#ifndef EVENT_BASED_ACTOR_HPP
#ifndef
CPPA_
EVENT_BASED_ACTOR_HPP
#define EVENT_BASED_ACTOR_HPP
#define
CPPA_
EVENT_BASED_ACTOR_HPP
#include "cppa/behavior.hpp"
#include "cppa/behavior.hpp"
#include "cppa/event_based_actor_base.hpp"
#include "cppa/event_based_actor_base.hpp"
namespace
cppa
{
namespace
cppa
{
#ifdef CPPA_DOCUMENTATION
/**
/**
* @brief Base class for non-stacked event-based actor implementations.
* @brief Base class for non-stacked event-based actor implementations.
*/
*/
class
event_based_actor
:
public
scheduled_actor
{
protected:
/**
* @brief Sets the actor's behavior to @p bhvr.
* @note @p bhvr is owned by the caller and must remain valid until
* the actor terminates.
* @note The recommended way of using this member function is to pass
* a pointer to a member variable.
*/
void
become
(
behavior
*
bhvr
);
/**
* @brief Sets the actor's behavior.
*/
template
<
typename
Arg0
,
typename
...
Args
>
void
become
(
Arg0
&&
arg0
,
Args
&&
...
args
)
:
};
#else
class
event_based_actor
:
public
event_based_actor_base
<
event_based_actor
>
{
class
event_based_actor
:
public
event_based_actor_base
<
event_based_actor
>
{
friend
class
event_based_actor_base
<
event_based_actor
>
;
friend
class
event_based_actor_base
<
event_based_actor
>
;
...
@@ -52,10 +77,12 @@ class event_based_actor : public event_based_actor_base<event_based_actor> {
...
@@ -52,10 +77,12 @@ class event_based_actor : public event_based_actor_base<event_based_actor> {
event_based_actor
();
event_based_actor
();
v
oid
quit
(
std
::
uint32_t
reason
);
v
irtual
void
quit
(
std
::
uint32_t
reason
=
exit_reason
::
normal
);
};
};
#endif
}
// namespace cppa
}
// namespace cppa
#endif // EVENT_BASED_ACTOR_HPP
#endif //
CPPA_
EVENT_BASED_ACTOR_HPP
cppa/event_based_actor_base.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef
EVENT_BASED_ACTOR_MIXIN
_HPP
#ifndef
CPPA_EVENT_BASED_ACTOR_BASE
_HPP
#define
EVENT_BASED_ACTOR_MIXIN
_HPP
#define
CPPA_EVENT_BASED_ACTOR_BASE
_HPP
#include "cppa/behavior.hpp"
#include "cppa/behavior.hpp"
#include "cppa/abstract_event_based_actor.hpp"
#include "cppa/abstract_event_based_actor.hpp"
...
@@ -71,4 +71,4 @@ class event_based_actor_base : public abstract_event_based_actor {
...
@@ -71,4 +71,4 @@ class event_based_actor_base : public abstract_event_based_actor {
}
// namespace cppa
}
// namespace cppa
#endif //
EVENT_BASED_ACTOR_MIXIN
_HPP
#endif //
CPPA_EVENT_BASED_ACTOR_BASE
_HPP
cppa/exception.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef EXCEPTION_HPP
#ifndef
CPPA_
EXCEPTION_HPP
#define EXCEPTION_HPP
#define
CPPA_
EXCEPTION_HPP
#include <string>
#include <string>
#include <cstdint>
#include <cstdint>
...
@@ -140,4 +140,4 @@ inline int bind_failure::error_code() const throw() {
...
@@ -140,4 +140,4 @@ inline int bind_failure::error_code() const throw() {
}
// namespace cppa
}
// namespace cppa
#endif // EXCEPTION_HPP
#endif //
CPPA_
EXCEPTION_HPP
cppa/exit_reason.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef EXIT_REASON_HPP
#ifndef
CPPA_
EXIT_REASON_HPP
#define EXIT_REASON_HPP
#define
CPPA_
EXIT_REASON_HPP
#include <cstdint>
#include <cstdint>
...
@@ -78,4 +78,4 @@ static constexpr std::uint32_t user_defined = 0x10000;
...
@@ -78,4 +78,4 @@ static constexpr std::uint32_t user_defined = 0x10000;
}
}
// namespace cppa::exit_reason
}
}
// namespace cppa::exit_reason
#endif // EXIT_REASON_HPP
#endif //
CPPA_
EXIT_REASON_HPP
cppa/from_string.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef FROM_STRING_HPP
#ifndef
CPPA_
FROM_STRING_HPP
#define FROM_STRING_HPP
#define
CPPA_
FROM_STRING_HPP
#include <string>
#include <string>
#include <typeinfo>
#include <typeinfo>
...
@@ -73,4 +73,4 @@ T from_string(const std::string& what) {
...
@@ -73,4 +73,4 @@ T from_string(const std::string& what) {
}
// namespace cppa
}
// namespace cppa
#endif // FROM_STRING_HPP
#endif //
CPPA_
FROM_STRING_HPP
cppa/fsm_actor.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef FSM_ACTOR_HPP
#ifndef
CPPA_
FSM_ACTOR_HPP
#define FSM_ACTOR_HPP
#define
CPPA_
FSM_ACTOR_HPP
#include <type_traits>
#include <type_traits>
...
@@ -61,4 +61,4 @@ class fsm_actor : public event_based_actor {
...
@@ -61,4 +61,4 @@ class fsm_actor : public event_based_actor {
}
// namespace cppa
}
// namespace cppa
#endif // FSM_ACTOR_HPP
#endif //
CPPA_
FSM_ACTOR_HPP
cppa/get.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef GET_HPP
#ifndef
CPPA_
GET_HPP
#define GET_HPP
#define
CPPA_
GET_HPP
// functions are documented in the implementation headers
// functions are documented in the implementation headers
#ifndef CPPA_DOCUMENTATION
#ifndef CPPA_DOCUMENTATION
...
@@ -83,4 +83,4 @@ typename util::at<N, Ts...>::type get(const util::type_list<Ts...>&) {
...
@@ -83,4 +83,4 @@ typename util::at<N, Ts...>::type get(const util::type_list<Ts...>&) {
}
// namespace cppa
}
// namespace cppa
#endif // CPPA_DOCUMENTATION
#endif // CPPA_DOCUMENTATION
#endif // GET_HPP
#endif //
CPPA_
GET_HPP
cppa/group.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef GROUP_HPP
#ifndef
CPPA_
GROUP_HPP
#define GROUP_HPP
#define
CPPA_
GROUP_HPP
#include <string>
#include <string>
#include <memory>
#include <memory>
...
@@ -172,4 +172,4 @@ typedef intrusive_ptr<group> group_ptr;
...
@@ -172,4 +172,4 @@ typedef intrusive_ptr<group> group_ptr;
}
// namespace cppa
}
// namespace cppa
#endif // GROUP_HPP
#endif //
CPPA_
GROUP_HPP
cppa/guard_expr.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef GUARD_EXPR_HPP
#ifndef
CPPA_
GUARD_EXPR_HPP
#define GUARD_EXPR_HPP
#define
CPPA_
GUARD_EXPR_HPP
#include <string>
#include <string>
#include <vector>
#include <vector>
...
@@ -742,4 +742,4 @@ constexpr guard_placeholder<8> _x9;
...
@@ -742,4 +742,4 @@ constexpr guard_placeholder<8> _x9;
}
// namespace cppa
}
// namespace cppa
#endif // GUARD_EXPR_HPP
#endif //
CPPA_
GUARD_EXPR_HPP
cppa/intrusive/forward_iterator.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef ITERATOR_HPP
#ifndef
CPPA_FORWARD_
ITERATOR_HPP
#define ITERATOR_HPP
#define
CPPA_FORWARD_
ITERATOR_HPP
#include <iterator>
#include <iterator>
...
@@ -122,7 +122,7 @@ inline bool operator==(const T* lhs, const forward_iterator<T>& rhs) {
...
@@ -122,7 +122,7 @@ inline bool operator==(const T* lhs, const forward_iterator<T>& rhs) {
* @relates forward_iterator
* @relates forward_iterator
*/
*/
template
<
class
T
>
template
<
class
T
>
inline
bool
operator
==
(
const
forward_iterator
<
T
>&
lhs
,
decltype
(
nullptr
)
)
{
inline
bool
operator
==
(
const
forward_iterator
<
T
>&
lhs
,
std
::
nullptr_t
)
{
return
lhs
.
ptr
()
==
nullptr
;
return
lhs
.
ptr
()
==
nullptr
;
}
}
...
@@ -130,7 +130,7 @@ inline bool operator==(const forward_iterator<T>& lhs, decltype(nullptr)) {
...
@@ -130,7 +130,7 @@ inline bool operator==(const forward_iterator<T>& lhs, decltype(nullptr)) {
* @relates forward_iterator
* @relates forward_iterator
*/
*/
template
<
class
T
>
template
<
class
T
>
inline
bool
operator
==
(
decltype
(
nullptr
)
,
const
forward_iterator
<
T
>&
rhs
)
{
inline
bool
operator
==
(
std
::
nullptr_t
,
const
forward_iterator
<
T
>&
rhs
)
{
return
rhs
.
ptr
()
==
nullptr
;
return
rhs
.
ptr
()
==
nullptr
;
}
}
...
@@ -163,7 +163,7 @@ inline bool operator!=(const T* lhs, const forward_iterator<T>& rhs) {
...
@@ -163,7 +163,7 @@ inline bool operator!=(const T* lhs, const forward_iterator<T>& rhs) {
* @relates forward_iterator
* @relates forward_iterator
*/
*/
template
<
class
T
>
template
<
class
T
>
inline
bool
operator
!=
(
const
forward_iterator
<
T
>&
lhs
,
decltype
(
nullptr
)
)
{
inline
bool
operator
!=
(
const
forward_iterator
<
T
>&
lhs
,
std
::
nullptr_t
)
{
return
!
(
lhs
==
nullptr
);
return
!
(
lhs
==
nullptr
);
}
}
...
@@ -171,11 +171,11 @@ inline bool operator!=(const forward_iterator<T>& lhs, decltype(nullptr)) {
...
@@ -171,11 +171,11 @@ inline bool operator!=(const forward_iterator<T>& lhs, decltype(nullptr)) {
* @relates forward_iterator
* @relates forward_iterator
*/
*/
template
<
class
T
>
template
<
class
T
>
inline
bool
operator
!=
(
decltype
(
nullptr
)
,
const
forward_iterator
<
T
>&
rhs
)
{
inline
bool
operator
!=
(
std
::
nullptr_t
,
const
forward_iterator
<
T
>&
rhs
)
{
return
!
(
nullptr
==
rhs
);
return
!
(
nullptr
==
rhs
);
}
}
}
}
// namespace cppa::intrusive
}
}
// namespace cppa::intrusive
#endif // ITERATOR_HPP
#endif //
CPPA_FORWARD_
ITERATOR_HPP
cppa/intrusive/single_reader_queue.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef SINGLE_READER_QUEUE_HPP
#ifndef
CPPA_
SINGLE_READER_QUEUE_HPP
#define SINGLE_READER_QUEUE_HPP
#define
CPPA_
SINGLE_READER_QUEUE_HPP
#include <list>
#include <list>
#include <mutex>
#include <mutex>
...
@@ -200,4 +200,4 @@ class single_reader_queue {
...
@@ -200,4 +200,4 @@ class single_reader_queue {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // SINGLE_READER_QUEUE_HPP
#endif //
CPPA_
SINGLE_READER_QUEUE_HPP
cppa/intrusive/singly_linked_list.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef SINGLY_LINKED_LIST_HPP
#ifndef
CPPA_
SINGLY_LINKED_LIST_HPP
#define SINGLY_LINKED_LIST_HPP
#define
CPPA_
SINGLY_LINKED_LIST_HPP
#include <cstddef>
#include <cstddef>
#include <utility>
#include <utility>
...
@@ -354,4 +354,4 @@ class singly_linked_list {
...
@@ -354,4 +354,4 @@ class singly_linked_list {
}
}
// namespace cppa::intrusive
}
}
// namespace cppa::intrusive
#endif // SINGLY_LINKED_LIST_HPP
#endif //
CPPA_
SINGLY_LINKED_LIST_HPP
cppa/intrusive_ptr.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef INTRUSIVE_PTR_HPP
#ifndef
CPPA_
INTRUSIVE_PTR_HPP
#define INTRUSIVE_PTR_HPP
#define
CPPA_
INTRUSIVE_PTR_HPP
#include <cstddef>
#include <cstddef>
#include <algorithm>
#include <algorithm>
...
@@ -52,85 +52,76 @@ struct convertible {
...
@@ -52,85 +52,76 @@ struct convertible {
* @relates ref_counted
* @relates ref_counted
*/
*/
template
<
typename
T
>
template
<
typename
T
>
class
intrusive_ptr
:
util
::
comparable
<
intrusive_ptr
<
T
>
,
const
T
*>
,
class
intrusive_ptr
:
util
::
comparable
<
intrusive_ptr
<
T
>
>
,
util
::
comparable
<
intrusive_ptr
<
T
>
>
{
util
::
comparable
<
intrusive_ptr
<
T
>
,
const
T
*>
,
util
::
comparable
<
intrusive_ptr
<
T
>
,
std
::
nullptr_t
>
{
public:
public:
constexpr
intrusive_ptr
()
:
m_ptr
(
nullptr
)
{
}
typedef
T
*
pointer
;
typedef
const
T
*
const_pointer
;
typedef
T
element_type
;
typedef
T
&
reference
;
typedef
const
T
&
const_reference
;
intrusive_ptr
(
T
*
raw_ptr
)
{
set_ptr
(
raw_ptr
);
}
constexpr
intrusive_ptr
()
:
m_ptr
(
nullptr
)
{
}
intrusive_ptr
(
const
intrusive_ptr
&
other
)
{
set_ptr
(
other
.
m
_ptr
);
}
intrusive_ptr
(
pointer
raw_ptr
)
{
set_ptr
(
raw
_ptr
);
}
intrusive_ptr
(
intrusive_ptr
&&
other
)
:
m_ptr
(
other
.
release
())
{
}
intrusive_ptr
(
intrusive_ptr
&&
other
)
:
m_ptr
(
other
.
release
())
{
}
// enables "actor_ptr s = self"
intrusive_ptr
(
const
intrusive_ptr
&
other
)
{
set_ptr
(
other
.
get
());
}
template
<
typename
From
>
intrusive_ptr
(
const
convertible
<
From
,
T
*>&
from
)
{
set_ptr
(
from
.
convert
());
}
template
<
typename
Y
>
template
<
typename
Y
>
intrusive_ptr
(
const
intrusive_ptr
<
Y
>&
other
)
{
intrusive_ptr
(
intrusive_ptr
<
Y
>
other
)
:
m_ptr
(
other
.
release
()
)
{
static_assert
(
std
::
is_convertible
<
Y
*
,
T
*>::
value
,
static_assert
(
std
::
is_convertible
<
Y
*
,
T
*>::
value
,
"Y* is not assignable to T*"
);
"Y* is not assignable to T*"
);
set_ptr
(
const_cast
<
Y
*>
(
other
.
get
()));
}
}
template
<
typename
Y
>
// enables "actor_ptr s = self"
intrusive_ptr
(
intrusive_ptr
<
Y
>&&
other
)
:
m_ptr
(
other
.
release
())
{
template
<
typename
From
>
static_assert
(
std
::
is_convertible
<
Y
*
,
T
*>::
value
,
intrusive_ptr
(
const
convertible
<
From
,
pointer
>&
from
)
{
"Y* is not assignable to T*"
);
set_ptr
(
from
.
convert
()
);
}
}
~
intrusive_ptr
()
{
~
intrusive_ptr
()
{
if
(
m_ptr
&&
!
m_ptr
->
deref
())
{
if
(
m_ptr
&&
!
m_ptr
->
deref
())
delete
m_ptr
;
delete
m_ptr
;
}
}
}
inline
T
*
get
()
{
return
m_ptr
;
}
inline
void
swap
(
intrusive_ptr
&
other
)
{
std
::
swap
(
m_ptr
,
other
.
m_ptr
);
inline
const
T
*
get
()
const
{
return
m_ptr
;
}
}
T
*
release
()
{
pointer
release
()
{
auto
result
=
m_ptr
;
auto
result
=
m_ptr
;
m_ptr
=
nullptr
;
m_ptr
=
nullptr
;
return
result
;
return
result
;
}
}
inline
void
swap
(
intrusive_ptr
&
other
)
{
void
reset
(
pointer
new_value
=
nullptr
)
{
std
::
swap
(
m_ptr
,
other
.
m_ptr
);
}
void
reset
(
T
*
new_value
=
nullptr
)
{
if
(
m_ptr
&&
!
m_ptr
->
deref
())
delete
m_ptr
;
if
(
m_ptr
&&
!
m_ptr
->
deref
())
delete
m_ptr
;
set_ptr
(
new_value
);
set_ptr
(
new_value
);
}
}
intrusive_ptr
&
operator
=
(
T
*
ptr
)
{
intrusive_ptr
&
operator
=
(
pointer
ptr
)
{
reset
(
ptr
);
reset
(
ptr
);
return
*
this
;
return
*
this
;
}
}
intrusive_ptr
&
operator
=
(
const
intrusive_ptr
&
other
)
{
intrusive_ptr
&
operator
=
(
intrusive_ptr
&&
other
)
{
intrusive_ptr
tmp
(
other
);
swap
(
other
);
swap
(
tmp
);
return
*
this
;
return
*
this
;
}
}
intrusive_ptr
&
operator
=
(
intrusive_ptr
&
&
other
)
{
intrusive_ptr
&
operator
=
(
const
intrusive_ptr
&
other
)
{
reset
()
;
intrusive_ptr
tmp
{
other
}
;
swap
(
other
);
swap
(
tmp
);
return
*
this
;
return
*
this
;
}
}
template
<
typename
Y
>
template
<
typename
Y
>
intrusive_ptr
&
operator
=
(
const
intrusive_ptr
<
Y
>&
other
)
{
intrusive_ptr
&
operator
=
(
intrusive_ptr
<
Y
>
other
)
{
static_assert
(
std
::
is_convertible
<
Y
*
,
T
*>::
value
,
intrusive_ptr
tmp
{
std
::
move
(
other
)};
"Y* is not assignable to T*"
);
intrusive_ptr
tmp
(
other
);
swap
(
tmp
);
swap
(
tmp
);
return
*
this
;
return
*
this
;
}
}
...
@@ -141,26 +132,13 @@ class intrusive_ptr : util::comparable<intrusive_ptr<T>, const T*>,
...
@@ -141,26 +132,13 @@ class intrusive_ptr : util::comparable<intrusive_ptr<T>, const T*>,
return
*
this
;
return
*
this
;
}
}
template
<
typename
Y
>
inline
pointer
get
()
const
{
return
m_ptr
;
}
intrusive_ptr
&
operator
=
(
intrusive_ptr
<
Y
>&&
other
)
{
inline
pointer
operator
->
()
const
{
return
m_ptr
;
}
static_assert
(
std
::
is_convertible
<
Y
*
,
T
*>::
value
,
inline
reference
operator
*
()
const
{
return
*
m_ptr
;
}
"Y* is not assignable to T*"
);
reset
();
m_ptr
=
other
.
release
();
return
*
this
;
}
inline
T
&
operator
*
()
{
return
*
m_ptr
;
}
inline
T
*
operator
->
()
{
return
m_ptr
;
}
inline
const
T
&
operator
*
()
const
{
return
*
m_ptr
;
}
inline
const
T
*
operator
->
()
const
{
return
m_ptr
;
}
inline
explicit
operator
bool
()
const
{
return
m_ptr
!=
nullptr
;
}
inline
explicit
operator
bool
()
const
{
return
m_ptr
!=
nullptr
;
}
inline
ptrdiff_t
compare
(
const
T
*
ptr
)
const
{
inline
ptrdiff_t
compare
(
const
_pointer
ptr
)
const
{
return
static_cast
<
ptrdiff_t
>
(
get
()
-
ptr
);
return
static_cast
<
ptrdiff_t
>
(
get
()
-
ptr
);
}
}
...
@@ -168,59 +146,31 @@ class intrusive_ptr : util::comparable<intrusive_ptr<T>, const T*>,
...
@@ -168,59 +146,31 @@ class intrusive_ptr : util::comparable<intrusive_ptr<T>, const T*>,
return
compare
(
other
.
get
());
return
compare
(
other
.
get
());
}
}
inline
ptrdiff_t
compare
(
std
::
nullptr_t
)
const
{
return
reinterpret_cast
<
ptrdiff_t
>
(
get
());
}
template
<
class
C
>
template
<
class
C
>
intrusive_ptr
<
C
>
downcast
()
const
{
intrusive_ptr
<
C
>
downcast
()
const
{
return
(
m_ptr
)
?
dynamic_cast
<
C
*>
(
const_cast
<
T
*>
(
m_ptr
))
:
nullptr
;
return
(
m_ptr
)
?
dynamic_cast
<
C
*>
(
get
(
))
:
nullptr
;
}
}
template
<
class
C
>
template
<
class
C
>
intrusive_ptr
<
C
>
upcast
()
const
{
intrusive_ptr
<
C
>
upcast
()
const
{
return
(
m_ptr
)
?
static_cast
<
C
*>
(
const_cast
<
T
*>
(
m_ptr
))
:
nullptr
;
return
(
m_ptr
)
?
static_cast
<
C
*>
(
get
(
))
:
nullptr
;
}
}
private:
private:
T
*
m_ptr
;
pointer
m_ptr
;
inline
void
set_ptr
(
T
*
raw_ptr
)
{
inline
void
set_ptr
(
pointer
raw_ptr
)
{
m_ptr
=
raw_ptr
;
m_ptr
=
raw_ptr
;
if
(
raw_ptr
)
raw_ptr
->
ref
();
if
(
raw_ptr
)
raw_ptr
->
ref
();
}
}
};
};
/**
* @relates intrusive_ptr
*/
template
<
typename
X
>
inline
bool
operator
==
(
const
intrusive_ptr
<
X
>&
ptr
,
decltype
(
nullptr
))
{
return
ptr
.
get
()
==
nullptr
;
}
/**
* @relates intrusive_ptr
*/
template
<
typename
X
>
inline
bool
operator
==
(
decltype
(
nullptr
),
const
intrusive_ptr
<
X
>&
ptr
)
{
return
ptr
.
get
()
==
nullptr
;
}
/**
* @relates intrusive_ptr
*/
template
<
typename
X
>
inline
bool
operator
!=
(
const
intrusive_ptr
<
X
>&
lhs
,
decltype
(
nullptr
))
{
return
lhs
.
get
()
!=
nullptr
;
}
/**
* @relates intrusive_ptr
*/
template
<
typename
X
>
inline
bool
operator
!=
(
decltype
(
nullptr
),
const
intrusive_ptr
<
X
>&
rhs
)
{
return
rhs
.
get
()
!=
nullptr
;
}
/**
/**
* @relates intrusive_ptr
* @relates intrusive_ptr
*/
*/
...
@@ -239,4 +189,4 @@ inline bool operator!=(const intrusive_ptr<X>& lhs, const intrusive_ptr<Y>& rhs)
...
@@ -239,4 +189,4 @@ inline bool operator!=(const intrusive_ptr<X>& lhs, const intrusive_ptr<Y>& rhs)
}
// namespace cppa
}
// namespace cppa
#endif // INTRUSIVE_PTR_HPP
#endif //
CPPA_
INTRUSIVE_PTR_HPP
cppa/local_actor.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef CONTEXT_HPP
#ifndef C
PPA_C
ONTEXT_HPP
#define CONTEXT_HPP
#define C
PPA_C
ONTEXT_HPP
#include "cppa/actor.hpp"
#include "cppa/actor.hpp"
#include "cppa/behavior.hpp"
#include "cppa/behavior.hpp"
...
@@ -49,78 +49,112 @@ class local_actor : public actor {
...
@@ -49,78 +49,112 @@ class local_actor : public actor {
friend
class
scheduler
;
friend
class
scheduler
;
protected:
bool
m_chaining
;
bool
m_trap_exit
;
bool
m_is_scheduled
;
actor_ptr
m_chained
;
actor_ptr
m_last_sender
;
any_tuple
m_last_dequeued
;
public:
public:
local_actor
(
bool
is_scheduled
=
false
);
/**
/**
* @brief Finishes execution of this actor.
* @brief Finishes execution of this actor.
*
*
* Causes this actor to send an exit signal to all of its
* Causes this actor to send an exit message to all of its
* linked actors, sets its state to @c exited and throws
* linked actors, sets its state to @c exited and finishes execution.
* {@link actor_exited} to cleanup the stack.
* @param reason Exit reason that will be send to
* @param reason Exit reason that will be send to linked actors.
* linked actors and monitors.
* @throws actor_exited
*/
*/
virtual
void
quit
(
std
::
uint32_t
reason
)
=
0
;
virtual
void
quit
(
std
::
uint32_t
reason
=
exit_reason
::
normal
)
=
0
;
inline
void
quit_normal
()
{
quit
(
exit_reason
::
normal
);
}
/**
/**
* @brief
* @brief Removes the first element from the mailbox @p pfun is defined
* @param rules
* for and invokes @p pfun with the removed element.
* @warning Call only from the owner of the queue.
* Blocks until a matching message arrives if @p pfun is not
* defined for any message in the actor's mailbox.
* @param pfun A partial function denoting the actor's response to the
* next incoming message.
* @warning You should not call this member function by hand.
* Use the {@link cppa::receive receive} function or
* the @p become member function in case of event-based actors.
*/
*/
virtual
void
dequeue
(
behavior
&
rules
)
=
0
;
virtual
void
dequeue
(
partial_function
&
pfun
)
=
0
;
/**
/**
* @brief Removes the first element from the queue that is matched
* @brief Removes the first element from the mailbox @p bhvr is defined
* by @p rules and invokes the corresponding callback.
* for and invokes @p bhvr with the removed element.
* @param rules
* Blocks until either a matching message arrives if @p bhvr is not
* @warning Call only from the owner of the queue.
* defined for any message in the actor's mailbox or until a
* timeout occurs.
* @param bhvr A partial function with optional timeout denoting the
* actor's response to the next incoming message.
* @warning You should not call this member function by hand.
* Use the {@link cppa::receive receive} function or
* the @p become member function in case of event-based actors.
*/
*/
virtual
void
dequeue
(
partial_function
&
rules
)
=
0
;
virtual
void
dequeue
(
behavior
&
bhvr
)
=
0
;
/**
* @brief Checks whether this actor traps exit messages.
*/
inline
bool
trap_exit
()
const
{
inline
bool
trap_exit
()
const
{
return
m_trap_exit
;
return
m_trap_exit
;
}
}
/**
* @brief Enables or disables trapping of exit messages.
*/
inline
void
trap_exit
(
bool
new_value
)
{
inline
void
trap_exit
(
bool
new_value
)
{
m_trap_exit
=
new_value
;
m_trap_exit
=
new_value
;
}
}
/**
* @brief Checks whether this actor uses the "chained send" optimization.
*/
inline
bool
chaining
()
const
{
inline
bool
chaining
()
const
{
return
m_chaining
;
return
m_chaining
;
}
}
/**
* @brief Enables or disables chained send.
*/
inline
void
chaining
(
bool
new_value
)
{
inline
void
chaining
(
bool
new_value
)
{
if
(
m_is_scheduled
)
{
m_chaining
=
m_is_scheduled
&&
new_value
;
m_chaining
=
new_value
;
}
}
}
/**
* @brief Returns the last message that was dequeued
* from the actor's mailbox.
* @note Only set during callback invocation.
*/
inline
any_tuple
&
last_dequeued
()
{
inline
any_tuple
&
last_dequeued
()
{
return
m_last_dequeued
;
return
m_last_dequeued
;
}
}
/**
* @brief Returns the sender of the last dequeued message.
* @note Only set during callback invocation.
* @note Implicitly used by the function {@link cppa::reply}.
*/
inline
actor_ptr
&
last_sender
()
{
inline
actor_ptr
&
last_sender
()
{
return
m_last_sender
;
return
m_last_sender
;
}
}
inline
actor_ptr
&
chained_actor
()
{
/**
return
m_chained
;
* @brief Adds a unidirectional @p monitor to @p whom.
}
*
* @whom sends a "DOWN" message to this actor as part of its termination.
* @param whom The actor that should be monitored by this actor.
* @note Each call to @p monitor creates a new, independent monitor.
*/
void
monitor
(
actor_ptr
whom
);
/**
* @brief Removes a monitor from @p whom.
* @param whom A monitored actor.
*/
void
demonitor
(
actor_ptr
whom
);
// library-internal members and member functions that shall
// not appear in the documentation
# ifndef CPPA_DOCUMENTATION
local_actor
(
bool
is_scheduled
=
false
);
inline
void
send_message
(
channel
*
whom
,
any_tuple
what
)
{
inline
void
send_message
(
channel
*
whom
,
any_tuple
what
)
{
whom
->
enqueue
(
this
,
std
::
move
(
what
));
whom
->
enqueue
(
this
,
std
::
move
(
what
));
...
@@ -137,22 +171,20 @@ class local_actor : public actor {
...
@@ -137,22 +171,20 @@ class local_actor : public actor {
}
}
}
}
/**
inline
actor_ptr
&
chained_actor
()
{
* @ingroup ActorManagement
return
m_chained
;
* @brief Adds a unidirectional @p monitor to @p whom.
}
* @param whom The actor that should be monitored by this actor.
* @note Each call to @p monitor creates a new, independent monitor.
* @pre The calling actor receives a "DOWN" message from @p whom when
* it terminates.
*/
void
monitor
(
actor_ptr
whom
);
/**
protected:
* @ingroup ActorManagement
* @brief Removes a monitor from @p whom.
bool
m_chaining
;
* @param whom A monitored actor.
bool
m_trap_exit
;
*/
bool
m_is_scheduled
;
void
demonitor
(
actor_ptr
whom
);
actor_ptr
m_chained
;
actor_ptr
m_last_sender
;
any_tuple
m_last_dequeued
;
# endif // CPPA_DOCUMENTATION
};
};
...
@@ -164,4 +196,4 @@ typedef intrusive_ptr<local_actor> local_actor_ptr;
...
@@ -164,4 +196,4 @@ typedef intrusive_ptr<local_actor> local_actor_ptr;
}
// namespace cppa
}
// namespace cppa
#endif // CONTEXT_HPP
#endif // C
PPA_C
ONTEXT_HPP
cppa/match.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef MATCH_HPP
#ifndef
CPPA_
MATCH_HPP
#define MATCH_HPP
#define
CPPA_
MATCH_HPP
#include "cppa/any_tuple.hpp"
#include "cppa/any_tuple.hpp"
#include "cppa/partial_function.hpp"
#include "cppa/partial_function.hpp"
...
@@ -194,4 +194,4 @@ auto match_each(InputIterator first, InputIterator last, Projection proj)
...
@@ -194,4 +194,4 @@ auto match_each(InputIterator first, InputIterator last, Projection proj)
}
// namespace cppa
}
// namespace cppa
#endif // MATCH_HPP
#endif //
CPPA_
MATCH_HPP
cppa/match_expr.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef MATCH_EXPR_HPP
#ifndef
CPPA_
MATCH_EXPR_HPP
#define MATCH_EXPR_HPP
#define
CPPA_
MATCH_EXPR_HPP
#include "cppa/option.hpp"
#include "cppa/option.hpp"
#include "cppa/pattern.hpp"
#include "cppa/pattern.hpp"
...
@@ -44,6 +44,7 @@
...
@@ -44,6 +44,7 @@
#include "cppa/util/left_or_right.hpp"
#include "cppa/util/left_or_right.hpp"
#include "cppa/util/deduce_ref_type.hpp"
#include "cppa/util/deduce_ref_type.hpp"
#include "cppa/detail/matches.hpp"
#include "cppa/detail/projection.hpp"
#include "cppa/detail/projection.hpp"
#include "cppa/detail/value_guard.hpp"
#include "cppa/detail/value_guard.hpp"
#include "cppa/detail/pseudo_tuple.hpp"
#include "cppa/detail/pseudo_tuple.hpp"
...
@@ -912,4 +913,4 @@ partial_function mexpr_concat_convert(const Arg0& arg0, const Args&... args) {
...
@@ -912,4 +913,4 @@ partial_function mexpr_concat_convert(const Arg0& arg0, const Args&... args) {
}
// namespace cppa
}
// namespace cppa
#endif // MATCH_EXPR_HPP
#endif //
CPPA_
MATCH_EXPR_HPP
cppa/object.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef OBJECT_HPP
#ifndef
CPPA_
OBJECT_HPP
#define OBJECT_HPP
#define
CPPA_
OBJECT_HPP
#include <string>
#include <string>
#include <typeinfo>
#include <typeinfo>
...
@@ -197,4 +197,4 @@ const T& get(const object& obj) {
...
@@ -197,4 +197,4 @@ const T& get(const object& obj) {
}
// namespace cppa
}
// namespace cppa
#endif // OBJECT_HPP
#endif //
CPPA_
OBJECT_HPP
cppa/on.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef ON_HPP
#ifndef
CPPA_
ON_HPP
#define ON_HPP
#define
CPPA_
ON_HPP
#include <chrono>
#include <chrono>
#include <memory>
#include <memory>
...
@@ -51,7 +51,6 @@
...
@@ -51,7 +51,6 @@
#include "cppa/detail/boxed.hpp"
#include "cppa/detail/boxed.hpp"
#include "cppa/detail/unboxed.hpp"
#include "cppa/detail/unboxed.hpp"
#include "cppa/detail/invokable.hpp"
#include "cppa/detail/value_guard.hpp"
#include "cppa/detail/value_guard.hpp"
#include "cppa/detail/ref_counted_impl.hpp"
#include "cppa/detail/ref_counted_impl.hpp"
#include "cppa/detail/implicit_conversions.hpp"
#include "cppa/detail/implicit_conversions.hpp"
...
@@ -409,4 +408,4 @@ constexpr detail::on_the_fly_rvalue_builder on_arg_match;
...
@@ -409,4 +408,4 @@ constexpr detail::on_the_fly_rvalue_builder on_arg_match;
}
// namespace cppa
}
// namespace cppa
#endif // ON_HPP
#endif //
CPPA_
ON_HPP
cppa/option.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef OPTION_HPP
#ifndef
CPPA_
OPTION_HPP
#define OPTION_HPP
#define
CPPA_
OPTION_HPP
#include <new>
#include <new>
#include <utility>
#include <utility>
...
@@ -227,4 +227,4 @@ bool operator!=(const T& lhs, const option<U>& rhs) {
...
@@ -227,4 +227,4 @@ bool operator!=(const T& lhs, const option<U>& rhs) {
}
// namespace cppa
}
// namespace cppa
#endif // OPTION_HPP
#endif //
CPPA_
OPTION_HPP
cppa/partial_function.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef PARTIAL_FUNCTION_HPP
#ifndef
CPPA_
PARTIAL_FUNCTION_HPP
#define PARTIAL_FUNCTION_HPP
#define
CPPA_
PARTIAL_FUNCTION_HPP
#include <list>
#include <list>
#include <vector>
#include <vector>
...
@@ -38,7 +38,6 @@
...
@@ -38,7 +38,6 @@
#include "cppa/ref_counted.hpp"
#include "cppa/ref_counted.hpp"
#include "cppa/intrusive_ptr.hpp"
#include "cppa/intrusive_ptr.hpp"
#include "cppa/detail/invokable.hpp"
#include "cppa/intrusive/singly_linked_list.hpp"
#include "cppa/intrusive/singly_linked_list.hpp"
namespace
cppa
{
namespace
cppa
{
...
@@ -98,4 +97,4 @@ class partial_function {
...
@@ -98,4 +97,4 @@ class partial_function {
}
// namespace cppa
}
// namespace cppa
#endif // PARTIAL_FUNCTION_HPP
#endif //
CPPA_
PARTIAL_FUNCTION_HPP
cppa/pattern.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef
LIB
CPPA_PATTERN_HPP
#ifndef CPPA_PATTERN_HPP
#define
LIB
CPPA_PATTERN_HPP
#define CPPA_PATTERN_HPP
#include <iostream>
#include <iostream>
...
@@ -340,4 +340,4 @@ struct pattern_from_type_list<util::type_list<Types...>> {
...
@@ -340,4 +340,4 @@ struct pattern_from_type_list<util::type_list<Types...>> {
}
// namespace cppa
}
// namespace cppa
#endif // PATTERN_HPP
#endif //
CPPA_
PATTERN_HPP
cppa/primitive_type.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef PRIMITIVE_TYPE_HPP
#ifndef
CPPA_
PRIMITIVE_TYPE_HPP
#define PRIMITIVE_TYPE_HPP
#define
CPPA_
PRIMITIVE_TYPE_HPP
namespace
cppa
{
namespace
cppa
{
...
@@ -80,4 +80,4 @@ constexpr const char* primitive_type_name(primitive_type ptype) {
...
@@ -80,4 +80,4 @@ constexpr const char* primitive_type_name(primitive_type ptype) {
}
// namespace cppa
}
// namespace cppa
#endif // PRIMITIVE_TYPE_HPP
#endif //
CPPA_
PRIMITIVE_TYPE_HPP
cppa/primitive_variant.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef PRIMITIVE_VARIANT_HPP
#ifndef
CPPA_
PRIMITIVE_VARIANT_HPP
#define PRIMITIVE_VARIANT_HPP
#define
CPPA_
PRIMITIVE_VARIANT_HPP
#include <new>
#include <new>
#include <cstdint>
#include <cstdint>
...
@@ -74,7 +74,7 @@ T& get_ref(primitive_variant& pv);
...
@@ -74,7 +74,7 @@ T& get_ref(primitive_variant& pv);
*/
*/
class
primitive_variant
{
class
primitive_variant
{
friend
bool
operator
==
(
const
primitive_variant
&
lhs
,
friend
bool
equal
(
const
primitive_variant
&
lhs
,
const
primitive_variant
&
rhs
);
const
primitive_variant
&
rhs
);
template
<
typename
T
>
template
<
typename
T
>
...
@@ -338,72 +338,26 @@ get_ref(primitive_variant& pv) {
...
@@ -338,72 +338,26 @@ get_ref(primitive_variant& pv) {
/**
/**
* @relates primitive_variant
* @relates primitive_variant
*/
*/
bool
operator
==
(
const
primitive_variant
&
lhs
,
const
primitive_variant
&
rhs
);
bool
equal
(
const
primitive_variant
&
lhs
,
const
primitive_variant
&
rhs
);
/**
* @relates primitive_variant
*/
inline
bool
operator
!=
(
const
primitive_variant
&
lhs
,
const
primitive_variant
&
rhs
)
{
return
!
(
lhs
==
rhs
);
}
#ifndef CPPA_DOCUMENTATION
/**
* @relates primitive_variant
*/
template
<
typename
T
>
bool
operator
==
(
const
T
&
lhs
,
const
primitive_variant
&
rhs
);
/**
* @relates primitive_variant
*/
template
<
typename
T
>
bool
operator
==
(
const
primitive_variant
&
lhs
,
const
T
&
rhs
);
/**
* @relates primitive_variant
*/
template
<
typename
T
>
bool
operator
!=
(
const
T
&
lhs
,
const
primitive_variant
&
rhs
);
/**
/**
* @relates primitive_variant
* @relates primitive_variant
*/
*/
template
<
typename
T
>
template
<
typename
T
>
bool
operator
!=
(
const
primitive_variant
&
lhs
,
const
T
&
rhs
);
bool
equal
(
const
T
&
lhs
,
const
primitive_variant
&
rhs
)
{
#else
template
<
typename
T
>
typename
std
::
enable_if
<
util
::
is_primitive
<
T
>::
value
,
bool
>::
type
operator
==
(
const
T
&
lhs
,
const
primitive_variant
&
rhs
)
{
static
constexpr
primitive_type
ptype
=
detail
::
type_to_ptype
<
T
>::
ptype
;
static
constexpr
primitive_type
ptype
=
detail
::
type_to_ptype
<
T
>::
ptype
;
static_assert
(
ptype
!=
pt_null
,
"T is an incompatible type"
);
static_assert
(
ptype
!=
pt_null
,
"T is an incompatible type"
);
return
(
rhs
.
ptype
()
==
ptype
)
?
lhs
==
get
<
ptype
>
(
rhs
)
:
false
;
return
(
rhs
.
ptype
()
==
ptype
)
?
lhs
==
get
<
ptype
>
(
rhs
)
:
false
;
}
}
/**
* @relates primitive_variant
*/
template
<
typename
T
>
template
<
typename
T
>
typename
std
::
enable_if
<
util
::
is_primitive
<
T
>::
value
,
bool
>::
type
inline
bool
equal
(
const
primitive_variant
&
lhs
,
const
T
&
rhs
)
{
operator
==
(
const
primitive_variant
&
lhs
,
const
T
&
rhs
)
{
return
equal
(
rhs
,
lhs
);
return
(
rhs
==
lhs
);
}
template
<
typename
T
>
typename
std
::
enable_if
<
util
::
is_primitive
<
T
>::
value
,
bool
>::
type
operator
!=
(
const
primitive_variant
&
lhs
,
const
T
&
rhs
)
{
return
!
(
lhs
==
rhs
);
}
template
<
typename
T
>
typename
std
::
enable_if
<
util
::
is_primitive
<
T
>::
value
,
bool
>::
type
operator
!=
(
const
T
&
lhs
,
const
primitive_variant
&
rhs
)
{
return
!
(
lhs
==
rhs
);
}
}
#endif // CPPA_DOCUMENTATION
}
// namespace cppa
}
// namespace cppa
namespace
cppa
{
namespace
detail
{
namespace
cppa
{
namespace
detail
{
...
@@ -431,4 +385,4 @@ void ptv_set(primitive_type& lhs_type, T& lhs, V&& rhs,
...
@@ -431,4 +385,4 @@ void ptv_set(primitive_type& lhs_type, T& lhs, V&& rhs,
}
}
// namespace cppa::detail
}
}
// namespace cppa::detail
#endif // PRIMITIVE_VARIANT_HPP
#endif //
CPPA_
PRIMITIVE_VARIANT_HPP
cppa/process_information.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef PROCESS_INFORMATION_HPP
#ifndef
CPPA_
PROCESS_INFORMATION_HPP
#define PROCESS_INFORMATION_HPP
#define
CPPA_
PROCESS_INFORMATION_HPP
#include <array>
#include <array>
#include <string>
#include <string>
...
@@ -143,4 +143,4 @@ typedef intrusive_ptr<process_information> process_information_ptr;
...
@@ -143,4 +143,4 @@ typedef intrusive_ptr<process_information> process_information_ptr;
}
// namespace cppa
}
// namespace cppa
#endif // PROCESS_INFORMATION_HPP
#endif //
CPPA_
PROCESS_INFORMATION_HPP
cppa/receive.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef RECEIVE_HPP
#ifndef
CPPA_
RECEIVE_HPP
#define RECEIVE_HPP
#define
CPPA_
RECEIVE_HPP
#include "cppa/self.hpp"
#include "cppa/self.hpp"
#include "cppa/behavior.hpp"
#include "cppa/behavior.hpp"
...
@@ -160,4 +160,4 @@ detail::do_receive_helper do_receive(Args&&... args) {
...
@@ -160,4 +160,4 @@ detail::do_receive_helper do_receive(Args&&... args) {
}
// namespace cppa
}
// namespace cppa
#endif // RECEIVE_HPP
#endif //
CPPA_
RECEIVE_HPP
cppa/ref_counted.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef
LIB
CPPA_REF_COUNTED_HPP
#ifndef CPPA_REF_COUNTED_HPP
#define
LIB
CPPA_REF_COUNTED_HPP
#define CPPA_REF_COUNTED_HPP
#include <atomic>
#include <atomic>
#include <cstddef>
#include <cstddef>
...
@@ -79,4 +79,4 @@ typedef detail::ref_counted_impl< std::atomic<size_t> > ref_counted;
...
@@ -79,4 +79,4 @@ typedef detail::ref_counted_impl< std::atomic<size_t> > ref_counted;
}
// namespace cppa
}
// namespace cppa
#endif //
LIB
CPPA_REF_COUNTED_HPP
#endif // CPPA_REF_COUNTED_HPP
cppa/scheduled_actor.hpp
View file @
5b69972e
...
@@ -28,34 +28,35 @@
...
@@ -28,34 +28,35 @@
\******************************************************************************/
\******************************************************************************/
#ifndef ACTOR_BEHAVIOR_HPP
#ifndef
CPPA_
ACTOR_BEHAVIOR_HPP
#define ACTOR_BEHAVIOR_HPP
#define
CPPA_
ACTOR_BEHAVIOR_HPP
#include "cppa/config.hpp"
#include "cppa/config.hpp"
#include "cppa/scheduler.hpp"
#include "cppa/local_actor.hpp"
#include "cppa/local_actor.hpp"
namespace
cppa
{
namespace
cppa
{
class
scheduler
;
namespace
util
{
class
fiber
;
}
namespace
util
{
class
fiber
;
}
enum
class
resume_result
{
actor_blocked
,
actor_done
};
/**
/**
* @brief A base class for context-switching or thread-mapped actor
* @brief A base class for cooperatively scheduled actors.
* implementations.
*
* This abstract class provides a class-based way to define context-switching
* or thread-mapped actors. In general,
* you always should use event-based actors. However, if you need to call
* blocking functions, or need to have your own thread for other reasons,
* this class can be used to define a class-based actor.
*/
*/
class
scheduled_actor
:
public
local_actor
{
class
scheduled_actor
:
public
local_actor
{
public:
public:
scheduled_actor
(
bool
enable_
pending_enqueue
=
false
);
scheduled_actor
(
bool
enable_
chained_send
=
false
);
scheduled_actor
*
next
;
// intrusive next pointer
/**
* @brief Intrusive next pointer needed by the scheduler's job queue.
*/
scheduled_actor
*
next
;
/**
/**
* @brief Can be overridden to perform cleanup code after an actor
* @brief Can be overridden to perform cleanup code after an actor
...
@@ -72,7 +73,7 @@ class scheduled_actor : public local_actor {
...
@@ -72,7 +73,7 @@ class scheduled_actor : public local_actor {
virtual
void
init
();
virtual
void
init
();
// called from worker thread
// called from worker thread
virtual
void
resume
(
util
::
fiber
*
from
,
scheduler
::
callback
*
cb
)
=
0
;
virtual
resume_result
resume
(
util
::
fiber
*
from
)
=
0
;
scheduled_actor
*
attach_to_scheduler
(
scheduler
*
sched
);
scheduled_actor
*
attach_to_scheduler
(
scheduler
*
sched
);
...
@@ -84,4 +85,4 @@ class scheduled_actor : public local_actor {
...
@@ -84,4 +85,4 @@ class scheduled_actor : public local_actor {
}
// namespace cppa
}
// namespace cppa
#endif // ACTOR_BEHAVIOR_HPP
#endif //
CPPA_
ACTOR_BEHAVIOR_HPP
cppa/scheduler.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef SCHEDULER_HPP
#ifndef
CPPA_
SCHEDULER_HPP
#define SCHEDULER_HPP
#define
CPPA_
SCHEDULER_HPP
#include <chrono>
#include <chrono>
#include <memory>
#include <memory>
...
@@ -66,12 +66,6 @@ class scheduler {
...
@@ -66,12 +66,6 @@ class scheduler {
public:
public:
struct
callback
{
virtual
~
callback
();
// called if an actor finished execution during resume()
virtual
void
exec_done
()
=
0
;
};
virtual
~
scheduler
();
virtual
~
scheduler
();
/**
/**
...
@@ -140,4 +134,4 @@ scheduler* get_scheduler();
...
@@ -140,4 +134,4 @@ scheduler* get_scheduler();
}
// namespace cppa::detail
}
// namespace cppa::detail
#endif // SCHEDULER_HPP
#endif //
CPPA_
SCHEDULER_HPP
cppa/scheduling_hint.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef SCHEDULING_HINT_HPP
#ifndef
CPPA_
SCHEDULING_HINT_HPP
#define SCHEDULING_HINT_HPP
#define
CPPA_
SCHEDULING_HINT_HPP
namespace
cppa
{
namespace
cppa
{
...
@@ -53,4 +53,4 @@ enum scheduling_hint {
...
@@ -53,4 +53,4 @@ enum scheduling_hint {
}
// namespace cppa
}
// namespace cppa
#endif // SCHEDULING_HINT_HPP
#endif //
CPPA_
SCHEDULING_HINT_HPP
cppa/self.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef SELF_HPP
#ifndef
CPPA_
SELF_HPP
#define SELF_HPP
#define
CPPA_
SELF_HPP
#include "cppa/actor.hpp"
#include "cppa/actor.hpp"
#include "cppa/intrusive_ptr.hpp"
#include "cppa/intrusive_ptr.hpp"
...
@@ -107,4 +107,4 @@ constexpr self_type self;
...
@@ -107,4 +107,4 @@ constexpr self_type self;
}
// namespace cppa
}
// namespace cppa
#endif // SELF_HPP
#endif //
CPPA_
SELF_HPP
cppa/serializer.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef SERIALIZER_HPP
#ifndef
CPPA_
SERIALIZER_HPP
#define SERIALIZER_HPP
#define
CPPA_
SERIALIZER_HPP
#include <string>
#include <string>
#include <cstddef> // size_t
#include <cstddef> // size_t
...
@@ -114,4 +114,4 @@ serializer& operator<<(serializer& s, const T& what) {
...
@@ -114,4 +114,4 @@ serializer& operator<<(serializer& s, const T& what) {
}
// namespace cppa
}
// namespace cppa
#endif // SERIALIZER_HPP
#endif //
CPPA_
SERIALIZER_HPP
cppa/stacked_event_based_actor.hpp
View file @
5b69972e
...
@@ -28,16 +28,31 @@
...
@@ -28,16 +28,31 @@
\******************************************************************************/
\******************************************************************************/
#ifndef STACKED_EVENT_BASED_ACTOR_HPP
#ifndef
CPPA_
STACKED_EVENT_BASED_ACTOR_HPP
#define STACKED_EVENT_BASED_ACTOR_HPP
#define
CPPA_
STACKED_EVENT_BASED_ACTOR_HPP
#include "cppa/event_based_actor_base.hpp"
#include "cppa/event_based_actor_base.hpp"
namespace
cppa
{
namespace
cppa
{
#ifdef CPPA_DOCUMENTATION
/**
/**
* @brief A base class for event-based actors using a behavior stack.
* @brief A base class for event-based actors using a behavior stack.
*/
*/
class
stacked_event_based_actor
:
public
event_based_actor
{
protected:
/**
* @brief Restores the last behavior.
*/
void
unbecome
();
};
#else
class
stacked_event_based_actor
:
public
event_based_actor_base
<
stacked_event_based_actor
>
{
class
stacked_event_based_actor
:
public
event_based_actor_base
<
stacked_event_based_actor
>
{
friend
class
event_based_actor_base
<
stacked_event_based_actor
>
;
friend
class
event_based_actor_base
<
stacked_event_based_actor
>
;
...
@@ -48,18 +63,12 @@ class stacked_event_based_actor : public event_based_actor_base<stacked_event_ba
...
@@ -48,18 +63,12 @@ class stacked_event_based_actor : public event_based_actor_base<stacked_event_ba
protected:
protected:
/**
* @brief Restores the last behavior.
*/
void
unbecome
();
void
unbecome
();
/**
* @brief Terminates this actor with normal exit reason.
*/
void
quit_normal
();
};
};
#endif
}
// namespace cppa
}
// namespace cppa
#endif // STACKED_EVENT_BASED_ACTOR_HPP
#endif //
CPPA_
STACKED_EVENT_BASED_ACTOR_HPP
cppa/
detail/converted_thread_context
.hpp
→
cppa/
thread_mapped_actor
.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef C
ONVERTED_THREAD_CONTEXT
_HPP
#ifndef C
PPA_THREAD_BASED_ACTOR
_HPP
#define C
ONVERTED_THREAD_CONTEXT
_HPP
#define C
PPA_THREAD_BASED_ACTOR
_HPP
#include "cppa/config.hpp"
#include "cppa/config.hpp"
...
@@ -48,17 +48,27 @@
...
@@ -48,17 +48,27 @@
#include "cppa/local_actor.hpp"
#include "cppa/local_actor.hpp"
#include "cppa/exit_reason.hpp"
#include "cppa/exit_reason.hpp"
#include "cppa/abstract_actor.hpp"
#include "cppa/abstract_actor.hpp"
#include "cppa/intrusive/singly_linked_list.hpp"
#include "cppa/intrusive/singly_linked_list.hpp"
#include "cppa/detail/recursive_queue_node.hpp"
#include "cppa/detail/nestable_receive_policy.hpp"
#include "cppa/detail/nestable_receive_policy.hpp"
namespace
cppa
{
namespace
detail
{
namespace
cppa
{
#ifdef CPPA_DOCUMENTATION
/**
/**
* @brief
Represents a thread that was converted to an Actor
.
* @brief
An actor running in its own thread
.
*/
*/
class
converted_thread_context
:
public
abstract_actor
<
local_actor
>
{
class
thread_mapped_actor
:
public
local_actor
{
};
friend
class
nestable_receive_policy
;
#else // CPPA_DOCUMENTATION
class
thread_mapped_actor
:
public
abstract_actor
<
local_actor
>
{
friend
class
detail
::
nestable_receive_policy
;
typedef
abstract_actor
<
local_actor
>
super
;
typedef
abstract_actor
<
local_actor
>
super
;
...
@@ -72,24 +82,25 @@ class converted_thread_context : public abstract_actor<local_actor> {
...
@@ -72,24 +82,25 @@ class converted_thread_context : public abstract_actor<local_actor> {
void
dequeue
(
partial_function
&
rules
);
//override
void
dequeue
(
partial_function
&
rules
);
//override
inline
void
push_timeout
()
{
}
detail
::
filter_result
filter_msg
(
const
any_tuple
&
msg
);
inline
void
pop_timeout
()
{
}
filter_result
filter_msg
(
const
any_tuple
&
msg
);
inline
decltype
(
m_mailbox
)
&
mailbox
()
{
return
m_mailbox
;
}
inline
decltype
(
m_mailbox
)
&
mailbox
()
{
return
m_mailbox
;
}
private:
private:
nestable_receive_policy
m_recv_policy
;
detail
::
nestable_receive_policy
m_recv_policy
;
inline
recursive_queue_node
*
receive_node
()
{
// required by nestable_receive_policy
inline
void
push_timeout
()
{
}
inline
void
pop_timeout
()
{
}
inline
detail
::
recursive_queue_node
*
receive_node
()
{
return
m_mailbox
.
pop
();
return
m_mailbox
.
pop
();
}
}
};
};
}
}
// namespace cppa::detail
#endif // CPPA_DOCUMENTATION
}
// namespace cppa
#endif // C
ONVERTED_THREAD_CONTEXT
_HPP
#endif // C
PPA_THREAD_BASED_ACTOR
_HPP
cppa/to_string.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef TO_STRING_HPP
#ifndef
CPPA_
TO_STRING_HPP
#define TO_STRING_HPP
#define
CPPA_
TO_STRING_HPP
#include "cppa/uniform_type_info.hpp"
#include "cppa/uniform_type_info.hpp"
#include "cppa/detail/to_uniform_name.hpp"
#include "cppa/detail/to_uniform_name.hpp"
...
@@ -59,4 +59,4 @@ std::string to_string(const T& what) {
...
@@ -59,4 +59,4 @@ std::string to_string(const T& what) {
}
// namespace cppa
}
// namespace cppa
#endif // TO_STRING_HPP
#endif //
CPPA_
TO_STRING_HPP
cppa/tpartial_function.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef TPARTIAL_FUNCTION_HPP
#ifndef
CPPA_
TPARTIAL_FUNCTION_HPP
#define TPARTIAL_FUNCTION_HPP
#define
CPPA_
TPARTIAL_FUNCTION_HPP
#include <cstddef>
#include <cstddef>
#include <type_traits>
#include <type_traits>
...
@@ -130,4 +130,4 @@ struct get_tpartial_function<Expr, Guard,
...
@@ -130,4 +130,4 @@ struct get_tpartial_function<Expr, Guard,
}
// namespace cppa
}
// namespace cppa
#endif // TPARTIAL_FUNCTION_HPP
#endif //
CPPA_
TPARTIAL_FUNCTION_HPP
cppa/tuple_cast.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef TUPLE_CAST_HPP
#ifndef
CPPA_
TUPLE_CAST_HPP
#define TUPLE_CAST_HPP
#define
CPPA_
TUPLE_CAST_HPP
#include <type_traits>
#include <type_traits>
...
@@ -205,4 +205,4 @@ auto forced_tuple_cast(any_tuple& tup, const pattern<T...>& p)
...
@@ -205,4 +205,4 @@ auto forced_tuple_cast(any_tuple& tup, const pattern<T...>& p)
}
// namespace cppa
}
// namespace cppa
#endif // TUPLE_CAST_HPP
#endif //
CPPA_
TUPLE_CAST_HPP
cppa/uniform_type_info.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef UNIFORM_TYPE_INFO_HPP
#ifndef
CPPA_
UNIFORM_TYPE_INFO_HPP
#define UNIFORM_TYPE_INFO_HPP
#define
CPPA_
UNIFORM_TYPE_INFO_HPP
#include <map>
#include <map>
#include <vector>
#include <vector>
...
@@ -318,4 +318,4 @@ inline bool operator!=(const std::type_info& lhs, const uniform_type_info& rhs)
...
@@ -318,4 +318,4 @@ inline bool operator!=(const std::type_info& lhs, const uniform_type_info& rhs)
}
// namespace cppa
}
// namespace cppa
#endif // UNIFORM_TYPE_INFO_HPP
#endif //
CPPA_
UNIFORM_TYPE_INFO_HPP
cppa/util/abstract_uniform_type_info.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef ABSTRACT_UNIFORM_TYPE_INFO_HPP
#ifndef
CPPA_
ABSTRACT_UNIFORM_TYPE_INFO_HPP
#define ABSTRACT_UNIFORM_TYPE_INFO_HPP
#define
CPPA_
ABSTRACT_UNIFORM_TYPE_INFO_HPP
#include "cppa/uniform_type_info.hpp"
#include "cppa/uniform_type_info.hpp"
#include "cppa/detail/to_uniform_name.hpp"
#include "cppa/detail/to_uniform_name.hpp"
...
@@ -80,4 +80,4 @@ class abstract_uniform_type_info : public uniform_type_info {
...
@@ -80,4 +80,4 @@ class abstract_uniform_type_info : public uniform_type_info {
}
}
}
}
#endif // ABSTRACT_UNIFORM_TYPE_INFO_HPP
#endif //
CPPA_
ABSTRACT_UNIFORM_TYPE_INFO_HPP
cppa/util/apply_args.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef APPLY_ARGS_HPP
#ifndef
CPPA_
APPLY_ARGS_HPP
#define APPLY_ARGS_HPP
#define
CPPA_
APPLY_ARGS_HPP
#include <cstddef>
#include <cstddef>
...
@@ -54,4 +54,4 @@ struct apply_args<Result, X, X> {
...
@@ -54,4 +54,4 @@ struct apply_args<Result, X, X> {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // APPLY_ARGS_HPP
#endif //
CPPA_
APPLY_ARGS_HPP
cppa/util/apply_tuple.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef APPLY_TUPLE_HPP
#ifndef
CPPA_
APPLY_TUPLE_HPP
#define APPLY_TUPLE_HPP
#define
CPPA_
APPLY_TUPLE_HPP
#include <type_traits>
#include <type_traits>
...
@@ -135,4 +135,4 @@ Result unchecked_apply_tuple(F&& fun, Tuple<T...>& tup) {
...
@@ -135,4 +135,4 @@ Result unchecked_apply_tuple(F&& fun, Tuple<T...>& tup) {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // APPLY_TUPLE_HPP
#endif //
CPPA_
APPLY_TUPLE_HPP
cppa/util/arg_match_t.hpp
View file @
5b69972e
#ifndef ARG_MATCH_T_HPP
/******************************************************************************\
#define ARG_MATCH_T_HPP
* ___ __ *
* /\_ \ __/\ \ *
* \//\ \ /\_\ \ \____ ___ _____ _____ __ *
* \ \ \ \/\ \ \ '__`\ /'___\/\ '__`\/\ '__`\ /'__`\ *
* \_\ \_\ \ \ \ \L\ \/\ \__/\ \ \L\ \ \ \L\ \/\ \L\.\_ *
* /\____\\ \_\ \_,__/\ \____\\ \ ,__/\ \ ,__/\ \__/.\_\ *
* \/____/ \/_/\/___/ \/____/ \ \ \/ \ \ \/ \/__/\/_/ *
* \ \_\ \ \_\ *
* \/_/ \/_/ *
* *
* Copyright (C) 2011, 2012 *
* Dominik Charousset <dominik.charousset@haw-hamburg.de> *
* *
* This file is part of libcppa. *
* libcppa is free software: you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation, either version 3 of the License *
* or (at your option) any later version. *
* *
* libcppa is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with libcppa. If not, see <http://www.gnu.org/licenses/>. *
\******************************************************************************/
#ifndef CPPA_ARG_MATCH_T_HPP
#define CPPA_ARG_MATCH_T_HPP
namespace
cppa
{
namespace
util
{
struct
arg_match_t
{
};
}
}
namespace
cppa
{
namespace
util
{
struct
arg_match_t
{
};
}
}
#endif // ARG_MATCH_T_HPP
#endif //
CPPA_
ARG_MATCH_T_HPP
cppa/util/at.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef AT_HPP
#ifndef
CPPA_
AT_HPP
#define AT_HPP
#define
CPPA_
AT_HPP
namespace
cppa
{
namespace
util
{
namespace
cppa
{
namespace
util
{
...
@@ -48,4 +48,4 @@ struct at<0, T0, Tn...> {
...
@@ -48,4 +48,4 @@ struct at<0, T0, Tn...> {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // AT_HPP
#endif //
CPPA_
AT_HPP
cppa/util/comparable.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef COMPARABLE_HPP
#ifndef C
PPA_C
OMPARABLE_HPP
#define COMPARABLE_HPP
#define C
PPA_C
OMPARABLE_HPP
namespace
cppa
{
namespace
util
{
namespace
cppa
{
namespace
util
{
...
@@ -126,4 +126,4 @@ class comparable<Subclass, Subclass> {
...
@@ -126,4 +126,4 @@ class comparable<Subclass, Subclass> {
}
}
// cppa::util
}
}
// cppa::util
#endif // COMPARABLE_HPP
#endif // C
PPA_C
OMPARABLE_HPP
cppa/util/compare_tuples.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef COMPARE_TUPLES_HPP
#ifndef C
PPA_C
OMPARE_TUPLES_HPP
#define COMPARE_TUPLES_HPP
#define C
PPA_C
OMPARE_TUPLES_HPP
#include "cppa/get.hpp"
#include "cppa/get.hpp"
#include "cppa/util/at.hpp"
#include "cppa/util/at.hpp"
...
@@ -102,4 +102,4 @@ bool compare_first_elements(const LhsTuple<LhsTypes...>& lhs,
...
@@ -102,4 +102,4 @@ bool compare_first_elements(const LhsTuple<LhsTypes...>& lhs,
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // COMPARE_TUPLES_HPP
#endif // C
PPA_C
OMPARE_TUPLES_HPP
cppa/util/conjunction.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef CONJUNCTION_HPP
#ifndef C
PPA_C
ONJUNCTION_HPP
#define CONJUNCTION_HPP
#define C
PPA_C
ONJUNCTION_HPP
#include <type_traits>
#include <type_traits>
...
@@ -48,4 +48,4 @@ struct conjunction<> : std::true_type { };
...
@@ -48,4 +48,4 @@ struct conjunction<> : std::true_type { };
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // CONJUNCTION_HPP
#endif // C
PPA_C
ONJUNCTION_HPP
cppa/util/deduce_ref_type.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef DEDUCE_REF_TYPE_HPP
#ifndef
CPPA_
DEDUCE_REF_TYPE_HPP
#define DEDUCE_REF_TYPE_HPP
#define
CPPA_
DEDUCE_REF_TYPE_HPP
#include "cppa/util/rm_ref.hpp"
#include "cppa/util/rm_ref.hpp"
...
@@ -55,4 +55,4 @@ struct deduce_ref_type<const T0&, T1> {
...
@@ -55,4 +55,4 @@ struct deduce_ref_type<const T0&, T1> {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // DEDUCE_REF_TYPE_HPP
#endif //
CPPA_
DEDUCE_REF_TYPE_HPP
cppa/util/disjunction.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef DISJUNCTION_HPP
#ifndef
CPPA_
DISJUNCTION_HPP
#define DISJUNCTION_HPP
#define
CPPA_
DISJUNCTION_HPP
#include <type_traits>
#include <type_traits>
...
@@ -48,4 +48,4 @@ struct disjunction<> : std::false_type { };
...
@@ -48,4 +48,4 @@ struct disjunction<> : std::false_type { };
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // DISJUNCTION_HPP
#endif //
CPPA_
DISJUNCTION_HPP
cppa/util/duration.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef DURATION_HPP
#ifndef
CPPA_
DURATION_HPP
#define DURATION_HPP
#define
CPPA_
DURATION_HPP
#include <chrono>
#include <chrono>
#include <cstdint>
#include <cstdint>
...
@@ -141,4 +141,4 @@ operator+=(std::chrono::time_point<Clock, Duration>& lhs,
...
@@ -141,4 +141,4 @@ operator+=(std::chrono::time_point<Clock, Duration>& lhs,
return
lhs
;
return
lhs
;
}
}
#endif // DURATION_HPP
#endif //
CPPA_
DURATION_HPP
cppa/util/element_at.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef ELEMENT_AT_HPP
#ifndef
CPPA_
ELEMENT_AT_HPP
#define ELEMENT_AT_HPP
#define
CPPA_
ELEMENT_AT_HPP
#include "cppa/util/at.hpp"
#include "cppa/util/at.hpp"
...
@@ -47,4 +47,4 @@ struct element_at<N, C<Tn...>> : at<N, Tn...> {
...
@@ -47,4 +47,4 @@ struct element_at<N, C<Tn...>> : at<N, Tn...> {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // ELEMENT_AT_HPP
#endif //
CPPA_
ELEMENT_AT_HPP
cppa/util/fiber.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef FIBER_HPP
#ifndef
CPPA_
FIBER_HPP
#define FIBER_HPP
#define
CPPA_
FIBER_HPP
#include <memory>
#include <memory>
#include "cppa/config.hpp"
#include "cppa/config.hpp"
...
@@ -71,4 +71,4 @@ class fiber {
...
@@ -71,4 +71,4 @@ class fiber {
#endif // CPPA_DISABLE_CONTEXT_SWITCHING
#endif // CPPA_DISABLE_CONTEXT_SWITCHING
#endif // FIBER_HPP
#endif //
CPPA_
FIBER_HPP
cppa/util/fixed_vector.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef FIXED_VECTOR_HPP
#ifndef
CPPA_
FIXED_VECTOR_HPP
#define FIXED_VECTOR_HPP
#define
CPPA_
FIXED_VECTOR_HPP
#include <iterator>
#include <iterator>
#include <algorithm>
#include <algorithm>
...
@@ -269,4 +269,4 @@ class fixed_vector {
...
@@ -269,4 +269,4 @@ class fixed_vector {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // FIXED_VECTOR_HPP
#endif //
CPPA_
FIXED_VECTOR_HPP
cppa/util/if_else.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef IF_ELSE_HPP
#ifndef
CPPA_
IF_ELSE_HPP
#define IF_ELSE_HPP
#define
CPPA_
IF_ELSE_HPP
#include "cppa/util/wrapped.hpp"
#include "cppa/util/wrapped.hpp"
...
@@ -58,4 +58,4 @@ struct if_else : if_else_c<Stmt::value, T, Else> { };
...
@@ -58,4 +58,4 @@ struct if_else : if_else_c<Stmt::value, T, Else> { };
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // IF_ELSE_HPP
#endif //
CPPA_
IF_ELSE_HPP
cppa/util/is_array_of.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef IS_ARRAY_OF_HPP
#ifndef
CPPA_
IS_ARRAY_OF_HPP
#define IS_ARRAY_OF_HPP
#define
CPPA_
IS_ARRAY_OF_HPP
#include <type_traits>
#include <type_traits>
...
@@ -50,4 +50,4 @@ struct is_array_of {
...
@@ -50,4 +50,4 @@ struct is_array_of {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // IS_ARRAY_OF_HPP
#endif //
CPPA_
IS_ARRAY_OF_HPP
cppa/util/is_builtin.hpp
View file @
5b69972e
#ifndef IS_BUILTIN_HPP
/******************************************************************************\
#define IS_BUILTIN_HPP
* ___ __ *
* /\_ \ __/\ \ *
* \//\ \ /\_\ \ \____ ___ _____ _____ __ *
* \ \ \ \/\ \ \ '__`\ /'___\/\ '__`\/\ '__`\ /'__`\ *
* \_\ \_\ \ \ \ \L\ \/\ \__/\ \ \L\ \ \ \L\ \/\ \L\.\_ *
* /\____\\ \_\ \_,__/\ \____\\ \ ,__/\ \ ,__/\ \__/.\_\ *
* \/____/ \/_/\/___/ \/____/ \ \ \/ \ \ \/ \/__/\/_/ *
* \ \_\ \ \_\ *
* \/_/ \/_/ *
* *
* Copyright (C) 2011, 2012 *
* Dominik Charousset <dominik.charousset@haw-hamburg.de> *
* *
* This file is part of libcppa. *
* libcppa is free software: you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation, either version 3 of the License *
* or (at your option) any later version. *
* *
* libcppa is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with libcppa. If not, see <http://www.gnu.org/licenses/>. *
\******************************************************************************/
#ifndef CPPA_IS_BUILTIN_HPP
#define CPPA_IS_BUILTIN_HPP
#include <string>
#include <string>
#include <type_traits>
#include <type_traits>
...
@@ -57,4 +87,4 @@ struct is_builtin<intrusive_ptr<process_information> > : std::true_type { };
...
@@ -57,4 +87,4 @@ struct is_builtin<intrusive_ptr<process_information> > : std::true_type { };
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // IS_BUILTIN_HPP
#endif //
CPPA_
IS_BUILTIN_HPP
cppa/util/is_comparable.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef IS_COMPARABLE_HPP
#ifndef
CPPA_
IS_COMPARABLE_HPP
#define IS_COMPARABLE_HPP
#define
CPPA_
IS_COMPARABLE_HPP
#include <type_traits>
#include <type_traits>
...
@@ -68,4 +68,4 @@ class is_comparable {
...
@@ -68,4 +68,4 @@ class is_comparable {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // IS_COMPARABLE_HPP
#endif //
CPPA_
IS_COMPARABLE_HPP
cppa/util/is_forward_iterator.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef IS_FORWARD_ITERATOR_HPP
#ifndef
CPPA_
IS_FORWARD_ITERATOR_HPP
#define IS_FORWARD_ITERATOR_HPP
#define
CPPA_
IS_FORWARD_ITERATOR_HPP
#include <type_traits>
#include <type_traits>
...
@@ -71,4 +71,4 @@ class is_forward_iterator {
...
@@ -71,4 +71,4 @@ class is_forward_iterator {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // IS_FORWARD_ITERATOR_HPP
#endif //
CPPA_
IS_FORWARD_ITERATOR_HPP
cppa/util/is_iterable.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef IS_ITERABLE_HPP
#ifndef
CPPA_
IS_ITERABLE_HPP
#define IS_ITERABLE_HPP
#define
CPPA_
IS_ITERABLE_HPP
#include "cppa/util/is_primitive.hpp"
#include "cppa/util/is_primitive.hpp"
#include "cppa/util/is_forward_iterator.hpp"
#include "cppa/util/is_forward_iterator.hpp"
...
@@ -70,4 +70,4 @@ class is_iterable {
...
@@ -70,4 +70,4 @@ class is_iterable {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // IS_ITERABLE_HPP
#endif //
CPPA_
IS_ITERABLE_HPP
cppa/util/is_legal_tuple_type.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef IS_LEGAL_TUPLE_TYPE_HPP
#ifndef
CPPA_
IS_LEGAL_TUPLE_TYPE_HPP
#define IS_LEGAL_TUPLE_TYPE_HPP
#define
CPPA_
IS_LEGAL_TUPLE_TYPE_HPP
#include <type_traits>
#include <type_traits>
...
@@ -48,4 +48,4 @@ struct is_legal_tuple_type {
...
@@ -48,4 +48,4 @@ struct is_legal_tuple_type {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // IS_LEGAL_TUPLE_TYPE_HPP
#endif //
CPPA_
IS_LEGAL_TUPLE_TYPE_HPP
cppa/util/is_manipulator.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef IS_MANIPULATOR_HPP
#ifndef
CPPA_
IS_MANIPULATOR_HPP
#define IS_MANIPULATOR_HPP
#define
CPPA_
IS_MANIPULATOR_HPP
#include "cppa/util/type_list.hpp"
#include "cppa/util/type_list.hpp"
#include "cppa/util/is_mutable_ref.hpp"
#include "cppa/util/is_mutable_ref.hpp"
...
@@ -51,4 +51,4 @@ struct is_manipulator {
...
@@ -51,4 +51,4 @@ struct is_manipulator {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // IS_MANIPULATOR_HPP
#endif //
CPPA_
IS_MANIPULATOR_HPP
cppa/util/is_mutable_ref.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef IS_MUTABLE_REF_HPP
#ifndef
CPPA_
IS_MUTABLE_REF_HPP
#define IS_MUTABLE_REF_HPP
#define
CPPA_
IS_MUTABLE_REF_HPP
namespace
cppa
{
namespace
util
{
namespace
cppa
{
namespace
util
{
...
@@ -53,4 +53,4 @@ struct is_mutable_ref<T&> {
...
@@ -53,4 +53,4 @@ struct is_mutable_ref<T&> {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // IS_MUTABLE_REF_HPP
#endif //
CPPA_
IS_MUTABLE_REF_HPP
cppa/util/is_primitive.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef IS_PRIMITIVE_HPP
#ifndef
CPPA_
IS_PRIMITIVE_HPP
#define IS_PRIMITIVE_HPP
#define
CPPA_
IS_PRIMITIVE_HPP
#include "cppa/detail/type_to_ptype.hpp"
#include "cppa/detail/type_to_ptype.hpp"
...
@@ -55,4 +55,4 @@ struct is_primitive {
...
@@ -55,4 +55,4 @@ struct is_primitive {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // IS_PRIMITIVE_HPP
#endif //
CPPA_
IS_PRIMITIVE_HPP
cppa/util/left_or_right.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef LEFT_OR_RIGHT_HPP
#ifndef
CPPA_
LEFT_OR_RIGHT_HPP
#define LEFT_OR_RIGHT_HPP
#define
CPPA_
LEFT_OR_RIGHT_HPP
#include "cppa/util/void_type.hpp"
#include "cppa/util/void_type.hpp"
...
@@ -73,4 +73,4 @@ struct if_not_left<util::void_type, Right> {
...
@@ -73,4 +73,4 @@ struct if_not_left<util::void_type, Right> {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // LEFT_OR_RIGHT_HPP
#endif //
CPPA_
LEFT_OR_RIGHT_HPP
cppa/util/producer_consumer_list.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef PRODUCER_CONSUMER_LIST_HPP
#ifndef
CPPA_
PRODUCER_CONSUMER_LIST_HPP
#define PRODUCER_CONSUMER_LIST_HPP
#define
CPPA_
PRODUCER_CONSUMER_LIST_HPP
#define CPPA_CACHE_LINE_SIZE 64
#define CPPA_CACHE_LINE_SIZE 64
...
@@ -182,4 +182,4 @@ class producer_consumer_list {
...
@@ -182,4 +182,4 @@ class producer_consumer_list {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // PRODUCER_CONSUMER_LIST_HPP
#endif //
CPPA_
PRODUCER_CONSUMER_LIST_HPP
cppa/util/projection.hpp
deleted
100644 → 0
View file @
f5767cc0
/******************************************************************************\
* ___ __ *
* /\_ \ __/\ \ *
* \//\ \ /\_\ \ \____ ___ _____ _____ __ *
* \ \ \ \/\ \ \ '__`\ /'___\/\ '__`\/\ '__`\ /'__`\ *
* \_\ \_\ \ \ \ \L\ \/\ \__/\ \ \L\ \ \ \L\ \/\ \L\.\_ *
* /\____\\ \_\ \_,__/\ \____\\ \ ,__/\ \ ,__/\ \__/.\_\ *
* \/____/ \/_/\/___/ \/____/ \ \ \/ \ \ \/ \/__/\/_/ *
* \ \_\ \ \_\ *
* \/_/ \/_/ *
* *
* Copyright (C) 2011, 2012 *
* Dominik Charousset <dominik.charousset@haw-hamburg.de> *
* *
* This file is part of libcppa. *
* libcppa is free software: you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation, either version 3 of the License *
* or (at your option) any later version. *
* *
* libcppa is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with libcppa. If not, see <http://www.gnu.org/licenses/>. *
\******************************************************************************/
#ifndef PROJECTION_HPP
#define PROJECTION_HPP
namespace
cppa
{
namespace
util
{
}
}
// namespace cppa::util
#endif // PROJECTION_HPP
cppa/util/pt_dispatch.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef PT_DISPATCH_HPP
#ifndef
CPPA_
PT_DISPATCH_HPP
#define PT_DISPATCH_HPP
#define
CPPA_
PT_DISPATCH_HPP
namespace
cppa
{
namespace
util
{
namespace
cppa
{
namespace
util
{
...
@@ -61,4 +61,4 @@ void pt_dispatch(primitive_type ptype, Fun&& f) {
...
@@ -61,4 +61,4 @@ void pt_dispatch(primitive_type ptype, Fun&& f) {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // PT_DISPATCH_HPP
#endif //
CPPA_
PT_DISPATCH_HPP
cppa/util/pt_token.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef PT_TOKEN_HPP
#ifndef
CPPA_
PT_TOKEN_HPP
#define PT_TOKEN_HPP
#define
CPPA_
PT_TOKEN_HPP
#include "cppa/primitive_type.hpp"
#include "cppa/primitive_type.hpp"
...
@@ -43,4 +43,4 @@ struct pt_token { static const primitive_type value = PT; };
...
@@ -43,4 +43,4 @@ struct pt_token { static const primitive_type value = PT; };
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // PT_TOKEN_HPP
#endif //
CPPA_
PT_TOKEN_HPP
cppa/util/purge_refs.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef PURGE_REFS_HPP
#ifndef
CPPA_
PURGE_REFS_HPP
#define PURGE_REFS_HPP
#define
CPPA_
PURGE_REFS_HPP
#include <functional>
#include <functional>
...
@@ -68,4 +68,4 @@ struct purge_refs {
...
@@ -68,4 +68,4 @@ struct purge_refs {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // PURGE_REFS_HPP
#endif //
CPPA_
PURGE_REFS_HPP
cppa/util/replace_type.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef REPLACE_TYPE_HPP
#ifndef
CPPA_
REPLACE_TYPE_HPP
#define REPLACE_TYPE_HPP
#define
CPPA_
REPLACE_TYPE_HPP
#include <type_traits>
#include <type_traits>
...
@@ -60,4 +60,4 @@ struct replace_type {
...
@@ -60,4 +60,4 @@ struct replace_type {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // REPLACE_TYPE_HPP
#endif //
CPPA_
REPLACE_TYPE_HPP
cppa/util/ripemd_160.hpp
View file @
5b69972e
...
@@ -65,8 +65,8 @@
...
@@ -65,8 +65,8 @@
*
*
\******************************************************************************/
\******************************************************************************/
#ifndef RIPEMD_160_HPP
#ifndef
CPPA_
RIPEMD_160_HPP
#define RIPEMD_160_HPP
#define
CPPA_
RIPEMD_160_HPP
#include <array>
#include <array>
#include <string>
#include <string>
...
@@ -80,4 +80,4 @@ void ripemd_160(std::array<std::uint8_t, 20>& storage, const std::string& data);
...
@@ -80,4 +80,4 @@ void ripemd_160(std::array<std::uint8_t, 20>& storage, const std::string& data);
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // RIPEMD_160_HPP
#endif //
CPPA_
RIPEMD_160_HPP
cppa/util/rm_option.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef RM_OPTION_HPP
#ifndef
CPPA_
RM_OPTION_HPP
#define RM_OPTION_HPP
#define
CPPA_
RM_OPTION_HPP
#include "cppa/option.hpp"
#include "cppa/option.hpp"
...
@@ -47,4 +47,4 @@ struct rm_option<option<T> > {
...
@@ -47,4 +47,4 @@ struct rm_option<option<T> > {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // RM_OPTION_HPP
#endif //
CPPA_
RM_OPTION_HPP
cppa/util/rm_ref.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef RM_REF_HPP
#ifndef
CPPA_
RM_REF_HPP
#define RM_REF_HPP
#define
CPPA_
RM_REF_HPP
namespace
cppa
{
namespace
util
{
namespace
cppa
{
namespace
util
{
...
@@ -54,4 +54,4 @@ struct rm_ref<void> { };
...
@@ -54,4 +54,4 @@ struct rm_ref<void> { };
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // RM_REF_HPP
#endif //
CPPA_
RM_REF_HPP
cppa/util/shared_lock_guard.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef SHARED_LOCK_GUARD_HPP
#ifndef
CPPA_
SHARED_LOCK_GUARD_HPP
#define SHARED_LOCK_GUARD_HPP
#define
CPPA_
SHARED_LOCK_GUARD_HPP
namespace
cppa
{
namespace
util
{
namespace
cppa
{
namespace
util
{
...
@@ -64,4 +64,4 @@ class shared_lock_guard {
...
@@ -64,4 +64,4 @@ class shared_lock_guard {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // SHARED_LOCK_GUARD_HPP
#endif //
CPPA_
SHARED_LOCK_GUARD_HPP
cppa/util/shared_spinlock.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef SHARED_SPINLOCK_HPP
#ifndef
CPPA_
SHARED_SPINLOCK_HPP
#define SHARED_SPINLOCK_HPP
#define
CPPA_
SHARED_SPINLOCK_HPP
#include <atomic>
#include <atomic>
#include <cstddef>
#include <cstddef>
...
@@ -65,4 +65,4 @@ class shared_spinlock {
...
@@ -65,4 +65,4 @@ class shared_spinlock {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // SHARED_SPINLOCK_HPP
#endif //
CPPA_
SHARED_SPINLOCK_HPP
cppa/util/static_foreach.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef STATIC_FOREACH_HPP
#ifndef
CPPA_
STATIC_FOREACH_HPP
#define STATIC_FOREACH_HPP
#define
CPPA_
STATIC_FOREACH_HPP
#include "cppa/get.hpp"
#include "cppa/get.hpp"
...
@@ -95,4 +95,4 @@ struct static_foreach : static_foreach_impl<(Begin < End), Begin, End> {
...
@@ -95,4 +95,4 @@ struct static_foreach : static_foreach_impl<(Begin < End), Begin, End> {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // STATIC_FOREACH_HPP
#endif //
CPPA_
STATIC_FOREACH_HPP
cppa/util/tbind.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef TBIND_HPP
#ifndef
CPPA_
TBIND_HPP
#define TBIND_HPP
#define
CPPA_
TBIND_HPP
namespace
cppa
{
namespace
util
{
namespace
cppa
{
namespace
util
{
...
@@ -47,4 +47,4 @@ struct tbind {
...
@@ -47,4 +47,4 @@ struct tbind {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // TBIND_HPP
#endif //
CPPA_
TBIND_HPP
cppa/util/type_list.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef
LIB
CPPA_UTIL_TYPE_LIST_HPP
#ifndef CPPA_UTIL_TYPE_LIST_HPP
#define
LIB
CPPA_UTIL_TYPE_LIST_HPP
#define CPPA_UTIL_TYPE_LIST_HPP
#include <typeinfo>
#include <typeinfo>
#include <type_traits>
#include <type_traits>
...
@@ -921,4 +921,4 @@ struct tl_apply<type_list<Ts...>, VarArgTemplate> {
...
@@ -921,4 +921,4 @@ struct tl_apply<type_list<Ts...>, VarArgTemplate> {
*/
*/
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif //
LIB
CPPA_UTIL_TYPE_LIST_HPP
#endif // CPPA_UTIL_TYPE_LIST_HPP
cppa/util/type_pair.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef TYPE_PAIR_HPP
#ifndef
CPPA_
TYPE_PAIR_HPP
#define TYPE_PAIR_HPP
#define
CPPA_
TYPE_PAIR_HPP
namespace
cppa
{
namespace
util
{
namespace
cppa
{
namespace
util
{
...
@@ -60,4 +60,4 @@ struct is_type_pair<type_pair<First, Second> > {
...
@@ -60,4 +60,4 @@ struct is_type_pair<type_pair<First, Second> > {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // TYPE_PAIR_HPP
#endif //
CPPA_
TYPE_PAIR_HPP
cppa/util/upgrade_lock_guard.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef UPGRADE_LOCK_GUARD_HPP
#ifndef
CPPA_
UPGRADE_LOCK_GUARD_HPP
#define UPGRADE_LOCK_GUARD_HPP
#define
CPPA_
UPGRADE_LOCK_GUARD_HPP
namespace
cppa
{
namespace
util
{
namespace
cppa
{
namespace
util
{
...
@@ -61,4 +61,4 @@ class upgrade_lock_guard {
...
@@ -61,4 +61,4 @@ class upgrade_lock_guard {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // UPGRADE_LOCK_GUARD_HPP
#endif //
CPPA_
UPGRADE_LOCK_GUARD_HPP
cppa/util/void_type.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef
LIB
CPPA_UTIL_VOID_TYPE_HPP
#ifndef CPPA_UTIL_VOID_TYPE_HPP
#define
LIB
CPPA_UTIL_VOID_TYPE_HPP
#define CPPA_UTIL_VOID_TYPE_HPP
namespace
cppa
{
namespace
util
{
namespace
cppa
{
namespace
util
{
...
@@ -43,4 +43,4 @@ struct void_type {
...
@@ -43,4 +43,4 @@ struct void_type {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif //
LIB
CPPA_UTIL_VOID_TYPE_HPP
#endif // CPPA_UTIL_VOID_TYPE_HPP
cppa/util/wrapped.hpp
View file @
5b69972e
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
\******************************************************************************/
\******************************************************************************/
#ifndef WRAPPED_HPP
#ifndef
CPPA_
WRAPPED_HPP
#define WRAPPED_HPP
#define
CPPA_
WRAPPED_HPP
namespace
cppa
{
namespace
util
{
namespace
cppa
{
namespace
util
{
...
@@ -49,4 +49,4 @@ struct wrapped< wrapped<T> > {
...
@@ -49,4 +49,4 @@ struct wrapped< wrapped<T> > {
}
}
// namespace cppa::util
}
}
// namespace cppa::util
#endif // WRAPPED_HPP
#endif //
CPPA_
WRAPPED_HPP
examples/math_actor_example.cpp
View file @
5b69972e
...
@@ -45,7 +45,7 @@ struct math_actor : event_based_actor {
...
@@ -45,7 +45,7 @@ struct math_actor : event_based_actor {
on
(
atom
(
"quit"
))
>>
[
=
]()
{
on
(
atom
(
"quit"
))
>>
[
=
]()
{
// set an empty behavior
// set an empty behavior
// (terminates actor with normal exit reason)
// (terminates actor with normal exit reason)
quit
_normal
();
quit
();
}
}
);
);
}
}
...
...
src/abstract_event_based_actor.cpp
View file @
5b69972e
...
@@ -34,7 +34,6 @@
...
@@ -34,7 +34,6 @@
#include "cppa/self.hpp"
#include "cppa/self.hpp"
#include "cppa/abstract_event_based_actor.hpp"
#include "cppa/abstract_event_based_actor.hpp"
#include "cppa/detail/invokable.hpp"
#include "cppa/detail/filter_result.hpp"
#include "cppa/detail/filter_result.hpp"
namespace
cppa
{
namespace
cppa
{
...
@@ -87,12 +86,11 @@ auto abstract_event_based_actor::handle_message(mailbox_element& node) -> handle
...
@@ -87,12 +86,11 @@ auto abstract_event_based_actor::handle_message(mailbox_element& node) -> handle
return
cache_msg
;
return
cache_msg
;
}
}
void
abstract_event_based_actor
::
resume
(
util
::
fiber
*
,
scheduler
::
callback
*
cb
)
{
resume_result
abstract_event_based_actor
::
resume
(
util
::
fiber
*
)
{
auto
done_cb
=
[
&
]()
{
auto
done_cb
=
[
&
]()
{
m_state
.
store
(
abstract_scheduled_actor
::
done
);
m_state
.
store
(
abstract_scheduled_actor
::
done
);
m_loop_stack
.
clear
();
m_loop_stack
.
clear
();
on_exit
();
on_exit
();
cb
->
exec_done
();
};
};
self
.
set
(
this
);
self
.
set
(
this
);
try
{
try
{
...
@@ -109,7 +107,7 @@ void abstract_event_based_actor::resume(util::fiber*, scheduler::callback* cb) {
...
@@ -109,7 +107,7 @@ void abstract_event_based_actor::resume(util::fiber*, scheduler::callback* cb) {
break
;
break
;
}
}
case
abstract_scheduled_actor
:
:
blocked
:
{
case
abstract_scheduled_actor
:
:
blocked
:
{
return
;
return
resume_result
::
actor_blocked
;
}
}
default:
CPPA_CRITICAL
(
"illegal actor state"
);
default:
CPPA_CRITICAL
(
"illegal actor state"
);
};
};
...
@@ -125,7 +123,7 @@ void abstract_event_based_actor::resume(util::fiber*, scheduler::callback* cb) {
...
@@ -125,7 +123,7 @@ void abstract_event_based_actor::resume(util::fiber*, scheduler::callback* cb) {
release_node
(
e
);
release_node
(
e
);
if
(
m_loop_stack
.
empty
())
{
if
(
m_loop_stack
.
empty
())
{
done_cb
();
done_cb
();
return
;
return
resume_result
::
actor_done
;
}
}
// try to match cached messages before receiving new ones
// try to match cached messages before receiving new ones
auto
i
=
m_cache
.
begin
();
auto
i
=
m_cache
.
begin
();
...
@@ -141,7 +139,7 @@ void abstract_event_based_actor::resume(util::fiber*, scheduler::callback* cb) {
...
@@ -141,7 +139,7 @@ void abstract_event_based_actor::resume(util::fiber*, scheduler::callback* cb) {
m_cache
.
erase
(
i
);
m_cache
.
erase
(
i
);
if
(
m_loop_stack
.
empty
())
{
if
(
m_loop_stack
.
empty
())
{
done_cb
();
done_cb
();
return
;
return
resume_result
::
actor_done
;
}
}
i
=
m_cache
.
begin
();
i
=
m_cache
.
begin
();
break
;
break
;
...
@@ -171,6 +169,7 @@ void abstract_event_based_actor::resume(util::fiber*, scheduler::callback* cb) {
...
@@ -171,6 +169,7 @@ void abstract_event_based_actor::resume(util::fiber*, scheduler::callback* cb) {
cleanup
(
exit_reason
::
unhandled_exception
);
cleanup
(
exit_reason
::
unhandled_exception
);
}
}
done_cb
();
done_cb
();
return
resume_result
::
actor_done
;
}
}
void
abstract_event_based_actor
::
on_exit
()
{
void
abstract_event_based_actor
::
on_exit
()
{
...
...
src/
yield
ing_actor.cpp
→
src/
context_switch
ing_actor.cpp
View file @
5b69972e
...
@@ -28,46 +28,48 @@
...
@@ -28,46 +28,48 @@
\******************************************************************************/
\******************************************************************************/
#include "cppa/
detail/yield
ing_actor.hpp"
#include "cppa/
context_switch
ing_actor.hpp"
#ifndef CPPA_DISABLE_CONTEXT_SWITCHING
#ifndef CPPA_DISABLE_CONTEXT_SWITCHING
#include <iostream>
#include <iostream>
#include "cppa/cppa.hpp"
#include "cppa/cppa.hpp"
#include "cppa/self.hpp"
#include "cppa/self.hpp"
#include "cppa/detail/invokable.hpp"
namespace
cppa
{
namespace
detail
{
namespace
cppa
{
yielding_actor
::
yielding_actor
(
std
::
function
<
void
()
>
fun
)
context_switching_actor
::
context_switching_actor
()
:
m_fiber
(
&
yielding_actor
::
trampoline
,
this
)
:
m_fiber
(
&
context_switching_actor
::
trampoline
,
this
)
{
,
m_behavior
(
fun
)
{
}
}
void
yielding_actor
::
run
()
{
context_switching_actor
::
context_switching_actor
(
std
::
function
<
void
()
>
fun
)
CPPA_REQUIRE
(
static_cast
<
bool
>
(
m_behavior
));
:
m_fiber
(
&
context_switching_actor
::
trampoline
,
this
),
m_behavior
(
fun
)
{
}
void
context_switching_actor
::
run
()
{
if
(
m_behavior
)
m_behavior
();
}
void
context_switching_actor
::
trampoline
(
void
*
this_ptr
)
{
auto
_this
=
reinterpret_cast
<
context_switching_actor
*>
(
this_ptr
);
bool
cleanup_called
=
false
;
bool
cleanup_called
=
false
;
try
{
m_behavior
();
}
try
{
_this
->
run
();
}
catch
(
actor_exited
&
)
{
catch
(
actor_exited
&
)
{
// cleanup already called by scheduled_actor::quit
// cleanup already called by scheduled_actor::quit
cleanup_called
=
true
;
cleanup_called
=
true
;
}
}
catch
(...)
{
catch
(...)
{
cleanup
(
exit_reason
::
unhandled_exception
);
_this
->
cleanup
(
exit_reason
::
unhandled_exception
);
cleanup_called
=
true
;
cleanup_called
=
true
;
}
}
if
(
!
cleanup_called
)
cleanup
(
exit_reason
::
normal
);
if
(
!
cleanup_called
)
_this
->
cleanup
(
exit_reason
::
normal
);
on_exit
();
_this
->
on_exit
();
std
::
atomic_thread_fence
(
std
::
memory_order_seq_cst
);
std
::
atomic_thread_fence
(
std
::
memory_order_seq_cst
);
yield
(
yield_state
::
done
);
detail
::
yield
(
detail
::
yield_state
::
done
);
}
void
yielding_actor
::
trampoline
(
void
*
ptr_arg
)
{
reinterpret_cast
<
yielding_actor
*>
(
ptr_arg
)
->
run
();
}
}
recursive_queue_node
*
yield
ing_actor
::
receive_node
()
{
detail
::
recursive_queue_node
*
context_switch
ing_actor
::
receive_node
()
{
recursive_queue_node
*
e
=
m_mailbox
.
try_pop
();
detail
::
recursive_queue_node
*
e
=
m_mailbox
.
try_pop
();
while
(
e
==
nullptr
)
{
while
(
e
==
nullptr
)
{
if
(
m_mailbox
.
can_fetch_more
()
==
false
)
{
if
(
m_mailbox
.
can_fetch_more
()
==
false
)
{
m_state
.
store
(
abstract_scheduled_actor
::
about_to_block
);
m_state
.
store
(
abstract_scheduled_actor
::
about_to_block
);
...
@@ -79,7 +81,7 @@ recursive_queue_node* yielding_actor::receive_node() {
...
@@ -79,7 +81,7 @@ recursive_queue_node* yielding_actor::receive_node() {
}
}
else
{
else
{
// wait until actor becomes rescheduled
// wait until actor becomes rescheduled
yield
(
yield_state
::
blocked
);
detail
::
yield
(
detail
::
yield_state
::
blocked
);
}
}
}
}
e
=
m_mailbox
.
try_pop
();
e
=
m_mailbox
.
try_pop
();
...
@@ -87,11 +89,11 @@ recursive_queue_node* yielding_actor::receive_node() {
...
@@ -87,11 +89,11 @@ recursive_queue_node* yielding_actor::receive_node() {
return
e
;
return
e
;
}
}
void
yield
ing_actor
::
dequeue
(
partial_function
&
fun
)
{
void
context_switch
ing_actor
::
dequeue
(
partial_function
&
fun
)
{
m_recv_policy
.
receive
(
this
,
fun
);
m_recv_policy
.
receive
(
this
,
fun
);
}
}
void
yield
ing_actor
::
dequeue
(
behavior
&
bhvr
)
{
void
context_switch
ing_actor
::
dequeue
(
behavior
&
bhvr
)
{
if
(
bhvr
.
timeout
().
valid
()
==
false
)
{
if
(
bhvr
.
timeout
().
valid
()
==
false
)
{
m_recv_policy
.
receive
(
this
,
bhvr
.
get_partial_function
());
m_recv_policy
.
receive
(
this
,
bhvr
.
get_partial_function
());
}
}
...
@@ -110,13 +112,13 @@ void yielding_actor::dequeue(behavior& bhvr) {
...
@@ -110,13 +112,13 @@ void yielding_actor::dequeue(behavior& bhvr) {
}
}
}
}
void
yielding_actor
::
resume
(
util
::
fiber
*
from
,
scheduler
::
callback
*
callback
)
{
resume_result
context_switching_actor
::
resume
(
util
::
fiber
*
from
)
{
using
namespace
detail
;
self
.
set
(
this
);
self
.
set
(
this
);
for
(;;)
{
for
(;;)
{
switch
(
call
(
&
m_fiber
,
from
))
{
switch
(
call
(
&
m_fiber
,
from
))
{
case
yield_state
:
:
done
:
{
case
yield_state
:
:
done
:
{
callback
->
exec_done
();
return
resume_result
::
actor_done
;
return
;
}
}
case
yield_state
:
:
ready
:
{
case
yield_state
:
:
ready
:
{
break
;
break
;
...
@@ -129,7 +131,7 @@ void yielding_actor::resume(util::fiber* from, scheduler::callback* callback) {
...
@@ -129,7 +131,7 @@ void yielding_actor::resume(util::fiber* from, scheduler::callback* callback) {
}
}
case
abstract_scheduled_actor
:
:
blocked
:
{
case
abstract_scheduled_actor
:
:
blocked
:
{
// wait until someone re-schedules that actor
// wait until someone re-schedules that actor
return
;
return
resume_result
::
actor_blocked
;
}
}
default:
{
default:
{
CPPA_CRITICAL
(
"illegal yield result"
);
CPPA_CRITICAL
(
"illegal yield result"
);
...
@@ -144,7 +146,7 @@ void yielding_actor::resume(util::fiber* from, scheduler::callback* callback) {
...
@@ -144,7 +146,7 @@ void yielding_actor::resume(util::fiber* from, scheduler::callback* callback) {
}
}
}
}
}
}
// namespace cppa::detail
}
// namespace cppa
#else // ifdef CPPA_DISABLE_CONTEXT_SWITCHING
#else // ifdef CPPA_DISABLE_CONTEXT_SWITCHING
...
...
src/invokable.cpp
deleted
100644 → 0
View file @
f5767cc0
/******************************************************************************\
* ___ __ *
* /\_ \ __/\ \ *
* \//\ \ /\_\ \ \____ ___ _____ _____ __ *
* \ \ \ \/\ \ \ '__`\ /'___\/\ '__`\/\ '__`\ /'__`\ *
* \_\ \_\ \ \ \ \L\ \/\ \__/\ \ \L\ \ \ \L\ \/\ \L\.\_ *
* /\____\\ \_\ \_,__/\ \____\\ \ ,__/\ \ ,__/\ \__/.\_\ *
* \/____/ \/_/\/___/ \/____/ \ \ \/ \ \ \/ \/__/\/_/ *
* \ \_\ \ \_\ *
* \/_/ \/_/ *
* *
* Copyright (C) 2011, 2012 *
* Dominik Charousset <dominik.charousset@haw-hamburg.de> *
* *
* This file is part of libcppa. *
* libcppa is free software: you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation, either version 3 of the License *
* or (at your option) any later version. *
* *
* libcppa is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with libcppa. If not, see <http://www.gnu.org/licenses/>. *
\******************************************************************************/
#include "cppa/detail/invokable.hpp"
namespace
cppa
{
namespace
detail
{
invokable
::~
invokable
()
{
}
bool
invokable
::
invoke
(
any_tuple
&
)
const
{
return
false
;
}
bool
invokable
::
unsafe_invoke
(
any_tuple
&
)
const
{
return
false
;
}
bool
invokable
::
types_match
(
const
any_tuple
&
)
const
{
return
false
;
}
bool
invokable
::
could_invoke
(
const
any_tuple
&
)
const
{
return
false
;
}
}
}
// namespace cppa::detail
src/mock_scheduler.cpp
View file @
5b69972e
...
@@ -40,12 +40,12 @@
...
@@ -40,12 +40,12 @@
#include "cppa/attachable.hpp"
#include "cppa/attachable.hpp"
#include "cppa/local_actor.hpp"
#include "cppa/local_actor.hpp"
#include "cppa/scheduled_actor.hpp"
#include "cppa/scheduled_actor.hpp"
#include "cppa/thread_mapped_actor.hpp"
#include "cppa/abstract_event_based_actor.hpp"
#include "cppa/abstract_event_based_actor.hpp"
#include "cppa/detail/actor_count.hpp"
#include "cppa/detail/actor_count.hpp"
#include "cppa/detail/mock_scheduler.hpp"
#include "cppa/detail/mock_scheduler.hpp"
#include "cppa/detail/to_uniform_name.hpp"
#include "cppa/detail/to_uniform_name.hpp"
#include "cppa/detail/converted_thread_context.hpp"
using
std
::
cout
;
using
std
::
cout
;
using
std
::
cerr
;
using
std
::
cerr
;
...
@@ -81,7 +81,7 @@ std::thread mock_scheduler::spawn_hidden_impl(std::function<void()> what, local_
...
@@ -81,7 +81,7 @@ std::thread mock_scheduler::spawn_hidden_impl(std::function<void()> what, local_
actor_ptr
mock_scheduler
::
spawn_impl
(
std
::
function
<
void
()
>
what
)
{
actor_ptr
mock_scheduler
::
spawn_impl
(
std
::
function
<
void
()
>
what
)
{
inc_actor_count
();
inc_actor_count
();
std
::
atomic_thread_fence
(
std
::
memory_order_seq_cst
);
std
::
atomic_thread_fence
(
std
::
memory_order_seq_cst
);
intrusive_ptr
<
local_actor
>
ctx
{
new
detail
::
converted_thread_context
};
intrusive_ptr
<
local_actor
>
ctx
{
new
thread_mapped_actor
};
std
::
thread
{
run_actor
,
ctx
,
std
::
move
(
what
)}.
detach
();
std
::
thread
{
run_actor
,
ctx
,
std
::
move
(
what
)}.
detach
();
return
std
::
move
(
ctx
);
return
std
::
move
(
ctx
);
}
}
...
...
src/network_manager.cpp
View file @
5b69972e
...
@@ -38,11 +38,12 @@
...
@@ -38,11 +38,12 @@
#include <sys/time.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/types.h>
#include "cppa/thread_mapped_actor.hpp"
#include "cppa/detail/mailman.hpp"
#include "cppa/detail/mailman.hpp"
#include "cppa/detail/post_office.hpp"
#include "cppa/detail/post_office.hpp"
#include "cppa/detail/mock_scheduler.hpp"
#include "cppa/detail/mock_scheduler.hpp"
#include "cppa/detail/network_manager.hpp"
#include "cppa/detail/network_manager.hpp"
#include "cppa/detail/converted_thread_context.hpp"
namespace
{
namespace
{
...
@@ -64,10 +65,10 @@ struct network_manager_impl : network_manager {
...
@@ -64,10 +65,10 @@ struct network_manager_impl : network_manager {
CPPA_CRITICAL
(
"cannot create pipe"
);
CPPA_CRITICAL
(
"cannot create pipe"
);
}
}
m_post_office
.
reset
(
new
converted_thread_context
);
m_post_office
.
reset
(
new
thread_mapped_actor
);
m_post_office_thread
=
mock_scheduler
::
spawn_hidden_impl
(
std
::
bind
(
post_office_loop
,
pipe_fd
[
0
]),
m_post_office
);
m_post_office_thread
=
mock_scheduler
::
spawn_hidden_impl
(
std
::
bind
(
post_office_loop
,
pipe_fd
[
0
]),
m_post_office
);
m_mailman
.
reset
(
new
converted_thread_context
);
m_mailman
.
reset
(
new
thread_mapped_actor
);
m_mailman_thread
=
mock_scheduler
::
spawn_hidden_impl
(
mailman_loop
,
m_mailman
);
m_mailman_thread
=
mock_scheduler
::
spawn_hidden_impl
(
mailman_loop
,
m_mailman
);
}
}
...
...
src/partial_function.cpp
View file @
5b69972e
...
@@ -33,11 +33,9 @@
...
@@ -33,11 +33,9 @@
#include "cppa/config.hpp"
#include "cppa/config.hpp"
#include "cppa/behavior.hpp"
#include "cppa/behavior.hpp"
#include "cppa/partial_function.hpp"
#include "cppa/partial_function.hpp"
#include "cppa/detail/invokable.hpp"
namespace
cppa
{
namespace
cppa
{
partial_function
::
partial_function
(
impl_ptr
&&
ptr
)
:
m_impl
(
std
::
move
(
ptr
))
{
partial_function
::
partial_function
(
impl_ptr
&&
ptr
)
:
m_impl
(
std
::
move
(
ptr
))
{
}
}
}
// namespace cppa
}
// namespace cppa
src/primitive_variant.cpp
View file @
5b69972e
...
@@ -144,7 +144,7 @@ primitive_variant& primitive_variant::operator=(primitive_variant&& other) {
...
@@ -144,7 +144,7 @@ primitive_variant& primitive_variant::operator=(primitive_variant&& other) {
return
*
this
;
return
*
this
;
}
}
bool
operator
==
(
const
primitive_variant
&
lhs
,
const
primitive_variant
&
rhs
)
{
bool
equal
(
const
primitive_variant
&
lhs
,
const
primitive_variant
&
rhs
)
{
comparator
cmp
(
lhs
,
rhs
);
comparator
cmp
(
lhs
,
rhs
);
util
::
pt_dispatch
(
lhs
.
m_ptype
,
cmp
);
util
::
pt_dispatch
(
lhs
.
m_ptype
,
cmp
);
return
cmp
.
result
;
return
cmp
.
result
;
...
...
src/scheduled_actor.cpp
View file @
5b69972e
...
@@ -28,19 +28,17 @@
...
@@ -28,19 +28,17 @@
\******************************************************************************/
\******************************************************************************/
#include "cppa/scheduler.hpp"
#include "cppa/scheduled_actor.hpp"
#include "cppa/scheduled_actor.hpp"
namespace
cppa
{
namespace
cppa
{
scheduled_actor
::
scheduled_actor
(
bool
enable_pending_enqueue
)
scheduled_actor
::
scheduled_actor
(
bool
enable_chained_send
)
:
local_actor
(
enable_pending_enqueue
),
next
(
nullptr
),
m_scheduler
(
nullptr
)
{
:
local_actor
(
enable_chained_send
),
next
(
nullptr
),
m_scheduler
(
nullptr
)
{
}
}
void
scheduled_actor
::
on_exit
()
{
void
scheduled_actor
::
on_exit
()
{
}
}
void
scheduled_actor
::
init
()
{
void
scheduled_actor
::
init
()
{
}
}
scheduled_actor
*
scheduled_actor
::
attach_to_scheduler
(
scheduler
*
sched
)
{
scheduled_actor
*
scheduled_actor
::
attach_to_scheduler
(
scheduler
*
sched
)
{
CPPA_REQUIRE
(
sched
!=
nullptr
);
CPPA_REQUIRE
(
sched
!=
nullptr
);
...
@@ -49,5 +47,4 @@ scheduled_actor* scheduled_actor::attach_to_scheduler(scheduler* sched) {
...
@@ -49,5 +47,4 @@ scheduled_actor* scheduled_actor::attach_to_scheduler(scheduler* sched) {
return
this
;
return
this
;
}
}
}
// namespace cppa
}
// namespace cppa
src/scheduled_actor_dummy.cpp
View file @
5b69972e
...
@@ -32,23 +32,19 @@
...
@@ -32,23 +32,19 @@
namespace
cppa
{
namespace
detail
{
namespace
cppa
{
namespace
detail
{
void
scheduled_actor_dummy
::
resume
(
util
::
fiber
*
,
scheduler
::
callback
*
)
{
resume_result
scheduled_actor_dummy
::
resume
(
util
::
fiber
*
)
{
return
resume_result
::
actor_blocked
;
}
}
void
scheduled_actor_dummy
::
quit
(
std
::
uint32_t
)
{
void
scheduled_actor_dummy
::
quit
(
std
::
uint32_t
)
{
}
}
void
scheduled_actor_dummy
::
dequeue
(
behavior
&
)
{
void
scheduled_actor_dummy
::
dequeue
(
behavior
&
)
{
}
}
void
scheduled_actor_dummy
::
dequeue
(
partial_function
&
)
{
void
scheduled_actor_dummy
::
dequeue
(
partial_function
&
)
{
}
}
void
scheduled_actor_dummy
::
link_to
(
intrusive_ptr
<
actor
>&
)
{
void
scheduled_actor_dummy
::
link_to
(
intrusive_ptr
<
actor
>&
)
{
}
}
void
scheduled_actor_dummy
::
unlink_from
(
intrusive_ptr
<
actor
>&
)
{
void
scheduled_actor_dummy
::
unlink_from
(
intrusive_ptr
<
actor
>&
)
{
}
}
bool
scheduled_actor_dummy
::
establish_backlink
(
intrusive_ptr
<
actor
>&
)
{
bool
scheduled_actor_dummy
::
establish_backlink
(
intrusive_ptr
<
actor
>&
)
{
return
false
;
return
false
;
...
@@ -58,8 +54,7 @@ bool scheduled_actor_dummy::remove_backlink(intrusive_ptr<actor>&) {
...
@@ -58,8 +54,7 @@ bool scheduled_actor_dummy::remove_backlink(intrusive_ptr<actor>&) {
return
false
;
return
false
;
}
}
void
scheduled_actor_dummy
::
detach
(
const
attachable
::
token
&
)
{
void
scheduled_actor_dummy
::
detach
(
const
attachable
::
token
&
)
{
}
}
bool
scheduled_actor_dummy
::
attach
(
attachable
*
)
{
bool
scheduled_actor_dummy
::
attach
(
attachable
*
)
{
return
false
;
return
false
;
...
...
src/scheduler.cpp
View file @
5b69972e
...
@@ -39,12 +39,12 @@
...
@@ -39,12 +39,12 @@
#include "cppa/to_string.hpp"
#include "cppa/to_string.hpp"
#include "cppa/scheduler.hpp"
#include "cppa/scheduler.hpp"
#include "cppa/local_actor.hpp"
#include "cppa/local_actor.hpp"
#include "cppa/thread_mapped_actor.hpp"
#include "cppa/detail/actor_count.hpp"
#include "cppa/detail/actor_count.hpp"
#include "cppa/detail/mock_scheduler.hpp"
#include "cppa/detail/mock_scheduler.hpp"
#include "cppa/detail/singleton_manager.hpp"
#include "cppa/detail/singleton_manager.hpp"
#include "cppa/detail/thread_pool_scheduler.hpp"
#include "cppa/detail/thread_pool_scheduler.hpp"
#include "cppa/detail/converted_thread_context.hpp"
namespace
{
namespace
{
...
@@ -73,9 +73,9 @@ class scheduler_helper {
...
@@ -73,9 +73,9 @@ class scheduler_helper {
public:
public:
typedef
intrusive_ptr
<
detail
::
converted_thread_context
>
ptr_type
;
typedef
intrusive_ptr
<
thread_mapped_actor
>
ptr_type
;
scheduler_helper
()
:
m_worker
(
new
detail
::
converted_thread_context
)
{
scheduler_helper
()
:
m_worker
(
new
thread_mapped_actor
)
{
}
}
void
start
()
{
void
start
()
{
...
@@ -214,6 +214,4 @@ scheduler* get_scheduler() {
...
@@ -214,6 +214,4 @@ scheduler* get_scheduler() {
return
result
;
return
result
;
}
}
scheduler
::
callback
::~
callback
()
{
}
}
// namespace cppa
}
// namespace cppa
src/self.cpp
View file @
5b69972e
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
#include "cppa/any_tuple.hpp"
#include "cppa/any_tuple.hpp"
#include "cppa/scheduler.hpp"
#include "cppa/scheduler.hpp"
#include "cppa/local_actor.hpp"
#include "cppa/local_actor.hpp"
#include "cppa/
detail/converted_thread_context
.hpp"
#include "cppa/
thread_mapped_actor
.hpp"
namespace
{
namespace
{
...
@@ -47,7 +47,7 @@ boost::thread_specific_ptr<cppa::local_actor> t_this_context(&cppa::self_type::c
...
@@ -47,7 +47,7 @@ boost::thread_specific_ptr<cppa::local_actor> t_this_context(&cppa::self_type::c
namespace
cppa
{
namespace
cppa
{
void
self_type
::
cleanup_fun
(
cppa
::
local_actor
*
what
)
{
void
self_type
::
cleanup_fun
(
cppa
::
local_actor
*
what
)
{
auto
ptr
=
dynamic_cast
<
detail
::
converted_thread_context
*>
(
what
);
auto
ptr
=
dynamic_cast
<
thread_mapped_actor
*>
(
what
);
if
(
ptr
)
{
if
(
ptr
)
{
// make sure "unspawned" actors quit properly
// make sure "unspawned" actors quit properly
ptr
->
cleanup
(
cppa
::
exit_reason
::
normal
);
ptr
->
cleanup
(
cppa
::
exit_reason
::
normal
);
...
@@ -63,7 +63,7 @@ void self_type::set_impl(local_actor* ptr) {
...
@@ -63,7 +63,7 @@ void self_type::set_impl(local_actor* ptr) {
local_actor
*
self_type
::
get_impl
()
{
local_actor
*
self_type
::
get_impl
()
{
auto
result
=
t_this_context
.
get
();
auto
result
=
t_this_context
.
get
();
if
(
result
==
nullptr
)
{
if
(
result
==
nullptr
)
{
result
=
new
detail
::
converted_thread_context
;
result
=
new
thread_mapped_actor
;
result
->
ref
();
result
->
ref
();
get_scheduler
()
->
register_converted_context
(
result
);
get_scheduler
()
->
register_converted_context
(
result
);
t_this_context
.
reset
(
result
);
t_this_context
.
reset
(
result
);
...
...
src/singleton_manager.cpp
View file @
5b69972e
...
@@ -31,10 +31,11 @@
...
@@ -31,10 +31,11 @@
#include <atomic>
#include <atomic>
#include <iostream>
#include <iostream>
#include "cppa/any_tuple.hpp"
#include "cppa/local_actor.hpp"
#include "cppa/scheduler.hpp"
#include "cppa/scheduler.hpp"
#include "cppa/exception.hpp"
#include "cppa/exception.hpp"
#include "cppa/any_tuple.hpp"
#include "cppa/local_actor.hpp"
#include "cppa/thread_mapped_actor.hpp"
#include "cppa/detail/actor_count.hpp"
#include "cppa/detail/actor_count.hpp"
#include "cppa/detail/empty_tuple.hpp"
#include "cppa/detail/empty_tuple.hpp"
...
@@ -44,19 +45,20 @@
...
@@ -44,19 +45,20 @@
#include "cppa/detail/singleton_manager.hpp"
#include "cppa/detail/singleton_manager.hpp"
#include "cppa/detail/thread_pool_scheduler.hpp"
#include "cppa/detail/thread_pool_scheduler.hpp"
#include "cppa/detail/uniform_type_info_map.hpp"
#include "cppa/detail/uniform_type_info_map.hpp"
#include "cppa/detail/converted_thread_context.hpp"
namespace
{
namespace
{
using
namespace
cppa
;
using
namespace
cppa
;
using
namespace
cppa
::
detail
;
using
namespace
cppa
::
detail
;
std
::
atomic
<
uniform_type_info_map
*>
s_uniform_type_info_map
(
nullptr
);
//volatile uniform_type_info_map* s_uniform_type_info_map = 0;
std
::
atomic
<
network_manager
*>
s_network_manager
(
nullptr
);
std
::
atomic
<
actor_registry
*>
s_actor_registry
(
nullptr
);
std
::
atomic
<
uniform_type_info_map
*>
s_uniform_type_info_map
;
std
::
atomic
<
group_manager
*>
s_group_manager
(
nullptr
);
std
::
atomic
<
network_manager
*>
s_network_manager
;
std
::
atomic
<
empty_tuple
*>
s_empty_tuple
(
nullptr
);
std
::
atomic
<
actor_registry
*>
s_actor_registry
;
std
::
atomic
<
scheduler
*>
s_scheduler
(
nullptr
);
std
::
atomic
<
group_manager
*>
s_group_manager
;
std
::
atomic
<
empty_tuple
*>
s_empty_tuple
;
std
::
atomic
<
scheduler
*>
s_scheduler
;
template
<
typename
T
>
template
<
typename
T
>
void
stop_and_kill
(
std
::
atomic
<
T
*>&
ptr
)
{
void
stop_and_kill
(
std
::
atomic
<
T
*>&
ptr
)
{
...
@@ -96,14 +98,15 @@ void delete_singletons() {
...
@@ -96,14 +98,15 @@ void delete_singletons() {
template
<
typename
T
>
template
<
typename
T
>
T
*
lazy_get
(
std
::
atomic
<
T
*>&
ptr
,
bool
register_atexit_fun
=
false
)
{
T
*
lazy_get
(
std
::
atomic
<
T
*>&
ptr
,
bool
register_atexit_fun
=
false
)
{
T
*
result
=
ptr
.
load
();
T
*
result
=
ptr
.
load
(
std
::
memory_order_seq_cst
);
if
(
result
==
nullptr
)
{
if
(
result
==
nullptr
)
{
auto
tmp
=
new
T
;
auto
tmp
=
new
T
;
if
(
ptr
.
compare_exchange_strong
(
result
,
tmp
)
==
false
)
{
if
(
ptr
.
compare_exchange_strong
(
result
,
tmp
,
std
::
memory_order_seq_cst
)
)
{
delete
tmp
;
return
tmp
;
}
}
else
{
else
{
result
=
tmp
;
delete
tmp
;
return
lazy_get
(
ptr
,
register_atexit_fun
);
}
}
/*
/*
else {
else {
...
@@ -130,6 +133,15 @@ actor_registry* singleton_manager::get_actor_registry() {
...
@@ -130,6 +133,15 @@ actor_registry* singleton_manager::get_actor_registry() {
}
}
uniform_type_info_map
*
singleton_manager
::
get_uniform_type_info_map
()
{
uniform_type_info_map
*
singleton_manager
::
get_uniform_type_info_map
()
{
/*
auto result = const_cast<uniform_type_info_map*>(s_uniform_type_info_map);
if (result == nullptr) {
auto tmp = new uniform_type_info_map;
std::atomic_thread_fence(std::memory_order_seq_cst);
}
return result;
*/
return
lazy_get
(
s_uniform_type_info_map
,
true
);
return
lazy_get
(
s_uniform_type_info_map
,
true
);
}
}
...
...
src/stacked_event_based_actor.cpp
View file @
5b69972e
...
@@ -32,10 +32,6 @@
...
@@ -32,10 +32,6 @@
namespace
cppa
{
namespace
cppa
{
void
stacked_event_based_actor
::
quit_normal
()
{
m_loop_stack
.
clear
();
}
void
stacked_event_based_actor
::
unbecome
()
{
void
stacked_event_based_actor
::
unbecome
()
{
if
(
!
m_loop_stack
.
empty
())
{
if
(
!
m_loop_stack
.
empty
())
{
m_loop_stack
.
pop_back
();
m_loop_stack
.
pop_back
();
...
...
src/
converted_thread_context
.cpp
→
src/
thread_mapped_actor
.cpp
View file @
5b69972e
...
@@ -36,13 +36,13 @@
...
@@ -36,13 +36,13 @@
#include "cppa/self.hpp"
#include "cppa/self.hpp"
#include "cppa/to_string.hpp"
#include "cppa/to_string.hpp"
#include "cppa/exception.hpp"
#include "cppa/exception.hpp"
#include "cppa/thread_mapped_actor.hpp"
#include "cppa/detail/matches.hpp"
#include "cppa/detail/matches.hpp"
#include "cppa/detail/invokable.hpp"
#include "cppa/detail/converted_thread_context.hpp"
namespace
cppa
{
namespace
detail
{
namespace
cppa
{
void
converted_thread_context
::
quit
(
std
::
uint32_t
reason
)
{
void
thread_mapped_actor
::
quit
(
std
::
uint32_t
reason
)
{
super
::
cleanup
(
reason
);
super
::
cleanup
(
reason
);
// actor_exited should not be catched, but if anyone does,
// actor_exited should not be catched, but if anyone does,
// self must point to a newly created instance
// self must point to a newly created instance
...
@@ -50,21 +50,21 @@ void converted_thread_context::quit(std::uint32_t reason) {
...
@@ -50,21 +50,21 @@ void converted_thread_context::quit(std::uint32_t reason) {
throw
actor_exited
(
reason
);
throw
actor_exited
(
reason
);
}
}
void
converted_thread_context
::
enqueue
(
actor
*
sender
,
any_tuple
msg
)
{
void
thread_mapped_actor
::
enqueue
(
actor
*
sender
,
any_tuple
msg
)
{
auto
node
=
fetch_node
(
sender
,
std
::
move
(
msg
));
auto
node
=
fetch_node
(
sender
,
std
::
move
(
msg
));
CPPA_REQUIRE
(
node
->
marked
==
false
);
CPPA_REQUIRE
(
node
->
marked
==
false
);
m_mailbox
.
push_back
(
node
);
m_mailbox
.
push_back
(
node
);
}
}
void
converted_thread_context
::
dequeue
(
partial_function
&
fun
)
{
// override
void
thread_mapped_actor
::
dequeue
(
partial_function
&
fun
)
{
// override
m_recv_policy
.
receive
(
this
,
fun
);
m_recv_policy
.
receive
(
this
,
fun
);
}
}
void
converted_thread_context
::
dequeue
(
behavior
&
bhvr
)
{
// override
void
thread_mapped_actor
::
dequeue
(
behavior
&
bhvr
)
{
// override
auto
&
fun
=
bhvr
.
get_partial_function
();
auto
&
fun
=
bhvr
.
get_partial_function
();
if
(
bhvr
.
timeout
().
valid
()
==
false
)
{
if
(
bhvr
.
timeout
().
valid
()
==
false
)
{
// suppress virtual function call
// suppress virtual function call
converted_thread_context
::
dequeue
(
fun
);
thread_mapped_actor
::
dequeue
(
fun
);
}
}
else
if
(
m_recv_policy
.
invoke_from_cache
(
this
,
fun
)
==
false
)
{
else
if
(
m_recv_policy
.
invoke_from_cache
(
this
,
fun
)
==
false
)
{
if
(
bhvr
.
timeout
().
is_zero
())
{
if
(
bhvr
.
timeout
().
is_zero
())
{
...
@@ -78,7 +78,7 @@ void converted_thread_context::dequeue(behavior& bhvr) { // override
...
@@ -78,7 +78,7 @@ void converted_thread_context::dequeue(behavior& bhvr) { // override
else
{
else
{
auto
timeout
=
std
::
chrono
::
high_resolution_clock
::
now
();
auto
timeout
=
std
::
chrono
::
high_resolution_clock
::
now
();
timeout
+=
bhvr
.
timeout
();
timeout
+=
bhvr
.
timeout
();
recursive_queue_node
*
e
=
m_mailbox
.
try_pop
(
timeout
);
detail
::
recursive_queue_node
*
e
=
m_mailbox
.
try_pop
(
timeout
);
while
(
e
!=
nullptr
)
{
while
(
e
!=
nullptr
)
{
CPPA_REQUIRE
(
e
->
marked
==
false
);
CPPA_REQUIRE
(
e
->
marked
==
false
);
if
(
m_recv_policy
.
invoke
(
this
,
e
,
fun
))
return
;
if
(
m_recv_policy
.
invoke
(
this
,
e
,
fun
))
return
;
...
@@ -89,7 +89,7 @@ void converted_thread_context::dequeue(behavior& bhvr) { // override
...
@@ -89,7 +89,7 @@ void converted_thread_context::dequeue(behavior& bhvr) { // override
}
}
}
}
filter_result
converted_thread_context
::
filter_msg
(
const
any_tuple
&
msg
)
{
detail
::
filter_result
thread_mapped_actor
::
filter_msg
(
const
any_tuple
&
msg
)
{
auto
&
arr
=
detail
::
static_types_array
<
atom_value
,
std
::
uint32_t
>::
arr
;
auto
&
arr
=
detail
::
static_types_array
<
atom_value
,
std
::
uint32_t
>::
arr
;
if
(
m_trap_exit
==
false
if
(
m_trap_exit
==
false
&&
msg
.
size
()
==
2
&&
msg
.
size
()
==
2
...
@@ -101,11 +101,11 @@ filter_result converted_thread_context::filter_msg(const any_tuple& msg) {
...
@@ -101,11 +101,11 @@ filter_result converted_thread_context::filter_msg(const any_tuple& msg) {
if
(
v1
!=
exit_reason
::
normal
)
{
if
(
v1
!=
exit_reason
::
normal
)
{
quit
(
v1
);
quit
(
v1
);
}
}
return
normal_exit_signal
;
return
detail
::
normal_exit_signal
;
}
}
}
}
return
ordinary_message
;
return
detail
::
ordinary_message
;
}
}
}
}
// namespace cppa::detail
}
// namespace cppa::detail
src/thread_pool_scheduler.cpp
View file @
5b69972e
...
@@ -36,10 +36,9 @@
...
@@ -36,10 +36,9 @@
#include "cppa/abstract_event_based_actor.hpp"
#include "cppa/abstract_event_based_actor.hpp"
#include "cppa/detail/invokable.hpp"
#include "cppa/detail/actor_count.hpp"
#include "cppa/detail/actor_count.hpp"
#include "cppa/detail/mock_scheduler.hpp"
#include "cppa/detail/mock_scheduler.hpp"
#include "cppa/
detail/yield
ing_actor.hpp"
#include "cppa/
context_switch
ing_actor.hpp"
#include "cppa/detail/thread_pool_scheduler.hpp"
#include "cppa/detail/thread_pool_scheduler.hpp"
using
std
::
cout
;
using
std
::
cout
;
...
@@ -116,53 +115,45 @@ struct thread_pool_scheduler::worker {
...
@@ -116,53 +115,45 @@ struct thread_pool_scheduler::worker {
void
operator
()()
{
void
operator
()()
{
util
::
fiber
fself
;
util
::
fiber
fself
;
struct
handler
:
scheduler
::
callback
{
scheduled_actor
*
job
=
nullptr
;
scheduled_actor
*
job
;
auto
fetch_pending
=
[
&
job
]()
->
scheduled_actor
*
{
scheduled_actor
*
pending_job
;
CPPA_REQUIRE
(
job
!=
nullptr
);
handler
()
:
job
(
nullptr
),
pending_job
(
nullptr
)
{
}
scheduled_actor
*
result
=
nullptr
;
void
exec_done
()
{
if
(
job
->
chained_actor
()
!=
nullptr
)
{
if
(
job
->
chained_actor
())
{
result
=
static_cast
<
scheduled_actor
*>
(
job
->
chained_actor
().
release
());
pending_job
=
static_cast
<
scheduled_actor
*>
(
job
->
chained_actor
().
get
());
job
->
chained_actor
().
reset
();
}
if
(
!
job
->
deref
())
delete
job
;
std
::
atomic_thread_fence
(
std
::
memory_order_seq_cst
);
dec_actor_count
();
job
=
nullptr
;
}
}
return
result
;
};
};
handler
h
;
for
(;;)
{
for
(;;)
{
h
.
job
=
aggressive_polling
();
job
=
aggressive_polling
();
if
(
!
h
.
job
)
{
if
(
job
==
nullptr
)
{
h
.
job
=
less_aggressive_polling
();
job
=
less_aggressive_polling
();
if
(
!
h
.
job
)
{
if
(
job
==
nullptr
)
{
h
.
job
=
relaxed_polling
();
job
=
relaxed_polling
();
}
}
}
}
if
(
h
.
job
==
m_dummy
)
{
if
(
job
==
m_dummy
)
{
// dummy of doom received ...
// dummy of doom received ...
m_job_queue
->
push_back
(
h
.
job
);
// kill the next guy
m_job_queue
->
push_back
(
job
);
// kill the next guy
return
;
// and say goodbye
return
;
// and say goodbye
}
}
else
{
else
{
do
{
do
{
h
.
job
->
resume
(
&
fself
,
&
h
);
switch
(
job
->
resume
(
&
fself
))
{
if
(
h
.
job
)
{
case
resume_result
:
:
actor_done
:
{
if
(
h
.
job
->
chained_actor
())
{
scheduled_actor
*
pending
=
fetch_pending
();
h
.
pending_job
=
static_cast
<
scheduled_actor
*>
(
h
.
job
->
chained_actor
().
get
())
;
if
(
!
job
->
deref
())
delete
job
;
h
.
job
->
chained_actor
().
reset
(
);
std
::
atomic_thread_fence
(
std
::
memory_order_seq_cst
);
}
dec_actor_count
();
else
{
job
=
pending
;
h
.
job
=
nullptr
;
break
;
}
}
case
resume_result
:
:
actor_blocked
:
{
job
=
fetch_pending
();
}
}
if
(
h
.
pending_job
)
{
h
.
job
=
h
.
pending_job
;
h
.
pending_job
=
nullptr
;
}
}
}
}
while
(
h
.
job
);
while
(
job
);
}
}
}
}
}
}
...
@@ -224,7 +215,7 @@ actor_ptr thread_pool_scheduler::spawn(scheduled_actor* what) {
...
@@ -224,7 +215,7 @@ actor_ptr thread_pool_scheduler::spawn(scheduled_actor* what) {
actor_ptr
thread_pool_scheduler
::
spawn
(
std
::
function
<
void
()
>
what
,
actor_ptr
thread_pool_scheduler
::
spawn
(
std
::
function
<
void
()
>
what
,
scheduling_hint
hint
)
{
scheduling_hint
hint
)
{
if
(
hint
==
scheduled
)
{
if
(
hint
==
scheduled
)
{
auto
new_actor
=
new
yield
ing_actor
(
std
::
move
(
what
));
auto
new_actor
=
new
context_switch
ing_actor
(
std
::
move
(
what
));
return
spawn_impl
(
new_actor
->
attach_to_scheduler
(
this
));
return
spawn_impl
(
new_actor
->
attach_to_scheduler
(
this
));
}
}
else
{
else
{
...
...
src/uniform_type_info.cpp
View file @
5b69972e
...
@@ -81,7 +81,7 @@ istream& operator>>(istream& i, cppa::util::void_type&) { return i; }
...
@@ -81,7 +81,7 @@ istream& operator>>(istream& i, cppa::util::void_type&) { return i; }
namespace
{
namespace
{
inline
cppa
::
detail
::
uniform_type_info_map
&
uti_map
()
{
inline
cppa
::
detail
::
uniform_type_info_map
&
uti_map
()
{
return
*
(
cppa
::
detail
::
singleton_manager
::
get_uniform_type_info_map
()
);
return
*
cppa
::
detail
::
singleton_manager
::
get_uniform_type_info_map
(
);
}
}
inline
const
char
*
raw_name
(
const
std
::
type_info
&
tinfo
)
{
inline
const
char
*
raw_name
(
const
std
::
type_info
&
tinfo
)
{
...
@@ -784,8 +784,7 @@ object uniform_type_info::create() const {
...
@@ -784,8 +784,7 @@ object uniform_type_info::create() const {
return
{
new_instance
(),
this
};
return
{
new_instance
(),
this
};
}
}
const
uniform_type_info
*
const
uniform_type_info
*
uniform_type_info
::
from
(
const
std
::
type_info
&
tinf
)
{
uniform_type_info
::
from
(
const
std
::
type_info
&
tinf
)
{
auto
result
=
uti_map
().
by_raw_name
(
raw_name
(
tinf
));
auto
result
=
uti_map
().
by_raw_name
(
raw_name
(
tinf
));
if
(
result
==
nullptr
)
{
if
(
result
==
nullptr
)
{
std
::
string
error
=
"uniform_type_info::by_type_info(): "
;
std
::
string
error
=
"uniform_type_info::by_type_info(): "
;
...
...
unit_testing/ping_pong.cpp
View file @
5b69972e
...
@@ -48,7 +48,7 @@ actor_ptr spawn_event_based_ping(size_t num_pings) {
...
@@ -48,7 +48,7 @@ actor_ptr spawn_event_based_ping(size_t num_pings) {
//cout << to_string(self->last_dequeued()) << endl;
//cout << to_string(self->last_dequeued()) << endl;
if
(
++
s_pongs
>=
num_pings
)
{
if
(
++
s_pongs
>=
num_pings
)
{
reply
(
atom
(
"EXIT"
),
exit_reason
::
user_defined
);
reply
(
atom
(
"EXIT"
),
exit_reason
::
user_defined
);
quit
_normal
();
quit
();
}
}
else
{
else
{
reply
(
atom
(
"ping"
),
value
);
reply
(
atom
(
"ping"
),
value
);
...
...
unit_testing/test__pattern.cpp
View file @
5b69972e
...
@@ -18,7 +18,6 @@
...
@@ -18,7 +18,6 @@
#include "cppa/util/is_primitive.hpp"
#include "cppa/util/is_primitive.hpp"
#include "cppa/util/is_mutable_ref.hpp"
#include "cppa/util/is_mutable_ref.hpp"
#include "cppa/detail/invokable.hpp"
#include "cppa/detail/types_array.hpp"
#include "cppa/detail/types_array.hpp"
#include "cppa/detail/decorated_tuple.hpp"
#include "cppa/detail/decorated_tuple.hpp"
...
...
unit_testing/test__primitive_variant.cpp
View file @
5b69972e
...
@@ -28,7 +28,6 @@ inline std::ostream& operator<<(std::ostream& o, const primitive_variant& pv) {
...
@@ -28,7 +28,6 @@ inline std::ostream& operator<<(std::ostream& o, const primitive_variant& pv) {
}
}
}
// namespace cppa
}
// namespace cppa
using
namespace
cppa
;
using
namespace
cppa
;
size_t
test__primitive_variant
()
{
size_t
test__primitive_variant
()
{
...
@@ -41,19 +40,19 @@ size_t test__primitive_variant() {
...
@@ -41,19 +40,19 @@ size_t test__primitive_variant() {
CPPA_CHECK_EQUAL
(
v1
.
ptype
(),
pt_uint32
);
CPPA_CHECK_EQUAL
(
v1
.
ptype
(),
pt_uint32
);
CPPA_CHECK_EQUAL
(
v2
.
ptype
(),
pt_uint32
);
CPPA_CHECK_EQUAL
(
v2
.
ptype
(),
pt_uint32
);
get_ref
<
std
::
uint32_t
&>
(
v2
)
=
forty_two
;
get_ref
<
std
::
uint32_t
&>
(
v2
)
=
forty_two
;
CPPA_CHECK
_EQUAL
(
v1
,
v2
);
CPPA_CHECK
(
equal
(
v1
,
v2
)
);
CPPA_CHECK
_EQUAL
(
v1
,
forty_two
);
CPPA_CHECK
(
equal
(
v1
,
forty_two
)
);
CPPA_CHECK
_EQUAL
(
forty_two
,
v2
);
CPPA_CHECK
(
equal
(
forty_two
,
v2
)
);
// type mismatch => unequal
// type mismatch => unequal
CPPA_CHECK
(
v2
!=
static_cast
<
std
::
int8_t
>
(
forty_two
));
CPPA_CHECK
(
!
equal
(
v2
,
static_cast
<
std
::
int8_t
>
(
forty_two
)
));
v1
=
"Hello world"
;
v1
=
"Hello world"
;
CPPA_CHECK_EQUAL
(
v1
.
ptype
(),
pt_u8string
);
CPPA_CHECK_EQUAL
(
v1
.
ptype
(),
pt_u8string
);
v2
=
"Hello"
;
v2
=
"Hello"
;
CPPA_CHECK_EQUAL
(
v2
.
ptype
(),
pt_u8string
);
CPPA_CHECK_EQUAL
(
v2
.
ptype
(),
pt_u8string
);
get_ref
<
std
::
string
>
(
v2
)
+=
" world"
;
get_ref
<
std
::
string
>
(
v2
)
+=
" world"
;
CPPA_CHECK
_EQUAL
(
v1
,
v2
);
CPPA_CHECK
(
equal
(
v1
,
v2
)
);
v2
=
u"Hello World"
;
v2
=
u"Hello World"
;
CPPA_CHECK
(
v1
!=
v2
);
CPPA_CHECK
(
!
equal
(
v1
,
v2
)
);
return
CPPA_TEST_RESULT
;
return
CPPA_TEST_RESULT
;
}
}
unit_testing/test__spawn.cpp
View file @
5b69972e
...
@@ -140,7 +140,7 @@ abstract_event_based_actor* event_testee2() {
...
@@ -140,7 +140,7 @@ abstract_event_based_actor* event_testee2() {
behavior
wait4timeout
(
int
remaining
)
{
behavior
wait4timeout
(
int
remaining
)
{
return
(
return
(
after
(
std
::
chrono
::
milliseconds
(
50
))
>>
[
=
]()
{
after
(
std
::
chrono
::
milliseconds
(
50
))
>>
[
=
]()
{
if
(
remaining
==
1
)
quit
_normal
();
if
(
remaining
==
1
)
quit
();
else
become
(
wait4timeout
(
remaining
-
1
));
else
become
(
wait4timeout
(
remaining
-
1
));
}
}
);
);
...
@@ -164,7 +164,7 @@ struct chopstick : public fsm_actor<chopstick> {
...
@@ -164,7 +164,7 @@ struct chopstick : public fsm_actor<chopstick> {
become
(
&
init_state
);
become
(
&
init_state
);
},
},
on
(
atom
(
"break"
))
>>
[
=
]()
{
on
(
atom
(
"break"
))
>>
[
=
]()
{
quit
_normal
();
quit
();
}
}
);
);
}
}
...
@@ -178,7 +178,7 @@ struct chopstick : public fsm_actor<chopstick> {
...
@@ -178,7 +178,7 @@ struct chopstick : public fsm_actor<chopstick> {
reply
(
atom
(
"taken"
));
reply
(
atom
(
"taken"
));
},
},
on
(
atom
(
"break"
))
>>
[
=
]()
{
on
(
atom
(
"break"
))
>>
[
=
]()
{
quit
_normal
();
quit
();
},
},
others
()
>>
[
=
]()
{
others
()
>>
[
=
]()
{
}
}
...
...
unit_testing/test__tuple.cpp
View file @
5b69972e
...
@@ -26,7 +26,6 @@
...
@@ -26,7 +26,6 @@
#include "cppa/util/deduce_ref_type.hpp"
#include "cppa/util/deduce_ref_type.hpp"
#include "cppa/detail/matches.hpp"
#include "cppa/detail/matches.hpp"
#include "cppa/detail/invokable.hpp"
#include "cppa/detail/projection.hpp"
#include "cppa/detail/projection.hpp"
#include "cppa/detail/types_array.hpp"
#include "cppa/detail/types_array.hpp"
#include "cppa/detail/value_guard.hpp"
#include "cppa/detail/value_guard.hpp"
...
...
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