Commit 71deb342 authored by Dominik Charousset's avatar Dominik Charousset

Cleanup comments

parent 6b66ed28
......@@ -64,34 +64,33 @@ chopstick::behavior_type taken_chopstick(chopstick::pointer self,
};
}
/* Based on: http://www.dalnefre.com/wp/2010/08/dining-philosophers-in-humus/
*
*
* +-------------+ {busy|taken}
* /-------->| thinking |<------------------\
* | +-------------+ |
* | | |
* | | {eat} |
* | | |
* | V |
* | +-------------+ {busy} +-------------+
* | | hungry |----------->| denied |
* | +-------------+ +-------------+
* | |
* | | {taken}
* | |
* | V
* | +-------------+
* | | granted |
* | +-------------+
* | | |
* | {busy} | | {taken}
* \-----------/ |
* | V
* | {think} +-------------+
* \---------| eating |
* +-------------+
*/
// Based on: http://www.dalnefre.com/wp/2010/08/dining-philosophers-in-humus/
//
//
// +-------------+ {busy|taken}
// /-------->| thinking |<------------------\
// | +-------------+ |
// | | |
// | | {eat} |
// | | |
// | V |
// | +-------------+ {busy} +-------------+
// | | hungry |----------->| denied |
// | +-------------+ +-------------+
// | |
// | | {taken}
// | |
// | V
// | +-------------+
// | | granted |
// | +-------------+
// | | |
// | {busy} | | {taken}
// \-----------/ |
// | V
// | {think} +-------------+
// \---------| eating |
// +-------------+
class philosopher : public event_based_actor {
public:
......
......@@ -48,31 +48,30 @@ behavior calculator_fun() {
};
}
/* State transition of the client for connecting to the server:
*
* +-------------+
* | init |
* +-------------+
* |
* V
* +-------------+
* | unconnected |<------------------\
* +-------------+ |
* | |
* | {connect Host Port} |
* | |
* V |
* +-------------+ {error} |
* /-------------->| connecting |------------------>|
* | +-------------+ ^
* | | |
* | | {ok, Calculator} |
* |{connect Host Port} | |
* | V |
* | +-------------+ {DOWN server} |
* \---------------| running |-------------------/
* +-------------+
*/
// State transition of the client for connecting to the server:
//
// +-------------+
// | init |
// +-------------+
// |
// V
// +-------------+
// | unconnected |<------------------\
// +-------------+ |
// | |
// | {connect Host Port} |
// | |
// V |
// +-------------+ {error} |
// /-------------->| connecting |------------------>|
// | +-------------+ ^
// | | |
// | | {ok, Calculator} |
// |{connect Host Port} | |
// | V |
// | +-------------+ {DOWN server} |
// \---------------| running |-------------------/
// +-------------+
namespace client {
......
......@@ -192,11 +192,6 @@ actor_factory_result dyn_spawn_class(actor_config& cfg, message& msg) {
template <class T, class... Ts>
actor_factory make_actor_factory() {
/*
static_assert(std::is_same<T*, decltype(new T(std::declval<actor_config&>(),
std::declval<Ts>()...))>::value,
"no constructor for T(Ts...) exists");
*/
static_assert(detail::conjunction<
std::is_lvalue_reference<Ts>::value...
>::value,
......
......@@ -29,30 +29,6 @@
namespace caf {
namespace detail {
/*
template <class Input, class X, class... Ts>
struct mpi_splice_one;
template <class Input, class X>
struct mpi_splice_one<Input, X> {
using type = X;
};
template <class Input, class X, class... Ts>
struct mpi_splice_one<Input, X, none_t, Ts...> {
using type = none_t;
};
template <class Input, class... Ys, class... Zs, class... Ts>
struct mpi_splice_one<Input,
typed_mpi<Input, type_list<Ys...>>,
typed_mpi<Input, type_list<Zs...>>,
Ts...>
: mpi_splice_one<typed_mpi<type_list<Xs...>, type_list<Ys..., Zs...>>, Ts...> {
// combine signatures with same input
};
*/
template <class T, class... Lists>
struct mpi_splice_by_input;
......
......@@ -113,9 +113,7 @@ private:
I last_;
};
/**
* @relates input_range
*/
/// @relates input_range
template <class I>
input_range_impl<I> make_input_range(I first, I last) {
return {first, last};
......
......@@ -43,25 +43,6 @@ struct output_tuple {};
template <class Input, class Output>
struct typed_mpi {};
/*
<detail::type_list<Is...>,
detail::type_list<Ls...>> {
static_assert(sizeof...(Is) > 0, "template parameter pack Is empty");
static_assert(sizeof...(Ls) > 0, "template parameter pack Ls empty");
using input = detail::type_list<Is...>;
using output = detail::type_list<Ls...>;
static_assert(!detail::tl_exists<
input_types,
is_illegal_message_element
>::value
&& !detail::tl_exists<
output_types,
is_illegal_message_element
>::value,
"interface definition contains an illegal message type");
};
*/
template <class... Is>
struct replies_to {
template <class... Os>
......
......@@ -402,13 +402,6 @@ void scheduled_actor::quit(error x) {
// -- stream management --------------------------------------------------------
/*
void scheduled_actor::trigger_downstreams() {
for (auto& s : streams_)
s.second->push();
}
*/
sec scheduled_actor::build_pipeline(stream_slot in, stream_slot out,
stream_manager_ptr mgr) {
CAF_LOG_TRACE(CAF_ARG(in) << CAF_ARG(out) << CAF_ARG(mgr));
......@@ -592,22 +585,8 @@ invoke_message_result scheduled_actor::consume(mailbox_element& x) {
auto ordinary_invoke = [](ptr_t, behavior& f, mailbox_element& in) -> bool {
return f(in.content()) != none;
};
/*
auto stream_invoke = [](ptr_t, behavior&, mailbox_element&) -> bool {
// The only legal stream message in a response is `stream_open`.
auto& var = in.content().get_as<stream_msg>(0).content;
if (holds_alternative<stream_msg::open>(var))
return p->handle_stream_msg(in, &f);
return false;
};
*/
auto select_invoke_fun = [&]() -> fun_t {
return ordinary_invoke;
/*
if (x.content().type_token() != make_type_token<stream_msg>())
return ordinary_invoke;
return stream_invoke;
*/
};
// Short-circuit awaited responses.
if (!awaited_responses_.empty()) {
......
......@@ -332,7 +332,9 @@ CAF_TEST(self_receive_with_zero_timeout) {
[&] {
CAF_ERROR("Unexpected message");
},
after(chrono::seconds(0)) >> [] { /* mailbox empty */ }
after(chrono::seconds(0)) >> [] {
// mailbox empty
}
);
}
......@@ -551,16 +553,6 @@ CAF_TEST(move_only_argument) {
};
auto f = make_function_view(system.spawn(impl, std::move(uptr)));
CAF_CHECK_EQUAL(to_string(f(1.f)), "(42)");
/*
auto testee = system.spawn(f, std::move(uptr));
scoped_actor self{system};
self->request(testee, infinite, 1.f).receive(
[](int i) {
CAF_CHECK_EQUAL(i, 42);
},
ERROR_HANDLER
);
*/
}
CAF_TEST_FIXTURE_SCOPE_END()
......@@ -114,27 +114,4 @@ CAF_TEST(untyped_splicing) {
);
}
/*
CAF_TEST(typed_splicing) {
using namespace std::placeholders;
auto stage0 = system.spawn(typed_first_stage);
auto stage2 = system.spawn(typed_second_stage);
auto stages = splice(stage0, stage2);
using expected_type = typed_actor<replies_to<double>
::with<double, double, double>>;
static_assert(std::is_same<decltype(stages), expected_type>::value,
"splice() did not compute the correct result");
self->request(stages, infinite, 42.0).receive(
[](double x, double y, double z) {
CAF_CHECK_EQUAL(x, (42.0 * 2.0));
CAF_CHECK_EQUAL(y, (42.0 * 4.0));
CAF_CHECK_EQUAL(z, (23.0 * 42.0));
},
ERROR_HANDLER
);
// stage0 and stage2 go out of scope, leaving only the references
// in stages, which will also go out of scope
}
*/
CAF_TEST_FIXTURE_SCOPE_END()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment