Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
folly
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
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
Libraries
folly
Commits
eb464ae8
Commit
eb464ae8
authored
Oct 16, 2018
by
Kirk Shoop
Committed by
Facebook Github Bot
Oct 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove stopping signal
fbshipit-source-id: b71f93b93d0915a5c913bddb8e4bdbbe7072bce7
parent
0d4b1a6c
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
123 additions
and
415 deletions
+123
-415
folly/experimental/pushmi/include/pushmi.h
folly/experimental/pushmi/include/pushmi.h
+50
-182
folly/experimental/pushmi/include/pushmi/boosters.h
folly/experimental/pushmi/include/pushmi/boosters.h
+0
-24
folly/experimental/pushmi/include/pushmi/concepts.h
folly/experimental/pushmi/include/pushmi/concepts.h
+0
-3
folly/experimental/pushmi/include/pushmi/extension_points.h
folly/experimental/pushmi/include/pushmi/extension_points.h
+0
-21
folly/experimental/pushmi/include/pushmi/flow_single.h
folly/experimental/pushmi/include/pushmi/flow_single.h
+50
-96
folly/experimental/pushmi/include/pushmi/o/extension_operators.h
...xperimental/pushmi/include/pushmi/o/extension_operators.h
+0
-11
folly/experimental/pushmi/include/pushmi/o/on.h
folly/experimental/pushmi/include/pushmi/o/on.h
+0
-9
folly/experimental/pushmi/include/pushmi/o/via.h
folly/experimental/pushmi/include/pushmi/o/via.h
+0
-18
folly/experimental/pushmi/test/CompileTest.cpp
folly/experimental/pushmi/test/CompileTest.cpp
+0
-12
folly/experimental/pushmi/test/FlowTest.cpp
folly/experimental/pushmi/test/FlowTest.cpp
+23
-39
No files found.
folly/experimental/pushmi/include/pushmi.h
View file @
eb464ae8
...
@@ -1534,11 +1534,6 @@ void set_value(S& s, V&& v) noexcept(noexcept(s.value((V&&) v))) {
...
@@ -1534,11 +1534,6 @@ void set_value(S& s, V&& v) noexcept(noexcept(s.value((V&&) v))) {
s
.
value
((
V
&&
)
v
);
s
.
value
((
V
&&
)
v
);
}
}
PUSHMI_TEMPLATE
(
class
S
)
(
requires
requires
(
std
::
declval
<
S
&>
().
stopping
()))
void
set_stopping
(
S
&
s
)
noexcept
(
noexcept
(
s
.
stopping
()))
{
s
.
stopping
();
}
PUSHMI_TEMPLATE
(
class
S
,
class
Up
)
PUSHMI_TEMPLATE
(
class
S
,
class
Up
)
(
requires
requires
(
std
::
declval
<
S
&>
().
starting
(
std
::
declval
<
Up
>
())))
(
requires
requires
(
std
::
declval
<
S
&>
().
starting
(
std
::
declval
<
Up
>
())))
void
set_starting
(
S
&
s
,
Up
up
)
noexcept
(
noexcept
(
s
.
starting
(
std
::
move
(
up
))))
{
void
set_starting
(
S
&
s
,
Up
up
)
noexcept
(
noexcept
(
s
.
starting
(
std
::
move
(
up
))))
{
...
@@ -1607,12 +1602,6 @@ void set_value(std::reference_wrapper<S> s, V&& v) noexcept(
...
@@ -1607,12 +1602,6 @@ void set_value(std::reference_wrapper<S> s, V&& v) noexcept(
noexcept
(
set_value
(
s
.
get
(),
(
V
&&
)
v
)))
{
noexcept
(
set_value
(
s
.
get
(),
(
V
&&
)
v
)))
{
set_value
(
s
.
get
(),
(
V
&&
)
v
);
set_value
(
s
.
get
(),
(
V
&&
)
v
);
}
}
PUSHMI_TEMPLATE
(
class
S
)
(
requires
requires
(
set_stopping
(
std
::
declval
<
S
&>
())
))
void
set_stopping
(
std
::
reference_wrapper
<
S
>
s
)
noexcept
(
noexcept
(
set_stopping
(
s
.
get
())))
{
set_stopping
(
s
.
get
());
}
PUSHMI_TEMPLATE
(
class
S
,
class
Up
)
PUSHMI_TEMPLATE
(
class
S
,
class
Up
)
(
requires
requires
(
set_starting
(
std
::
declval
<
S
&>
(),
std
::
declval
<
Up
>
())
))
(
requires
requires
(
set_starting
(
std
::
declval
<
S
&>
(),
std
::
declval
<
Up
>
())
))
void
set_starting
(
std
::
reference_wrapper
<
S
>
s
,
Up
up
)
noexcept
(
void
set_starting
(
std
::
reference_wrapper
<
S
>
s
,
Up
up
)
noexcept
(
...
@@ -1683,15 +1672,6 @@ struct set_value_fn {
...
@@ -1683,15 +1672,6 @@ struct set_value_fn {
}
}
};
};
struct
set_stopping_fn
{
PUSHMI_TEMPLATE
(
class
S
)
(
requires
requires
(
set_stopping
(
std
::
declval
<
S
&>
())
))
void
operator
()(
S
&&
s
)
const
noexcept
(
noexcept
(
set_stopping
(
s
)))
{
set_stopping
(
s
);
}
};
struct
set_starting_fn
{
struct
set_starting_fn
{
PUSHMI_TEMPLATE
(
class
S
,
class
Up
)
PUSHMI_TEMPLATE
(
class
S
,
class
Up
)
(
requires
requires
(
(
requires
requires
(
...
@@ -1746,7 +1726,6 @@ struct get_now_fn {
...
@@ -1746,7 +1726,6 @@ struct get_now_fn {
PUSHMI_INLINE_VAR
constexpr
__adl
::
set_done_fn
set_done
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
set_done_fn
set_done
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
set_error_fn
set_error
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
set_error_fn
set_error
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
set_value_fn
set_value
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
set_value_fn
set_value
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
set_stopping_fn
set_stopping
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
set_starting_fn
set_starting
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
set_starting_fn
set_starting
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
do_submit_fn
submit
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
do_submit_fn
submit
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
get_now_fn
now
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
get_now_fn
now
{};
...
@@ -2199,9 +2178,6 @@ PUSHMI_CONCEPT_DEF(
...
@@ -2199,9 +2178,6 @@ PUSHMI_CONCEPT_DEF(
PUSHMI_CONCEPT_DEF
(
PUSHMI_CONCEPT_DEF
(
template
(
class
S
,
class
...
PropertyN
)
template
(
class
S
,
class
...
PropertyN
)
(
concept
FlowReceiver
)(
S
,
PropertyN
...),
(
concept
FlowReceiver
)(
S
,
PropertyN
...),
requires
(
S
&
s
)
(
::
pushmi
::
set_stopping
(
s
)
)
&&
Receiver
<
S
>
&&
Receiver
<
S
>
&&
property_query_v
<
S
,
PropertyN
...
>
&&
property_query_v
<
S
,
PropertyN
...
>
&&
Flow
<
S
>
Flow
<
S
>
...
@@ -2392,10 +2368,6 @@ struct ignoreDF {
...
@@ -2392,10 +2368,6 @@ struct ignoreDF {
void
operator
()()
{}
void
operator
()()
{}
};
};
struct
ignoreStpF
{
void
operator
()()
{}
};
struct
ignoreStrtF
{
struct
ignoreStrtF
{
template
<
class
Up
>
template
<
class
Up
>
void
operator
()(
Up
&&
)
{}
void
operator
()(
Up
&&
)
{}
...
@@ -2439,14 +2411,6 @@ struct passDDF {
...
@@ -2439,14 +2411,6 @@ struct passDDF {
}
}
};
};
struct
passDStpF
{
PUSHMI_TEMPLATE
(
class
Data
)
(
requires
Receiver
<
Data
>
)
void
operator
()(
Data
&
out
)
const
{
::
pushmi
::
set_stopping
(
out
);
}
};
struct
passDStrtF
{
struct
passDStrtF
{
PUSHMI_TEMPLATE
(
class
Up
,
class
Data
)
PUSHMI_TEMPLATE
(
class
Up
,
class
Data
)
(
requires
requires
(
(
requires
requires
(
...
@@ -2579,18 +2543,6 @@ auto on_done(Fn fn) -> on_done_fn<Fn> {
...
@@ -2579,18 +2543,6 @@ auto on_done(Fn fn) -> on_done_fn<Fn> {
return
on_done_fn
<
Fn
>
{
std
::
move
(
fn
)};
return
on_done_fn
<
Fn
>
{
std
::
move
(
fn
)};
}
}
template
<
class
Fn
>
struct
on_stopping_fn
:
Fn
{
constexpr
on_stopping_fn
()
=
default
;
constexpr
explicit
on_stopping_fn
(
Fn
fn
)
:
Fn
(
std
::
move
(
fn
))
{}
using
Fn
::
operator
();
};
template
<
class
Fn
>
auto
on_stopping
(
Fn
fn
)
->
on_stopping_fn
<
Fn
>
{
return
on_stopping_fn
<
Fn
>
{
std
::
move
(
fn
)};
}
template
<
class
...
Fns
>
template
<
class
...
Fns
>
struct
on_starting_fn
:
overload_fn
<
Fns
...
>
{
struct
on_starting_fn
:
overload_fn
<
Fns
...
>
{
constexpr
on_starting_fn
()
=
default
;
constexpr
on_starting_fn
()
=
default
;
...
@@ -4254,13 +4206,11 @@ class flow_single<V, PE, E> {
...
@@ -4254,13 +4206,11 @@ class flow_single<V, PE, E> {
static
void
s_done
(
data
&
)
{}
static
void
s_done
(
data
&
)
{}
static
void
s_error
(
data
&
,
E
)
noexcept
{
std
::
terminate
();
}
static
void
s_error
(
data
&
,
E
)
noexcept
{
std
::
terminate
();
}
static
void
s_value
(
data
&
,
V
)
{}
static
void
s_value
(
data
&
,
V
)
{}
static
void
s_stopping
(
data
&
)
noexcept
{}
static
void
s_starting
(
data
&
,
any_none
<
PE
>
)
{}
static
void
s_starting
(
data
&
,
any_none
<
PE
>
)
{}
void
(
*
op_
)(
data
&
,
data
*
)
=
vtable
::
s_op
;
void
(
*
op_
)(
data
&
,
data
*
)
=
vtable
::
s_op
;
void
(
*
done_
)(
data
&
)
=
vtable
::
s_done
;
void
(
*
done_
)(
data
&
)
=
vtable
::
s_done
;
void
(
*
error_
)(
data
&
,
E
)
noexcept
=
vtable
::
s_error
;
void
(
*
error_
)(
data
&
,
E
)
noexcept
=
vtable
::
s_error
;
void
(
*
value_
)(
data
&
,
V
)
=
vtable
::
s_value
;
void
(
*
value_
)(
data
&
,
V
)
=
vtable
::
s_value
;
void
(
*
stopping_
)(
data
&
)
noexcept
=
vtable
::
s_stopping
;
void
(
*
starting_
)(
data
&
,
any_none
<
PE
>
)
=
vtable
::
s_starting
;
void
(
*
starting_
)(
data
&
,
any_none
<
PE
>
)
=
vtable
::
s_starting
;
};
};
static
constexpr
vtable
const
noop_
{};
static
constexpr
vtable
const
noop_
{};
...
@@ -4282,14 +4232,11 @@ class flow_single<V, PE, E> {
...
@@ -4282,14 +4232,11 @@ class flow_single<V, PE, E> {
static
void
value
(
data
&
src
,
V
v
)
{
static
void
value
(
data
&
src
,
V
v
)
{
::
pushmi
::
set_value
(
*
static_cast
<
Wrapped
*>
(
src
.
pobj_
),
std
::
move
(
v
));
::
pushmi
::
set_value
(
*
static_cast
<
Wrapped
*>
(
src
.
pobj_
),
std
::
move
(
v
));
}
}
static
void
stopping
(
data
&
src
)
noexcept
{
::
pushmi
::
set_stopping
(
*
static_cast
<
Wrapped
*>
(
src
.
pobj_
));
}
static
void
starting
(
data
&
src
,
any_none
<
PE
>
up
)
{
static
void
starting
(
data
&
src
,
any_none
<
PE
>
up
)
{
::
pushmi
::
set_starting
(
*
static_cast
<
Wrapped
*>
(
src
.
pobj_
),
std
::
move
(
up
));
::
pushmi
::
set_starting
(
*
static_cast
<
Wrapped
*>
(
src
.
pobj_
),
std
::
move
(
up
));
}
}
};
};
static
const
vtable
vtbl
{
s
::
op
,
s
::
done
,
s
::
error
,
s
::
value
,
s
::
st
opping
,
s
::
st
arting
};
static
const
vtable
vtbl
{
s
::
op
,
s
::
done
,
s
::
error
,
s
::
value
,
s
::
starting
};
data_
.
pobj_
=
new
Wrapped
(
std
::
move
(
obj
));
data_
.
pobj_
=
new
Wrapped
(
std
::
move
(
obj
));
vptr_
=
&
vtbl
;
vptr_
=
&
vtbl
;
}
}
...
@@ -4313,14 +4260,11 @@ class flow_single<V, PE, E> {
...
@@ -4313,14 +4260,11 @@ class flow_single<V, PE, E> {
::
pushmi
::
set_value
(
::
pushmi
::
set_value
(
*
static_cast
<
Wrapped
*>
((
void
*
)
src
.
buffer_
),
std
::
move
(
v
));
*
static_cast
<
Wrapped
*>
((
void
*
)
src
.
buffer_
),
std
::
move
(
v
));
}
}
static
void
stopping
(
data
&
src
)
noexcept
{
::
pushmi
::
set_stopping
(
*
static_cast
<
Wrapped
*>
((
void
*
)
src
.
buffer_
));
}
static
void
starting
(
data
&
src
,
any_none
<
PE
>
up
)
{
static
void
starting
(
data
&
src
,
any_none
<
PE
>
up
)
{
::
pushmi
::
set_starting
(
*
static_cast
<
Wrapped
*>
((
void
*
)
src
.
buffer_
),
std
::
move
(
up
));
::
pushmi
::
set_starting
(
*
static_cast
<
Wrapped
*>
((
void
*
)
src
.
buffer_
),
std
::
move
(
up
));
}
}
};
};
static
const
vtable
vtbl
{
s
::
op
,
s
::
done
,
s
::
error
,
s
::
value
,
s
::
st
opping
,
s
::
st
arting
};
static
const
vtable
vtbl
{
s
::
op
,
s
::
done
,
s
::
error
,
s
::
value
,
s
::
starting
};
new
(
data_
.
buffer_
)
Wrapped
(
std
::
move
(
obj
));
new
(
data_
.
buffer_
)
Wrapped
(
std
::
move
(
obj
));
vptr_
=
&
vtbl
;
vptr_
=
&
vtbl
;
}
}
...
@@ -4357,9 +4301,6 @@ public:
...
@@ -4357,9 +4301,6 @@ public:
vptr_
->
done_
(
data_
);
vptr_
->
done_
(
data_
);
}
}
void
stopping
()
noexcept
{
vptr_
->
stopping_
(
data_
);
}
void
starting
(
any_none
<
PE
>
up
)
{
void
starting
(
any_none
<
PE
>
up
)
{
vptr_
->
starting_
(
data_
,
std
::
move
(
up
));
vptr_
->
starting_
(
data_
,
std
::
move
(
up
));
}
}
...
@@ -4370,15 +4311,14 @@ template <class V, class PE, class E>
...
@@ -4370,15 +4311,14 @@ template <class V, class PE, class E>
constexpr
typename
flow_single
<
V
,
PE
,
E
>::
vtable
const
constexpr
typename
flow_single
<
V
,
PE
,
E
>::
vtable
const
flow_single
<
V
,
PE
,
E
>::
noop_
;
flow_single
<
V
,
PE
,
E
>::
noop_
;
template
<
class
VF
,
class
EF
,
class
DF
,
class
St
pF
,
class
St
rtF
>
template
<
class
VF
,
class
EF
,
class
DF
,
class
StrtF
>
#if __cpp_concepts
#if __cpp_concepts
requires
Invocable
<
DF
&>
requires
Invocable
<
DF
&>
#endif
#endif
class
flow_single
<
VF
,
EF
,
DF
,
St
pF
,
St
rtF
>
{
class
flow_single
<
VF
,
EF
,
DF
,
StrtF
>
{
VF
vf_
;
VF
vf_
;
EF
ef_
;
EF
ef_
;
DF
df_
;
DF
df_
;
StpF
stpf_
;
StrtF
strtf_
;
StrtF
strtf_
;
public:
public:
...
@@ -4404,12 +4344,10 @@ class flow_single<VF, EF, DF, StpF, StrtF> {
...
@@ -4404,12 +4344,10 @@ class flow_single<VF, EF, DF, StpF, StrtF> {
VF
vf
,
VF
vf
,
EF
ef
,
EF
ef
,
DF
df
=
DF
{},
DF
df
=
DF
{},
StpF
stpf
=
StpF
{},
StrtF
strtf
=
StrtF
{})
StrtF
strtf
=
StrtF
{})
:
vf_
(
std
::
move
(
vf
)),
:
vf_
(
std
::
move
(
vf
)),
ef_
(
std
::
move
(
ef
)),
ef_
(
std
::
move
(
ef
)),
df_
(
std
::
move
(
df
)),
df_
(
std
::
move
(
df
)),
stpf_
(
std
::
move
(
stpf
)),
strtf_
(
std
::
move
(
strtf
))
{}
strtf_
(
std
::
move
(
strtf
))
{}
PUSHMI_TEMPLATE
(
class
V
)
PUSHMI_TEMPLATE
(
class
V
)
(
requires
Invocable
<
VF
&
,
V
>
)
(
requires
Invocable
<
VF
&
,
V
>
)
...
@@ -4425,9 +4363,6 @@ class flow_single<VF, EF, DF, StpF, StrtF> {
...
@@ -4425,9 +4363,6 @@ class flow_single<VF, EF, DF, StpF, StrtF> {
void
done
()
{
void
done
()
{
df_
();
df_
();
}
}
void
stopping
()
noexcept
{
stpf_
();
}
PUSHMI_TEMPLATE
(
class
Up
)
PUSHMI_TEMPLATE
(
class
Up
)
(
requires
Receiver
<
Up
,
is_none
<>>
&&
Invocable
<
StrtF
&
,
Up
&&>
)
(
requires
Receiver
<
Up
,
is_none
<>>
&&
Invocable
<
StrtF
&
,
Up
&&>
)
void
starting
(
Up
&&
up
)
{
void
starting
(
Up
&&
up
)
{
...
@@ -4440,17 +4375,15 @@ template<
...
@@ -4440,17 +4375,15 @@ template<
class
DVF
,
class
DVF
,
class
DEF
,
class
DEF
,
class
DDF
,
class
DDF
,
class
DStpF
,
class
DStrtF
>
class
DStrtF
>
#if __cpp_concepts
#if __cpp_concepts
requires
Invocable
<
DDF
&
,
Data
&>
requires
Invocable
<
DDF
&
,
Data
&>
#endif
#endif
class
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
DSt
pF
,
DSt
rtF
>
{
class
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
DStrtF
>
{
Data
data_
;
Data
data_
;
DVF
vf_
;
DVF
vf_
;
DEF
ef_
;
DEF
ef_
;
DDF
df_
;
DDF
df_
;
DStpF
stpf_
;
DStrtF
strtf_
;
DStrtF
strtf_
;
public:
public:
...
@@ -4474,13 +4407,11 @@ class flow_single<Data, DVF, DEF, DDF, DStpF, DStrtF> {
...
@@ -4474,13 +4407,11 @@ class flow_single<Data, DVF, DEF, DDF, DStpF, DStrtF> {
DVF
vf
,
DVF
vf
,
DEF
ef
=
DEF
{},
DEF
ef
=
DEF
{},
DDF
df
=
DDF
{},
DDF
df
=
DDF
{},
DStpF
stpf
=
DStpF
{},
DStrtF
strtf
=
DStrtF
{})
DStrtF
strtf
=
DStrtF
{})
:
data_
(
std
::
move
(
d
)),
:
data_
(
std
::
move
(
d
)),
vf_
(
vf
),
vf_
(
vf
),
ef_
(
ef
),
ef_
(
ef
),
df_
(
df
),
df_
(
df
),
stpf_
(
std
::
move
(
stpf
)),
strtf_
(
std
::
move
(
strtf
))
{}
strtf_
(
std
::
move
(
strtf
))
{}
PUSHMI_TEMPLATE
(
class
V
)
PUSHMI_TEMPLATE
(
class
V
)
(
requires
Invocable
<
DVF
&
,
Data
&
,
V
>
)
(
requires
Invocable
<
DVF
&
,
Data
&
,
V
>
)
...
@@ -4497,9 +4428,6 @@ class flow_single<Data, DVF, DEF, DDF, DStpF, DStrtF> {
...
@@ -4497,9 +4428,6 @@ class flow_single<Data, DVF, DEF, DDF, DStpF, DStrtF> {
void
done
()
{
void
done
()
{
df_
(
data_
);
df_
(
data_
);
}
}
void
stopping
()
noexcept
{
stpf_
(
data_
);
}
PUSHMI_TEMPLATE
(
class
Up
)
PUSHMI_TEMPLATE
(
class
Up
)
(
requires
Invocable
<
DStrtF
&
,
Data
&
,
Up
&&>
)
(
requires
Invocable
<
DStrtF
&
,
Data
&
,
Up
&&>
)
void
starting
(
Up
&&
up
)
{
void
starting
(
Up
&&
up
)
{
...
@@ -4509,7 +4437,7 @@ class flow_single<Data, DVF, DEF, DDF, DStpF, DStrtF> {
...
@@ -4509,7 +4437,7 @@ class flow_single<Data, DVF, DEF, DDF, DStpF, DStrtF> {
template
<
>
template
<
>
class
flow_single
<>
class
flow_single
<>
:
public
flow_single
<
ignoreVF
,
abortEF
,
ignoreDF
,
ignoreSt
pF
,
ignoreSt
rtF
>
{
:
public
flow_single
<
ignoreVF
,
abortEF
,
ignoreDF
,
ignoreStrtF
>
{
};
};
// TODO winnow down the number of make_flow_single overloads and deduction
// TODO winnow down the number of make_flow_single overloads and deduction
...
@@ -4524,100 +4452,88 @@ PUSHMI_INLINE_VAR constexpr struct make_flow_single_fn {
...
@@ -4524,100 +4452,88 @@ PUSHMI_INLINE_VAR constexpr struct make_flow_single_fn {
PUSHMI_TEMPLATE
(
class
VF
)
PUSHMI_TEMPLATE
(
class
VF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
PUSHMI_AND
not
defer
::
Invocable
<
VF
&>
)))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
PUSHMI_AND
not
defer
::
Invocable
<
VF
&>
)))
auto
operator
()(
VF
vf
)
const
{
auto
operator
()(
VF
vf
)
const
{
return
flow_single
<
VF
,
abortEF
,
ignoreDF
,
ignoreSt
pF
,
ignoreSt
rtF
>
{
return
flow_single
<
VF
,
abortEF
,
ignoreDF
,
ignoreStrtF
>
{
std
::
move
(
vf
)};
std
::
move
(
vf
)};
}
}
template
<
class
...
EFN
>
template
<
class
...
EFN
>
auto
operator
()(
on_error_fn
<
EFN
...
>
ef
)
const
{
auto
operator
()(
on_error_fn
<
EFN
...
>
ef
)
const
{
return
flow_single
<
ignoreVF
,
on_error_fn
<
EFN
...
>
,
ignoreDF
,
ignoreSt
pF
,
ignoreSt
rtF
>
{
return
flow_single
<
ignoreVF
,
on_error_fn
<
EFN
...
>
,
ignoreDF
,
ignoreStrtF
>
{
std
::
move
(
ef
)};
std
::
move
(
ef
)};
}
}
PUSHMI_TEMPLATE
(
class
DF
)
PUSHMI_TEMPLATE
(
class
DF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
DF
>
)))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
DF
>
)))
auto
operator
()(
DF
df
)
const
{
auto
operator
()(
DF
df
)
const
{
return
flow_single
<
ignoreVF
,
abortEF
,
DF
,
ignoreSt
pF
,
ignoreSt
rtF
>
{
std
::
move
(
df
)};
return
flow_single
<
ignoreVF
,
abortEF
,
DF
,
ignoreStrtF
>
{
std
::
move
(
df
)};
}
}
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
)
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
PUSHMI_AND
not
defer
::
Invocable
<
EF
&>
)))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
PUSHMI_AND
not
defer
::
Invocable
<
EF
&>
)))
auto
operator
()(
VF
vf
,
EF
ef
)
const
{
auto
operator
()(
VF
vf
,
EF
ef
)
const
{
return
flow_single
<
VF
,
EF
,
ignoreDF
,
ignoreSt
pF
,
ignoreSt
rtF
>
{
std
::
move
(
vf
),
return
flow_single
<
VF
,
EF
,
ignoreDF
,
ignoreStrtF
>
{
std
::
move
(
vf
),
std
::
move
(
ef
)};
std
::
move
(
ef
)};
}
}
PUSHMI_TEMPLATE
(
class
EF
,
class
DF
)
PUSHMI_TEMPLATE
(
class
EF
,
class
DF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
EF
>
)))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
EF
>
)))
auto
operator
()(
EF
ef
,
DF
df
)
const
{
auto
operator
()(
EF
ef
,
DF
df
)
const
{
return
flow_single
<
ignoreVF
,
EF
,
DF
,
ignoreSt
pF
,
ignoreSt
rtF
>
{
std
::
move
(
ef
),
std
::
move
(
df
)};
return
flow_single
<
ignoreVF
,
EF
,
DF
,
ignoreStrtF
>
{
std
::
move
(
ef
),
std
::
move
(
df
)};
}
}
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
,
class
DF
)
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
,
class
DF
)
(
requires
PUSHMI_EXP
(
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
)))
(
requires
PUSHMI_EXP
(
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
)))
auto
operator
()(
VF
vf
,
EF
ef
,
DF
df
)
const
{
auto
operator
()(
VF
vf
,
EF
ef
,
DF
df
)
const
{
return
flow_single
<
VF
,
EF
,
DF
,
ignoreSt
pF
,
ignoreSt
rtF
>
{
std
::
move
(
vf
),
return
flow_single
<
VF
,
EF
,
DF
,
ignoreStrtF
>
{
std
::
move
(
vf
),
std
::
move
(
ef
),
std
::
move
(
df
)};
std
::
move
(
ef
),
std
::
move
(
df
)};
}
}
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
,
class
DF
,
class
StpF
)
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
,
class
DF
,
class
StrtF
)
(
requires
PUSHMI_EXP
(
defer
::
Invocable
<
DF
&>
PUSHMI_AND
defer
::
Invocable
<
StpF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
)))
(
requires
PUSHMI_EXP
(
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
)))
auto
operator
()(
VF
vf
,
EF
ef
,
DF
df
,
StpF
stpf
)
const
{
auto
operator
()(
VF
vf
,
EF
ef
,
DF
df
,
StrtF
strtf
)
const
{
return
flow_single
<
VF
,
EF
,
DF
,
StpF
,
ignoreStrtF
>
{
std
::
move
(
vf
),
return
flow_single
<
VF
,
EF
,
DF
,
StrtF
>
{
std
::
move
(
vf
),
std
::
move
(
ef
),
std
::
move
(
ef
),
std
::
move
(
df
),
std
::
move
(
stpf
)};
std
::
move
(
df
),
std
::
move
(
strtf
)};
}
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
,
class
DF
,
class
StpF
,
class
StrtF
)
(
requires
PUSHMI_EXP
(
defer
::
Invocable
<
DF
&>
PUSHMI_AND
defer
::
Invocable
<
StpF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
)))
auto
operator
()(
VF
vf
,
EF
ef
,
DF
df
,
StpF
stpf
,
StrtF
strtf
)
const
{
return
flow_single
<
VF
,
EF
,
DF
,
StpF
,
StrtF
>
{
std
::
move
(
vf
),
std
::
move
(
ef
),
std
::
move
(
df
),
std
::
move
(
stpf
),
std
::
move
(
strtf
)};
}
}
PUSHMI_TEMPLATE
(
class
Data
)
PUSHMI_TEMPLATE
(
class
Data
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
))
auto
operator
()(
Data
d
)
const
{
auto
operator
()(
Data
d
)
const
{
return
flow_single
<
Data
,
passDVF
,
passDEF
,
passDDF
,
passDSt
pF
,
passDSt
rtF
>
{
return
flow_single
<
Data
,
passDVF
,
passDEF
,
passDDF
,
passDStrtF
>
{
std
::
move
(
d
)};
std
::
move
(
d
)};
}
}
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Invocable
<
DVF
&
,
Data
&>
)))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Invocable
<
DVF
&
,
Data
&>
)))
auto
operator
()(
Data
d
,
DVF
vf
)
const
{
auto
operator
()(
Data
d
,
DVF
vf
)
const
{
return
flow_single
<
Data
,
DVF
,
passDEF
,
passDDF
,
passDSt
pF
,
passDSt
rtF
>
{
return
flow_single
<
Data
,
DVF
,
passDEF
,
passDDF
,
passDStrtF
>
{
std
::
move
(
d
),
std
::
move
(
vf
)};
std
::
move
(
d
),
std
::
move
(
vf
)};
}
}
PUSHMI_TEMPLATE
(
class
Data
,
class
...
DEFN
)
PUSHMI_TEMPLATE
(
class
Data
,
class
...
DEFN
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
))
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
))
auto
operator
()(
Data
d
,
on_error_fn
<
DEFN
...
>
ef
)
const
{
auto
operator
()(
Data
d
,
on_error_fn
<
DEFN
...
>
ef
)
const
{
return
flow_single
<
Data
,
passDVF
,
on_error_fn
<
DEFN
...
>
,
passDDF
,
passDSt
pF
,
passDSt
rtF
>
{
return
flow_single
<
Data
,
passDVF
,
on_error_fn
<
DEFN
...
>
,
passDDF
,
passDStrtF
>
{
std
::
move
(
d
),
std
::
move
(
ef
)};
std
::
move
(
d
),
std
::
move
(
ef
)};
}
}
PUSHMI_TEMPLATE
(
class
Data
,
class
DDF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DDF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
auto
operator
()(
Data
d
,
DDF
df
)
const
{
auto
operator
()(
Data
d
,
DDF
df
)
const
{
return
flow_single
<
Data
,
passDVF
,
passDEF
,
DDF
,
passDSt
pF
,
passDSt
rtF
>
{
return
flow_single
<
Data
,
passDVF
,
passDEF
,
DDF
,
passDStrtF
>
{
std
::
move
(
d
),
std
::
move
(
df
)};
std
::
move
(
d
),
std
::
move
(
df
)};
}
}
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Invocable
<
DEF
&
,
Data
&>
)))
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Invocable
<
DEF
&
,
Data
&>
)))
auto
operator
()(
Data
d
,
DVF
vf
,
DEF
ef
)
const
{
auto
operator
()(
Data
d
,
DVF
vf
,
DEF
ef
)
const
{
return
flow_single
<
Data
,
DVF
,
DEF
,
passDDF
,
passDSt
pF
,
passDSt
rtF
>
{
std
::
move
(
d
),
std
::
move
(
vf
),
std
::
move
(
ef
)};
return
flow_single
<
Data
,
DVF
,
DEF
,
passDDF
,
passDStrtF
>
{
std
::
move
(
d
),
std
::
move
(
vf
),
std
::
move
(
ef
)};
}
}
PUSHMI_TEMPLATE
(
class
Data
,
class
DEF
,
class
DDF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DEF
,
class
DDF
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
auto
operator
()(
Data
d
,
DEF
ef
,
DDF
df
)
const
{
auto
operator
()(
Data
d
,
DEF
ef
,
DDF
df
)
const
{
return
flow_single
<
Data
,
passDVF
,
DEF
,
DDF
,
passDSt
pF
,
passDSt
rtF
>
{
return
flow_single
<
Data
,
passDVF
,
DEF
,
DDF
,
passDStrtF
>
{
std
::
move
(
d
),
std
::
move
(
ef
),
std
::
move
(
df
)};
std
::
move
(
d
),
std
::
move
(
ef
),
std
::
move
(
df
)};
}
}
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
,
class
DDF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
,
class
DDF
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
auto
operator
()(
Data
d
,
DVF
vf
,
DEF
ef
,
DDF
df
)
const
{
auto
operator
()(
Data
d
,
DVF
vf
,
DEF
ef
,
DDF
df
)
const
{
return
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
passDSt
pF
,
passDSt
rtF
>
{
std
::
move
(
d
),
return
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
passDStrtF
>
{
std
::
move
(
d
),
std
::
move
(
vf
),
std
::
move
(
ef
),
std
::
move
(
df
)};
std
::
move
(
vf
),
std
::
move
(
ef
),
std
::
move
(
df
)};
}
}
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
,
class
DDF
,
class
DStpF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
,
class
DDF
,
class
DStrtF
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
PUSHMI_AND
defer
::
Invocable
<
DStpF
&
,
Data
&>
))
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
auto
operator
()(
Data
d
,
DVF
vf
,
DEF
ef
,
DDF
df
,
DStpF
stpf
)
const
{
auto
operator
()(
Data
d
,
DVF
vf
,
DEF
ef
,
DDF
df
,
DStrtF
strtf
)
const
{
return
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
DStpF
,
passDStrtF
>
{
std
::
move
(
d
),
return
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
DStrtF
>
{
std
::
move
(
d
),
std
::
move
(
vf
),
std
::
move
(
ef
),
std
::
move
(
df
),
std
::
move
(
stpf
)};
std
::
move
(
vf
),
std
::
move
(
ef
),
std
::
move
(
df
),
std
::
move
(
strtf
)};
}
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
,
class
DDF
,
class
DStpF
,
class
DStrtF
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
PUSHMI_AND
defer
::
Invocable
<
DStpF
&
,
Data
&>
))
auto
operator
()(
Data
d
,
DVF
vf
,
DEF
ef
,
DDF
df
,
DStpF
stpf
,
DStrtF
strtf
)
const
{
return
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
DStpF
,
DStrtF
>
{
std
::
move
(
d
),
std
::
move
(
vf
),
std
::
move
(
ef
),
std
::
move
(
df
),
std
::
move
(
stpf
),
std
::
move
(
strtf
)};
}
}
}
const
make_flow_single
{};
}
const
make_flow_single
{};
...
@@ -4629,86 +4545,76 @@ flow_single() -> flow_single<>;
...
@@ -4629,86 +4545,76 @@ flow_single() -> flow_single<>;
PUSHMI_TEMPLATE
(
class
VF
)
PUSHMI_TEMPLATE
(
class
VF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
PUSHMI_AND
not
defer
::
Invocable
<
VF
&>
)))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
PUSHMI_AND
not
defer
::
Invocable
<
VF
&>
)))
flow_single
(
VF
)
->
flow_single
(
VF
)
->
flow_single
<
VF
,
abortEF
,
ignoreDF
,
ignoreSt
pF
,
ignoreSt
rtF
>
;
flow_single
<
VF
,
abortEF
,
ignoreDF
,
ignoreStrtF
>
;
template
<
class
...
EFN
>
template
<
class
...
EFN
>
flow_single
(
on_error_fn
<
EFN
...
>
)
->
flow_single
(
on_error_fn
<
EFN
...
>
)
->
flow_single
<
ignoreVF
,
on_error_fn
<
EFN
...
>
,
ignoreDF
,
ignoreSt
pF
,
ignoreSt
rtF
>
;
flow_single
<
ignoreVF
,
on_error_fn
<
EFN
...
>
,
ignoreDF
,
ignoreStrtF
>
;
PUSHMI_TEMPLATE
(
class
DF
)
PUSHMI_TEMPLATE
(
class
DF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
DF
>
)))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
DF
>
)))
flow_single
(
DF
)
->
flow_single
(
DF
)
->
flow_single
<
ignoreVF
,
abortEF
,
DF
,
ignoreSt
pF
,
ignoreSt
rtF
>
;
flow_single
<
ignoreVF
,
abortEF
,
DF
,
ignoreStrtF
>
;
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
)
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
PUSHMI_AND
not
defer
::
Invocable
<
EF
&>
)))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
PUSHMI_AND
not
defer
::
Invocable
<
EF
&>
)))
flow_single
(
VF
,
EF
)
->
flow_single
(
VF
,
EF
)
->
flow_single
<
VF
,
EF
,
ignoreDF
,
ignoreSt
pF
,
ignoreSt
rtF
>
;
flow_single
<
VF
,
EF
,
ignoreDF
,
ignoreStrtF
>
;
PUSHMI_TEMPLATE
(
class
EF
,
class
DF
)
PUSHMI_TEMPLATE
(
class
EF
,
class
DF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
EF
>
)))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
EF
>
)))
flow_single
(
EF
,
DF
)
->
flow_single
(
EF
,
DF
)
->
flow_single
<
ignoreVF
,
EF
,
DF
,
ignoreSt
pF
,
ignoreSt
rtF
>
;
flow_single
<
ignoreVF
,
EF
,
DF
,
ignoreStrtF
>
;
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
,
class
DF
)
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
,
class
DF
)
(
requires
PUSHMI_EXP
(
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
)))
(
requires
PUSHMI_EXP
(
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
)))
flow_single
(
VF
,
EF
,
DF
)
->
flow_single
(
VF
,
EF
,
DF
)
->
flow_single
<
VF
,
EF
,
DF
,
ignoreStpF
,
ignoreStrtF
>
;
flow_single
<
VF
,
EF
,
DF
,
ignoreStrtF
>
;
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
,
class
DF
,
class
StpF
)
(
requires
PUSHMI_EXP
(
defer
::
Invocable
<
DF
&>
PUSHMI_AND
defer
::
Invocable
<
StpF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
)))
flow_single
(
VF
,
EF
,
DF
,
StpF
)
->
flow_single
<
VF
,
EF
,
DF
,
StpF
,
ignoreStrtF
>
;
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
,
class
DF
,
class
St
pF
,
class
St
rtF
)
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
,
class
DF
,
class
StrtF
)
(
requires
PUSHMI_EXP
(
defer
::
Invocable
<
DF
&>
PUSHMI_
AND
defer
::
Invocable
<
StpF
&>
PUSHMI_
BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
)))
(
requires
PUSHMI_EXP
(
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
)))
flow_single
(
VF
,
EF
,
DF
,
St
pF
,
St
rtF
)
->
flow_single
(
VF
,
EF
,
DF
,
StrtF
)
->
flow_single
<
VF
,
EF
,
DF
,
St
pF
,
St
rtF
>
;
flow_single
<
VF
,
EF
,
DF
,
StrtF
>
;
PUSHMI_TEMPLATE
(
class
Data
)
PUSHMI_TEMPLATE
(
class
Data
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
))
flow_single
(
Data
d
)
->
flow_single
(
Data
d
)
->
flow_single
<
Data
,
passDVF
,
passDEF
,
passDDF
,
passDSt
pF
,
passDSt
rtF
>
;
flow_single
<
Data
,
passDVF
,
passDEF
,
passDDF
,
passDStrtF
>
;
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Invocable
<
DVF
&
,
Data
&>
)))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Invocable
<
DVF
&
,
Data
&>
)))
flow_single
(
Data
d
,
DVF
vf
)
->
flow_single
(
Data
d
,
DVF
vf
)
->
flow_single
<
Data
,
DVF
,
passDEF
,
passDDF
,
passDSt
pF
,
passDSt
rtF
>
;
flow_single
<
Data
,
DVF
,
passDEF
,
passDDF
,
passDStrtF
>
;
PUSHMI_TEMPLATE
(
class
Data
,
class
...
DEFN
)
PUSHMI_TEMPLATE
(
class
Data
,
class
...
DEFN
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
))
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
))
flow_single
(
Data
d
,
on_error_fn
<
DEFN
...
>
)
->
flow_single
(
Data
d
,
on_error_fn
<
DEFN
...
>
)
->
flow_single
<
Data
,
passDVF
,
on_error_fn
<
DEFN
...
>
,
passDDF
,
passDSt
pF
,
passDSt
rtF
>
;
flow_single
<
Data
,
passDVF
,
on_error_fn
<
DEFN
...
>
,
passDDF
,
passDStrtF
>
;
PUSHMI_TEMPLATE
(
class
Data
,
class
DDF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DDF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
flow_single
(
Data
d
,
DDF
)
->
flow_single
(
Data
d
,
DDF
)
->
flow_single
<
Data
,
passDVF
,
passDEF
,
DDF
,
passDSt
pF
,
passDSt
rtF
>
;
flow_single
<
Data
,
passDVF
,
passDEF
,
DDF
,
passDStrtF
>
;
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Invocable
<
DEF
&
,
Data
&>
)))
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Invocable
<
DEF
&
,
Data
&>
)))
flow_single
(
Data
d
,
DVF
vf
,
DEF
ef
)
->
flow_single
(
Data
d
,
DVF
vf
,
DEF
ef
)
->
flow_single
<
Data
,
DVF
,
DEF
,
passDDF
,
passDSt
pF
,
passDSt
rtF
>
;
flow_single
<
Data
,
DVF
,
DEF
,
passDDF
,
passDStrtF
>
;
PUSHMI_TEMPLATE
(
class
Data
,
class
DEF
,
class
DDF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DEF
,
class
DDF
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
flow_single
(
Data
d
,
DEF
,
DDF
)
->
flow_single
(
Data
d
,
DEF
,
DDF
)
->
flow_single
<
Data
,
passDVF
,
DEF
,
DDF
,
passDSt
pF
,
passDSt
rtF
>
;
flow_single
<
Data
,
passDVF
,
DEF
,
DDF
,
passDStrtF
>
;
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
,
class
DDF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
,
class
DDF
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
flow_single
(
Data
d
,
DVF
vf
,
DEF
ef
,
DDF
df
)
->
flow_single
(
Data
d
,
DVF
vf
,
DEF
ef
,
DDF
df
)
->
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
passDStpF
,
passDStrtF
>
;
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
passDStrtF
>
;
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
,
class
DDF
,
class
DStpF
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
PUSHMI_AND
defer
::
Invocable
<
DStpF
&
,
Data
&>
))
flow_single
(
Data
d
,
DVF
vf
,
DEF
ef
,
DDF
df
,
DStpF
stpf
)
->
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
DStpF
,
passDStrtF
>
;
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
,
class
DDF
,
class
DSt
pF
,
class
DSt
rtF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
,
class
DDF
,
class
DStrtF
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
PUSHMI_AND
defer
::
Invocable
<
DStpF
&
,
Data
&>
))
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
flow_single
(
Data
d
,
DVF
vf
,
DEF
ef
,
DDF
df
,
DSt
pF
stpf
,
DSt
rtF
strtf
)
->
flow_single
(
Data
d
,
DVF
vf
,
DEF
ef
,
DDF
df
,
DStrtF
strtf
)
->
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
DSt
pF
,
DSt
rtF
>
;
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
DStrtF
>
;
#endif
#endif
template
<
class
V
,
class
PE
=
std
::
exception_ptr
,
class
E
=
PE
>
template
<
class
V
,
class
PE
=
std
::
exception_ptr
,
class
E
=
PE
>
...
@@ -5445,16 +5351,6 @@ struct set_done_fn {
...
@@ -5445,16 +5351,6 @@ struct set_done_fn {
}
}
};
};
struct
set_stopping_fn
{
auto
operator
()()
const
{
return
constrain
(
lazy
::
Receiver
<
_1
>
,
[](
auto
out
)
{
::
pushmi
::
set_stopping
(
out
);
}
);
}
};
struct
set_starting_fn
{
struct
set_starting_fn
{
PUSHMI_TEMPLATE
(
class
Up
)
PUSHMI_TEMPLATE
(
class
Up
)
(
requires
Receiver
<
Up
>
)
(
requires
Receiver
<
Up
>
)
...
@@ -5505,7 +5401,6 @@ namespace extension_operators {
...
@@ -5505,7 +5401,6 @@ namespace extension_operators {
PUSHMI_INLINE_VAR
constexpr
detail
::
set_done_fn
set_done
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
set_done_fn
set_done
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
set_error_fn
set_error
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
set_error_fn
set_error
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
set_value_fn
set_value
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
set_value_fn
set_value
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
set_stopping_fn
set_stopping
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
set_starting_fn
set_starting
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
set_starting_fn
set_starting
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
do_submit_fn
submit
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
do_submit_fn
submit
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
now_fn
now
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
now_fn
now
{};
...
@@ -6148,15 +6043,6 @@ class fsdon {
...
@@ -6148,15 +6043,6 @@ class fsdon {
out_.error(std::move(e));
out_.error(std::move(e));
}
}
void stopping() {
if (done_) {
return;
}
done_ = true;
*stopped_ = true;
out_.stopping();
}
template <class Producer>
template <class Producer>
void starting(RefWrapper<Producer> up) {
void starting(RefWrapper<Producer> up) {
upProxy_ =
upProxy_ =
...
@@ -6694,24 +6580,6 @@ class fsdvia {
...
@@ -6694,24 +6580,6 @@ class fsdvia {
});
});
}
}
void stopping() {
if (done_) {
return;
}
if (!upProxy_) {
std::abort();
}
done_ = true;
if (!shared_->stopped_.exchange(true)) {
exec_ |
// must keep out and upProxy alive until out is notified that it
// is unsafe
execute([shared = shared_](auto) mutable {
shared->out_.stopping();
});
}
}
template <class Producer>
template <class Producer>
void starting(RefWrapper<Producer> up) {
void starting(RefWrapper<Producer> up) {
if (!!upProxy_) {
if (!!upProxy_) {
...
...
folly/experimental/pushmi/include/pushmi/boosters.h
View file @
eb464ae8
...
@@ -56,10 +56,6 @@ struct ignoreDF {
...
@@ -56,10 +56,6 @@ struct ignoreDF {
void
operator
()()
{}
void
operator
()()
{}
};
};
struct
ignoreStpF
{
void
operator
()()
{}
};
struct
ignoreStrtF
{
struct
ignoreStrtF
{
template
<
class
Up
>
template
<
class
Up
>
void
operator
()(
Up
&&
)
{}
void
operator
()(
Up
&&
)
{}
...
@@ -103,14 +99,6 @@ struct passDDF {
...
@@ -103,14 +99,6 @@ struct passDDF {
}
}
};
};
struct
passDStpF
{
PUSHMI_TEMPLATE
(
class
Data
)
(
requires
Receiver
<
Data
>
)
void
operator
()(
Data
&
out
)
const
{
::
pushmi
::
set_stopping
(
out
);
}
};
struct
passDStrtF
{
struct
passDStrtF
{
PUSHMI_TEMPLATE
(
class
Up
,
class
Data
)
PUSHMI_TEMPLATE
(
class
Up
,
class
Data
)
(
requires
requires
(
(
requires
requires
(
...
@@ -243,18 +231,6 @@ auto on_done(Fn fn) -> on_done_fn<Fn> {
...
@@ -243,18 +231,6 @@ auto on_done(Fn fn) -> on_done_fn<Fn> {
return
on_done_fn
<
Fn
>
{
std
::
move
(
fn
)};
return
on_done_fn
<
Fn
>
{
std
::
move
(
fn
)};
}
}
template
<
class
Fn
>
struct
on_stopping_fn
:
Fn
{
constexpr
on_stopping_fn
()
=
default
;
constexpr
explicit
on_stopping_fn
(
Fn
fn
)
:
Fn
(
std
::
move
(
fn
))
{}
using
Fn
::
operator
();
};
template
<
class
Fn
>
auto
on_stopping
(
Fn
fn
)
->
on_stopping_fn
<
Fn
>
{
return
on_stopping_fn
<
Fn
>
{
std
::
move
(
fn
)};
}
template
<
class
...
Fns
>
template
<
class
...
Fns
>
struct
on_starting_fn
:
overload_fn
<
Fns
...
>
{
struct
on_starting_fn
:
overload_fn
<
Fns
...
>
{
constexpr
on_starting_fn
()
=
default
;
constexpr
on_starting_fn
()
=
default
;
...
...
folly/experimental/pushmi/include/pushmi/concepts.h
View file @
eb464ae8
...
@@ -256,9 +256,6 @@ PUSHMI_CONCEPT_DEF(
...
@@ -256,9 +256,6 @@ PUSHMI_CONCEPT_DEF(
PUSHMI_CONCEPT_DEF
(
PUSHMI_CONCEPT_DEF
(
template
(
class
S
,
class
...
PropertyN
)
template
(
class
S
,
class
...
PropertyN
)
(
concept
FlowReceiver
)(
S
,
PropertyN
...),
(
concept
FlowReceiver
)(
S
,
PropertyN
...),
requires
(
S
&
s
)
(
::
pushmi
::
set_stopping
(
s
)
)
&&
Receiver
<
S
>
&&
Receiver
<
S
>
&&
property_query_v
<
S
,
PropertyN
...
>
&&
property_query_v
<
S
,
PropertyN
...
>
&&
Flow
<
S
>
Flow
<
S
>
...
...
folly/experimental/pushmi/include/pushmi/extension_points.h
View file @
eb464ae8
...
@@ -27,11 +27,6 @@ void set_value(S& s, V&& v) noexcept(noexcept(s.value((V&&) v))) {
...
@@ -27,11 +27,6 @@ void set_value(S& s, V&& v) noexcept(noexcept(s.value((V&&) v))) {
s
.
value
((
V
&&
)
v
);
s
.
value
((
V
&&
)
v
);
}
}
PUSHMI_TEMPLATE
(
class
S
)
(
requires
requires
(
std
::
declval
<
S
&>
().
stopping
()))
void
set_stopping
(
S
&
s
)
noexcept
(
noexcept
(
s
.
stopping
()))
{
s
.
stopping
();
}
PUSHMI_TEMPLATE
(
class
S
,
class
Up
)
PUSHMI_TEMPLATE
(
class
S
,
class
Up
)
(
requires
requires
(
std
::
declval
<
S
&>
().
starting
(
std
::
declval
<
Up
>
())))
(
requires
requires
(
std
::
declval
<
S
&>
().
starting
(
std
::
declval
<
Up
>
())))
void
set_starting
(
S
&
s
,
Up
up
)
noexcept
(
noexcept
(
s
.
starting
(
std
::
move
(
up
))))
{
void
set_starting
(
S
&
s
,
Up
up
)
noexcept
(
noexcept
(
s
.
starting
(
std
::
move
(
up
))))
{
...
@@ -100,12 +95,6 @@ void set_value(std::reference_wrapper<S> s, V&& v) noexcept(
...
@@ -100,12 +95,6 @@ void set_value(std::reference_wrapper<S> s, V&& v) noexcept(
noexcept
(
set_value
(
s
.
get
(),
(
V
&&
)
v
)))
{
noexcept
(
set_value
(
s
.
get
(),
(
V
&&
)
v
)))
{
set_value
(
s
.
get
(),
(
V
&&
)
v
);
set_value
(
s
.
get
(),
(
V
&&
)
v
);
}
}
PUSHMI_TEMPLATE
(
class
S
)
(
requires
requires
(
set_stopping
(
std
::
declval
<
S
&>
())
))
void
set_stopping
(
std
::
reference_wrapper
<
S
>
s
)
noexcept
(
noexcept
(
set_stopping
(
s
.
get
())))
{
set_stopping
(
s
.
get
());
}
PUSHMI_TEMPLATE
(
class
S
,
class
Up
)
PUSHMI_TEMPLATE
(
class
S
,
class
Up
)
(
requires
requires
(
set_starting
(
std
::
declval
<
S
&>
(),
std
::
declval
<
Up
>
())
))
(
requires
requires
(
set_starting
(
std
::
declval
<
S
&>
(),
std
::
declval
<
Up
>
())
))
void
set_starting
(
std
::
reference_wrapper
<
S
>
s
,
Up
up
)
noexcept
(
void
set_starting
(
std
::
reference_wrapper
<
S
>
s
,
Up
up
)
noexcept
(
...
@@ -176,15 +165,6 @@ struct set_value_fn {
...
@@ -176,15 +165,6 @@ struct set_value_fn {
}
}
};
};
struct
set_stopping_fn
{
PUSHMI_TEMPLATE
(
class
S
)
(
requires
requires
(
set_stopping
(
std
::
declval
<
S
&>
())
))
void
operator
()(
S
&&
s
)
const
noexcept
(
noexcept
(
set_stopping
(
s
)))
{
set_stopping
(
s
);
}
};
struct
set_starting_fn
{
struct
set_starting_fn
{
PUSHMI_TEMPLATE
(
class
S
,
class
Up
)
PUSHMI_TEMPLATE
(
class
S
,
class
Up
)
(
requires
requires
(
(
requires
requires
(
...
@@ -239,7 +219,6 @@ struct get_now_fn {
...
@@ -239,7 +219,6 @@ struct get_now_fn {
PUSHMI_INLINE_VAR
constexpr
__adl
::
set_done_fn
set_done
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
set_done_fn
set_done
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
set_error_fn
set_error
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
set_error_fn
set_error
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
set_value_fn
set_value
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
set_value_fn
set_value
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
set_stopping_fn
set_stopping
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
set_starting_fn
set_starting
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
set_starting_fn
set_starting
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
do_submit_fn
submit
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
do_submit_fn
submit
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
get_now_fn
now
{};
PUSHMI_INLINE_VAR
constexpr
__adl
::
get_now_fn
now
{};
...
...
folly/experimental/pushmi/include/pushmi/flow_single.h
View file @
eb464ae8
...
@@ -24,13 +24,11 @@ class flow_single<V, PE, E> {
...
@@ -24,13 +24,11 @@ class flow_single<V, PE, E> {
static
void
s_done
(
data
&
)
{}
static
void
s_done
(
data
&
)
{}
static
void
s_error
(
data
&
,
E
)
noexcept
{
std
::
terminate
();
}
static
void
s_error
(
data
&
,
E
)
noexcept
{
std
::
terminate
();
}
static
void
s_value
(
data
&
,
V
)
{}
static
void
s_value
(
data
&
,
V
)
{}
static
void
s_stopping
(
data
&
)
noexcept
{}
static
void
s_starting
(
data
&
,
any_none
<
PE
>
)
{}
static
void
s_starting
(
data
&
,
any_none
<
PE
>
)
{}
void
(
*
op_
)(
data
&
,
data
*
)
=
vtable
::
s_op
;
void
(
*
op_
)(
data
&
,
data
*
)
=
vtable
::
s_op
;
void
(
*
done_
)(
data
&
)
=
vtable
::
s_done
;
void
(
*
done_
)(
data
&
)
=
vtable
::
s_done
;
void
(
*
error_
)(
data
&
,
E
)
noexcept
=
vtable
::
s_error
;
void
(
*
error_
)(
data
&
,
E
)
noexcept
=
vtable
::
s_error
;
void
(
*
value_
)(
data
&
,
V
)
=
vtable
::
s_value
;
void
(
*
value_
)(
data
&
,
V
)
=
vtable
::
s_value
;
void
(
*
stopping_
)(
data
&
)
noexcept
=
vtable
::
s_stopping
;
void
(
*
starting_
)(
data
&
,
any_none
<
PE
>
)
=
vtable
::
s_starting
;
void
(
*
starting_
)(
data
&
,
any_none
<
PE
>
)
=
vtable
::
s_starting
;
};
};
static
constexpr
vtable
const
noop_
{};
static
constexpr
vtable
const
noop_
{};
...
@@ -52,14 +50,11 @@ class flow_single<V, PE, E> {
...
@@ -52,14 +50,11 @@ class flow_single<V, PE, E> {
static
void
value
(
data
&
src
,
V
v
)
{
static
void
value
(
data
&
src
,
V
v
)
{
::
pushmi
::
set_value
(
*
static_cast
<
Wrapped
*>
(
src
.
pobj_
),
std
::
move
(
v
));
::
pushmi
::
set_value
(
*
static_cast
<
Wrapped
*>
(
src
.
pobj_
),
std
::
move
(
v
));
}
}
static
void
stopping
(
data
&
src
)
noexcept
{
::
pushmi
::
set_stopping
(
*
static_cast
<
Wrapped
*>
(
src
.
pobj_
));
}
static
void
starting
(
data
&
src
,
any_none
<
PE
>
up
)
{
static
void
starting
(
data
&
src
,
any_none
<
PE
>
up
)
{
::
pushmi
::
set_starting
(
*
static_cast
<
Wrapped
*>
(
src
.
pobj_
),
std
::
move
(
up
));
::
pushmi
::
set_starting
(
*
static_cast
<
Wrapped
*>
(
src
.
pobj_
),
std
::
move
(
up
));
}
}
};
};
static
const
vtable
vtbl
{
s
::
op
,
s
::
done
,
s
::
error
,
s
::
value
,
s
::
st
opping
,
s
::
st
arting
};
static
const
vtable
vtbl
{
s
::
op
,
s
::
done
,
s
::
error
,
s
::
value
,
s
::
starting
};
data_
.
pobj_
=
new
Wrapped
(
std
::
move
(
obj
));
data_
.
pobj_
=
new
Wrapped
(
std
::
move
(
obj
));
vptr_
=
&
vtbl
;
vptr_
=
&
vtbl
;
}
}
...
@@ -83,14 +78,11 @@ class flow_single<V, PE, E> {
...
@@ -83,14 +78,11 @@ class flow_single<V, PE, E> {
::
pushmi
::
set_value
(
::
pushmi
::
set_value
(
*
static_cast
<
Wrapped
*>
((
void
*
)
src
.
buffer_
),
std
::
move
(
v
));
*
static_cast
<
Wrapped
*>
((
void
*
)
src
.
buffer_
),
std
::
move
(
v
));
}
}
static
void
stopping
(
data
&
src
)
noexcept
{
::
pushmi
::
set_stopping
(
*
static_cast
<
Wrapped
*>
((
void
*
)
src
.
buffer_
));
}
static
void
starting
(
data
&
src
,
any_none
<
PE
>
up
)
{
static
void
starting
(
data
&
src
,
any_none
<
PE
>
up
)
{
::
pushmi
::
set_starting
(
*
static_cast
<
Wrapped
*>
((
void
*
)
src
.
buffer_
),
std
::
move
(
up
));
::
pushmi
::
set_starting
(
*
static_cast
<
Wrapped
*>
((
void
*
)
src
.
buffer_
),
std
::
move
(
up
));
}
}
};
};
static
const
vtable
vtbl
{
s
::
op
,
s
::
done
,
s
::
error
,
s
::
value
,
s
::
st
opping
,
s
::
st
arting
};
static
const
vtable
vtbl
{
s
::
op
,
s
::
done
,
s
::
error
,
s
::
value
,
s
::
starting
};
new
(
data_
.
buffer_
)
Wrapped
(
std
::
move
(
obj
));
new
(
data_
.
buffer_
)
Wrapped
(
std
::
move
(
obj
));
vptr_
=
&
vtbl
;
vptr_
=
&
vtbl
;
}
}
...
@@ -127,9 +119,6 @@ public:
...
@@ -127,9 +119,6 @@ public:
vptr_
->
done_
(
data_
);
vptr_
->
done_
(
data_
);
}
}
void
stopping
()
noexcept
{
vptr_
->
stopping_
(
data_
);
}
void
starting
(
any_none
<
PE
>
up
)
{
void
starting
(
any_none
<
PE
>
up
)
{
vptr_
->
starting_
(
data_
,
std
::
move
(
up
));
vptr_
->
starting_
(
data_
,
std
::
move
(
up
));
}
}
...
@@ -140,15 +129,14 @@ template <class V, class PE, class E>
...
@@ -140,15 +129,14 @@ template <class V, class PE, class E>
constexpr
typename
flow_single
<
V
,
PE
,
E
>::
vtable
const
constexpr
typename
flow_single
<
V
,
PE
,
E
>::
vtable
const
flow_single
<
V
,
PE
,
E
>::
noop_
;
flow_single
<
V
,
PE
,
E
>::
noop_
;
template
<
class
VF
,
class
EF
,
class
DF
,
class
St
pF
,
class
St
rtF
>
template
<
class
VF
,
class
EF
,
class
DF
,
class
StrtF
>
#if __cpp_concepts
#if __cpp_concepts
requires
Invocable
<
DF
&>
requires
Invocable
<
DF
&>
#endif
#endif
class
flow_single
<
VF
,
EF
,
DF
,
St
pF
,
St
rtF
>
{
class
flow_single
<
VF
,
EF
,
DF
,
StrtF
>
{
VF
vf_
;
VF
vf_
;
EF
ef_
;
EF
ef_
;
DF
df_
;
DF
df_
;
StpF
stpf_
;
StrtF
strtf_
;
StrtF
strtf_
;
public:
public:
...
@@ -174,12 +162,10 @@ class flow_single<VF, EF, DF, StpF, StrtF> {
...
@@ -174,12 +162,10 @@ class flow_single<VF, EF, DF, StpF, StrtF> {
VF
vf
,
VF
vf
,
EF
ef
,
EF
ef
,
DF
df
=
DF
{},
DF
df
=
DF
{},
StpF
stpf
=
StpF
{},
StrtF
strtf
=
StrtF
{})
StrtF
strtf
=
StrtF
{})
:
vf_
(
std
::
move
(
vf
)),
:
vf_
(
std
::
move
(
vf
)),
ef_
(
std
::
move
(
ef
)),
ef_
(
std
::
move
(
ef
)),
df_
(
std
::
move
(
df
)),
df_
(
std
::
move
(
df
)),
stpf_
(
std
::
move
(
stpf
)),
strtf_
(
std
::
move
(
strtf
))
{}
strtf_
(
std
::
move
(
strtf
))
{}
PUSHMI_TEMPLATE
(
class
V
)
PUSHMI_TEMPLATE
(
class
V
)
(
requires
Invocable
<
VF
&
,
V
>
)
(
requires
Invocable
<
VF
&
,
V
>
)
...
@@ -195,9 +181,6 @@ class flow_single<VF, EF, DF, StpF, StrtF> {
...
@@ -195,9 +181,6 @@ class flow_single<VF, EF, DF, StpF, StrtF> {
void
done
()
{
void
done
()
{
df_
();
df_
();
}
}
void
stopping
()
noexcept
{
stpf_
();
}
PUSHMI_TEMPLATE
(
class
Up
)
PUSHMI_TEMPLATE
(
class
Up
)
(
requires
Receiver
<
Up
,
is_none
<>>
&&
Invocable
<
StrtF
&
,
Up
&&>
)
(
requires
Receiver
<
Up
,
is_none
<>>
&&
Invocable
<
StrtF
&
,
Up
&&>
)
void
starting
(
Up
&&
up
)
{
void
starting
(
Up
&&
up
)
{
...
@@ -210,17 +193,15 @@ template<
...
@@ -210,17 +193,15 @@ template<
class
DVF
,
class
DVF
,
class
DEF
,
class
DEF
,
class
DDF
,
class
DDF
,
class
DStpF
,
class
DStrtF
>
class
DStrtF
>
#if __cpp_concepts
#if __cpp_concepts
requires
Invocable
<
DDF
&
,
Data
&>
requires
Invocable
<
DDF
&
,
Data
&>
#endif
#endif
class
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
DSt
pF
,
DSt
rtF
>
{
class
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
DStrtF
>
{
Data
data_
;
Data
data_
;
DVF
vf_
;
DVF
vf_
;
DEF
ef_
;
DEF
ef_
;
DDF
df_
;
DDF
df_
;
DStpF
stpf_
;
DStrtF
strtf_
;
DStrtF
strtf_
;
public:
public:
...
@@ -244,13 +225,11 @@ class flow_single<Data, DVF, DEF, DDF, DStpF, DStrtF> {
...
@@ -244,13 +225,11 @@ class flow_single<Data, DVF, DEF, DDF, DStpF, DStrtF> {
DVF
vf
,
DVF
vf
,
DEF
ef
=
DEF
{},
DEF
ef
=
DEF
{},
DDF
df
=
DDF
{},
DDF
df
=
DDF
{},
DStpF
stpf
=
DStpF
{},
DStrtF
strtf
=
DStrtF
{})
DStrtF
strtf
=
DStrtF
{})
:
data_
(
std
::
move
(
d
)),
:
data_
(
std
::
move
(
d
)),
vf_
(
vf
),
vf_
(
vf
),
ef_
(
ef
),
ef_
(
ef
),
df_
(
df
),
df_
(
df
),
stpf_
(
std
::
move
(
stpf
)),
strtf_
(
std
::
move
(
strtf
))
{}
strtf_
(
std
::
move
(
strtf
))
{}
PUSHMI_TEMPLATE
(
class
V
)
PUSHMI_TEMPLATE
(
class
V
)
(
requires
Invocable
<
DVF
&
,
Data
&
,
V
>
)
(
requires
Invocable
<
DVF
&
,
Data
&
,
V
>
)
...
@@ -267,9 +246,6 @@ class flow_single<Data, DVF, DEF, DDF, DStpF, DStrtF> {
...
@@ -267,9 +246,6 @@ class flow_single<Data, DVF, DEF, DDF, DStpF, DStrtF> {
void
done
()
{
void
done
()
{
df_
(
data_
);
df_
(
data_
);
}
}
void
stopping
()
noexcept
{
stpf_
(
data_
);
}
PUSHMI_TEMPLATE
(
class
Up
)
PUSHMI_TEMPLATE
(
class
Up
)
(
requires
Invocable
<
DStrtF
&
,
Data
&
,
Up
&&>
)
(
requires
Invocable
<
DStrtF
&
,
Data
&
,
Up
&&>
)
void
starting
(
Up
&&
up
)
{
void
starting
(
Up
&&
up
)
{
...
@@ -279,7 +255,7 @@ class flow_single<Data, DVF, DEF, DDF, DStpF, DStrtF> {
...
@@ -279,7 +255,7 @@ class flow_single<Data, DVF, DEF, DDF, DStpF, DStrtF> {
template
<
>
template
<
>
class
flow_single
<>
class
flow_single
<>
:
public
flow_single
<
ignoreVF
,
abortEF
,
ignoreDF
,
ignoreSt
pF
,
ignoreSt
rtF
>
{
:
public
flow_single
<
ignoreVF
,
abortEF
,
ignoreDF
,
ignoreStrtF
>
{
};
};
// TODO winnow down the number of make_flow_single overloads and deduction
// TODO winnow down the number of make_flow_single overloads and deduction
...
@@ -294,100 +270,88 @@ PUSHMI_INLINE_VAR constexpr struct make_flow_single_fn {
...
@@ -294,100 +270,88 @@ PUSHMI_INLINE_VAR constexpr struct make_flow_single_fn {
PUSHMI_TEMPLATE
(
class
VF
)
PUSHMI_TEMPLATE
(
class
VF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
PUSHMI_AND
not
defer
::
Invocable
<
VF
&>
)))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
PUSHMI_AND
not
defer
::
Invocable
<
VF
&>
)))
auto
operator
()(
VF
vf
)
const
{
auto
operator
()(
VF
vf
)
const
{
return
flow_single
<
VF
,
abortEF
,
ignoreDF
,
ignoreSt
pF
,
ignoreSt
rtF
>
{
return
flow_single
<
VF
,
abortEF
,
ignoreDF
,
ignoreStrtF
>
{
std
::
move
(
vf
)};
std
::
move
(
vf
)};
}
}
template
<
class
...
EFN
>
template
<
class
...
EFN
>
auto
operator
()(
on_error_fn
<
EFN
...
>
ef
)
const
{
auto
operator
()(
on_error_fn
<
EFN
...
>
ef
)
const
{
return
flow_single
<
ignoreVF
,
on_error_fn
<
EFN
...
>
,
ignoreDF
,
ignoreSt
pF
,
ignoreSt
rtF
>
{
return
flow_single
<
ignoreVF
,
on_error_fn
<
EFN
...
>
,
ignoreDF
,
ignoreStrtF
>
{
std
::
move
(
ef
)};
std
::
move
(
ef
)};
}
}
PUSHMI_TEMPLATE
(
class
DF
)
PUSHMI_TEMPLATE
(
class
DF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
DF
>
)))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
DF
>
)))
auto
operator
()(
DF
df
)
const
{
auto
operator
()(
DF
df
)
const
{
return
flow_single
<
ignoreVF
,
abortEF
,
DF
,
ignoreSt
pF
,
ignoreSt
rtF
>
{
std
::
move
(
df
)};
return
flow_single
<
ignoreVF
,
abortEF
,
DF
,
ignoreStrtF
>
{
std
::
move
(
df
)};
}
}
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
)
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
PUSHMI_AND
not
defer
::
Invocable
<
EF
&>
)))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
PUSHMI_AND
not
defer
::
Invocable
<
EF
&>
)))
auto
operator
()(
VF
vf
,
EF
ef
)
const
{
auto
operator
()(
VF
vf
,
EF
ef
)
const
{
return
flow_single
<
VF
,
EF
,
ignoreDF
,
ignoreSt
pF
,
ignoreSt
rtF
>
{
std
::
move
(
vf
),
return
flow_single
<
VF
,
EF
,
ignoreDF
,
ignoreStrtF
>
{
std
::
move
(
vf
),
std
::
move
(
ef
)};
std
::
move
(
ef
)};
}
}
PUSHMI_TEMPLATE
(
class
EF
,
class
DF
)
PUSHMI_TEMPLATE
(
class
EF
,
class
DF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
EF
>
)))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
EF
>
)))
auto
operator
()(
EF
ef
,
DF
df
)
const
{
auto
operator
()(
EF
ef
,
DF
df
)
const
{
return
flow_single
<
ignoreVF
,
EF
,
DF
,
ignoreSt
pF
,
ignoreSt
rtF
>
{
std
::
move
(
ef
),
std
::
move
(
df
)};
return
flow_single
<
ignoreVF
,
EF
,
DF
,
ignoreStrtF
>
{
std
::
move
(
ef
),
std
::
move
(
df
)};
}
}
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
,
class
DF
)
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
,
class
DF
)
(
requires
PUSHMI_EXP
(
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
)))
(
requires
PUSHMI_EXP
(
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
)))
auto
operator
()(
VF
vf
,
EF
ef
,
DF
df
)
const
{
auto
operator
()(
VF
vf
,
EF
ef
,
DF
df
)
const
{
return
flow_single
<
VF
,
EF
,
DF
,
ignoreSt
pF
,
ignoreSt
rtF
>
{
std
::
move
(
vf
),
return
flow_single
<
VF
,
EF
,
DF
,
ignoreStrtF
>
{
std
::
move
(
vf
),
std
::
move
(
ef
),
std
::
move
(
df
)};
std
::
move
(
ef
),
std
::
move
(
df
)};
}
}
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
,
class
DF
,
class
StpF
)
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
,
class
DF
,
class
StrtF
)
(
requires
PUSHMI_EXP
(
defer
::
Invocable
<
DF
&>
PUSHMI_AND
defer
::
Invocable
<
StpF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
)))
(
requires
PUSHMI_EXP
(
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
)))
auto
operator
()(
VF
vf
,
EF
ef
,
DF
df
,
StpF
stpf
)
const
{
auto
operator
()(
VF
vf
,
EF
ef
,
DF
df
,
StrtF
strtf
)
const
{
return
flow_single
<
VF
,
EF
,
DF
,
StpF
,
ignoreStrtF
>
{
std
::
move
(
vf
),
return
flow_single
<
VF
,
EF
,
DF
,
StrtF
>
{
std
::
move
(
vf
),
std
::
move
(
ef
),
std
::
move
(
ef
),
std
::
move
(
df
),
std
::
move
(
stpf
)};
std
::
move
(
df
),
std
::
move
(
strtf
)};
}
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
,
class
DF
,
class
StpF
,
class
StrtF
)
(
requires
PUSHMI_EXP
(
defer
::
Invocable
<
DF
&>
PUSHMI_AND
defer
::
Invocable
<
StpF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
)))
auto
operator
()(
VF
vf
,
EF
ef
,
DF
df
,
StpF
stpf
,
StrtF
strtf
)
const
{
return
flow_single
<
VF
,
EF
,
DF
,
StpF
,
StrtF
>
{
std
::
move
(
vf
),
std
::
move
(
ef
),
std
::
move
(
df
),
std
::
move
(
stpf
),
std
::
move
(
strtf
)};
}
}
PUSHMI_TEMPLATE
(
class
Data
)
PUSHMI_TEMPLATE
(
class
Data
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
))
auto
operator
()(
Data
d
)
const
{
auto
operator
()(
Data
d
)
const
{
return
flow_single
<
Data
,
passDVF
,
passDEF
,
passDDF
,
passDSt
pF
,
passDSt
rtF
>
{
return
flow_single
<
Data
,
passDVF
,
passDEF
,
passDDF
,
passDStrtF
>
{
std
::
move
(
d
)};
std
::
move
(
d
)};
}
}
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Invocable
<
DVF
&
,
Data
&>
)))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Invocable
<
DVF
&
,
Data
&>
)))
auto
operator
()(
Data
d
,
DVF
vf
)
const
{
auto
operator
()(
Data
d
,
DVF
vf
)
const
{
return
flow_single
<
Data
,
DVF
,
passDEF
,
passDDF
,
passDSt
pF
,
passDSt
rtF
>
{
return
flow_single
<
Data
,
DVF
,
passDEF
,
passDDF
,
passDStrtF
>
{
std
::
move
(
d
),
std
::
move
(
vf
)};
std
::
move
(
d
),
std
::
move
(
vf
)};
}
}
PUSHMI_TEMPLATE
(
class
Data
,
class
...
DEFN
)
PUSHMI_TEMPLATE
(
class
Data
,
class
...
DEFN
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
))
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
))
auto
operator
()(
Data
d
,
on_error_fn
<
DEFN
...
>
ef
)
const
{
auto
operator
()(
Data
d
,
on_error_fn
<
DEFN
...
>
ef
)
const
{
return
flow_single
<
Data
,
passDVF
,
on_error_fn
<
DEFN
...
>
,
passDDF
,
passDSt
pF
,
passDSt
rtF
>
{
return
flow_single
<
Data
,
passDVF
,
on_error_fn
<
DEFN
...
>
,
passDDF
,
passDStrtF
>
{
std
::
move
(
d
),
std
::
move
(
ef
)};
std
::
move
(
d
),
std
::
move
(
ef
)};
}
}
PUSHMI_TEMPLATE
(
class
Data
,
class
DDF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DDF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
auto
operator
()(
Data
d
,
DDF
df
)
const
{
auto
operator
()(
Data
d
,
DDF
df
)
const
{
return
flow_single
<
Data
,
passDVF
,
passDEF
,
DDF
,
passDSt
pF
,
passDSt
rtF
>
{
return
flow_single
<
Data
,
passDVF
,
passDEF
,
DDF
,
passDStrtF
>
{
std
::
move
(
d
),
std
::
move
(
df
)};
std
::
move
(
d
),
std
::
move
(
df
)};
}
}
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Invocable
<
DEF
&
,
Data
&>
)))
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Invocable
<
DEF
&
,
Data
&>
)))
auto
operator
()(
Data
d
,
DVF
vf
,
DEF
ef
)
const
{
auto
operator
()(
Data
d
,
DVF
vf
,
DEF
ef
)
const
{
return
flow_single
<
Data
,
DVF
,
DEF
,
passDDF
,
passDSt
pF
,
passDSt
rtF
>
{
std
::
move
(
d
),
std
::
move
(
vf
),
std
::
move
(
ef
)};
return
flow_single
<
Data
,
DVF
,
DEF
,
passDDF
,
passDStrtF
>
{
std
::
move
(
d
),
std
::
move
(
vf
),
std
::
move
(
ef
)};
}
}
PUSHMI_TEMPLATE
(
class
Data
,
class
DEF
,
class
DDF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DEF
,
class
DDF
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
auto
operator
()(
Data
d
,
DEF
ef
,
DDF
df
)
const
{
auto
operator
()(
Data
d
,
DEF
ef
,
DDF
df
)
const
{
return
flow_single
<
Data
,
passDVF
,
DEF
,
DDF
,
passDSt
pF
,
passDSt
rtF
>
{
return
flow_single
<
Data
,
passDVF
,
DEF
,
DDF
,
passDStrtF
>
{
std
::
move
(
d
),
std
::
move
(
ef
),
std
::
move
(
df
)};
std
::
move
(
d
),
std
::
move
(
ef
),
std
::
move
(
df
)};
}
}
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
,
class
DDF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
,
class
DDF
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
auto
operator
()(
Data
d
,
DVF
vf
,
DEF
ef
,
DDF
df
)
const
{
auto
operator
()(
Data
d
,
DVF
vf
,
DEF
ef
,
DDF
df
)
const
{
return
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
passDSt
pF
,
passDSt
rtF
>
{
std
::
move
(
d
),
return
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
passDStrtF
>
{
std
::
move
(
d
),
std
::
move
(
vf
),
std
::
move
(
ef
),
std
::
move
(
df
)};
std
::
move
(
vf
),
std
::
move
(
ef
),
std
::
move
(
df
)};
}
}
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
,
class
DDF
,
class
DStpF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
,
class
DDF
,
class
DStrtF
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
PUSHMI_AND
defer
::
Invocable
<
DStpF
&
,
Data
&>
))
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
auto
operator
()(
Data
d
,
DVF
vf
,
DEF
ef
,
DDF
df
,
DStpF
stpf
)
const
{
auto
operator
()(
Data
d
,
DVF
vf
,
DEF
ef
,
DDF
df
,
DStrtF
strtf
)
const
{
return
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
DStpF
,
passDStrtF
>
{
std
::
move
(
d
),
return
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
DStrtF
>
{
std
::
move
(
d
),
std
::
move
(
vf
),
std
::
move
(
ef
),
std
::
move
(
df
),
std
::
move
(
stpf
)};
std
::
move
(
vf
),
std
::
move
(
ef
),
std
::
move
(
df
),
std
::
move
(
strtf
)};
}
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
,
class
DDF
,
class
DStpF
,
class
DStrtF
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
PUSHMI_AND
defer
::
Invocable
<
DStpF
&
,
Data
&>
))
auto
operator
()(
Data
d
,
DVF
vf
,
DEF
ef
,
DDF
df
,
DStpF
stpf
,
DStrtF
strtf
)
const
{
return
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
DStpF
,
DStrtF
>
{
std
::
move
(
d
),
std
::
move
(
vf
),
std
::
move
(
ef
),
std
::
move
(
df
),
std
::
move
(
stpf
),
std
::
move
(
strtf
)};
}
}
}
const
make_flow_single
{};
}
const
make_flow_single
{};
...
@@ -399,86 +363,76 @@ flow_single() -> flow_single<>;
...
@@ -399,86 +363,76 @@ flow_single() -> flow_single<>;
PUSHMI_TEMPLATE
(
class
VF
)
PUSHMI_TEMPLATE
(
class
VF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
PUSHMI_AND
not
defer
::
Invocable
<
VF
&>
)))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
PUSHMI_AND
not
defer
::
Invocable
<
VF
&>
)))
flow_single
(
VF
)
->
flow_single
(
VF
)
->
flow_single
<
VF
,
abortEF
,
ignoreDF
,
ignoreSt
pF
,
ignoreSt
rtF
>
;
flow_single
<
VF
,
abortEF
,
ignoreDF
,
ignoreStrtF
>
;
template
<
class
...
EFN
>
template
<
class
...
EFN
>
flow_single
(
on_error_fn
<
EFN
...
>
)
->
flow_single
(
on_error_fn
<
EFN
...
>
)
->
flow_single
<
ignoreVF
,
on_error_fn
<
EFN
...
>
,
ignoreDF
,
ignoreSt
pF
,
ignoreSt
rtF
>
;
flow_single
<
ignoreVF
,
on_error_fn
<
EFN
...
>
,
ignoreDF
,
ignoreStrtF
>
;
PUSHMI_TEMPLATE
(
class
DF
)
PUSHMI_TEMPLATE
(
class
DF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
DF
>
)))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
DF
>
)))
flow_single
(
DF
)
->
flow_single
(
DF
)
->
flow_single
<
ignoreVF
,
abortEF
,
DF
,
ignoreSt
pF
,
ignoreSt
rtF
>
;
flow_single
<
ignoreVF
,
abortEF
,
DF
,
ignoreStrtF
>
;
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
)
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
PUSHMI_AND
not
defer
::
Invocable
<
EF
&>
)))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
PUSHMI_AND
not
defer
::
Invocable
<
EF
&>
)))
flow_single
(
VF
,
EF
)
->
flow_single
(
VF
,
EF
)
->
flow_single
<
VF
,
EF
,
ignoreDF
,
ignoreSt
pF
,
ignoreSt
rtF
>
;
flow_single
<
VF
,
EF
,
ignoreDF
,
ignoreStrtF
>
;
PUSHMI_TEMPLATE
(
class
EF
,
class
DF
)
PUSHMI_TEMPLATE
(
class
EF
,
class
DF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
EF
>
)))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
EF
>
)))
flow_single
(
EF
,
DF
)
->
flow_single
(
EF
,
DF
)
->
flow_single
<
ignoreVF
,
EF
,
DF
,
ignoreSt
pF
,
ignoreSt
rtF
>
;
flow_single
<
ignoreVF
,
EF
,
DF
,
ignoreStrtF
>
;
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
,
class
DF
)
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
,
class
DF
)
(
requires
PUSHMI_EXP
(
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
)))
(
requires
PUSHMI_EXP
(
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
)))
flow_single
(
VF
,
EF
,
DF
)
->
flow_single
(
VF
,
EF
,
DF
)
->
flow_single
<
VF
,
EF
,
DF
,
ignoreSt
pF
,
ignoreSt
rtF
>
;
flow_single
<
VF
,
EF
,
DF
,
ignoreStrtF
>
;
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
,
class
DF
,
class
StpF
)
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
,
class
DF
,
class
StrtF
)
(
requires
PUSHMI_EXP
(
defer
::
Invocable
<
DF
&>
PUSHMI_AND
defer
::
Invocable
<
StpF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
)))
(
requires
PUSHMI_EXP
(
defer
::
Invocable
<
DF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
)))
flow_single
(
VF
,
EF
,
DF
,
StpF
)
->
flow_single
(
VF
,
EF
,
DF
,
StrtF
)
->
flow_single
<
VF
,
EF
,
DF
,
StpF
,
ignoreStrtF
>
;
flow_single
<
VF
,
EF
,
DF
,
StrtF
>
;
PUSHMI_TEMPLATE
(
class
VF
,
class
EF
,
class
DF
,
class
StpF
,
class
StrtF
)
(
requires
PUSHMI_EXP
(
defer
::
Invocable
<
DF
&>
PUSHMI_AND
defer
::
Invocable
<
StpF
&>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Receiver
<
VF
>
)))
flow_single
(
VF
,
EF
,
DF
,
StpF
,
StrtF
)
->
flow_single
<
VF
,
EF
,
DF
,
StpF
,
StrtF
>
;
PUSHMI_TEMPLATE
(
class
Data
)
PUSHMI_TEMPLATE
(
class
Data
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
))
flow_single
(
Data
d
)
->
flow_single
(
Data
d
)
->
flow_single
<
Data
,
passDVF
,
passDEF
,
passDDF
,
passDSt
pF
,
passDSt
rtF
>
;
flow_single
<
Data
,
passDVF
,
passDEF
,
passDDF
,
passDStrtF
>
;
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Invocable
<
DVF
&
,
Data
&>
)))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Invocable
<
DVF
&
,
Data
&>
)))
flow_single
(
Data
d
,
DVF
vf
)
->
flow_single
(
Data
d
,
DVF
vf
)
->
flow_single
<
Data
,
DVF
,
passDEF
,
passDDF
,
passDSt
pF
,
passDSt
rtF
>
;
flow_single
<
Data
,
DVF
,
passDEF
,
passDDF
,
passDStrtF
>
;
PUSHMI_TEMPLATE
(
class
Data
,
class
...
DEFN
)
PUSHMI_TEMPLATE
(
class
Data
,
class
...
DEFN
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
))
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
))
flow_single
(
Data
d
,
on_error_fn
<
DEFN
...
>
)
->
flow_single
(
Data
d
,
on_error_fn
<
DEFN
...
>
)
->
flow_single
<
Data
,
passDVF
,
on_error_fn
<
DEFN
...
>
,
passDDF
,
passDSt
pF
,
passDSt
rtF
>
;
flow_single
<
Data
,
passDVF
,
on_error_fn
<
DEFN
...
>
,
passDDF
,
passDStrtF
>
;
PUSHMI_TEMPLATE
(
class
Data
,
class
DDF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DDF
)
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
(
requires
PUSHMI_EXP
(
defer
::
True
<>
PUSHMI_AND
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
flow_single
(
Data
d
,
DDF
)
->
flow_single
(
Data
d
,
DDF
)
->
flow_single
<
Data
,
passDVF
,
passDEF
,
DDF
,
passDSt
pF
,
passDSt
rtF
>
;
flow_single
<
Data
,
passDVF
,
passDEF
,
DDF
,
passDStrtF
>
;
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Invocable
<
DEF
&
,
Data
&>
)))
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_BROKEN_SUBSUMPTION
(
PUSHMI_AND
not
defer
::
Invocable
<
DEF
&
,
Data
&>
)))
flow_single
(
Data
d
,
DVF
vf
,
DEF
ef
)
->
flow_single
(
Data
d
,
DVF
vf
,
DEF
ef
)
->
flow_single
<
Data
,
DVF
,
DEF
,
passDDF
,
passDSt
pF
,
passDSt
rtF
>
;
flow_single
<
Data
,
DVF
,
DEF
,
passDDF
,
passDStrtF
>
;
PUSHMI_TEMPLATE
(
class
Data
,
class
DEF
,
class
DDF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DEF
,
class
DDF
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
flow_single
(
Data
d
,
DEF
,
DDF
)
->
flow_single
(
Data
d
,
DEF
,
DDF
)
->
flow_single
<
Data
,
passDVF
,
DEF
,
DDF
,
passDSt
pF
,
passDSt
rtF
>
;
flow_single
<
Data
,
passDVF
,
DEF
,
DDF
,
passDStrtF
>
;
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
,
class
DDF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
,
class
DDF
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
flow_single
(
Data
d
,
DVF
vf
,
DEF
ef
,
DDF
df
)
->
flow_single
(
Data
d
,
DVF
vf
,
DEF
ef
,
DDF
df
)
->
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
passDStpF
,
passDStrtF
>
;
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
passDStrtF
>
;
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
,
class
DDF
,
class
DStpF
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
PUSHMI_AND
defer
::
Invocable
<
DStpF
&
,
Data
&>
))
flow_single
(
Data
d
,
DVF
vf
,
DEF
ef
,
DDF
df
,
DStpF
stpf
)
->
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
DStpF
,
passDStrtF
>
;
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
,
class
DDF
,
class
DSt
pF
,
class
DSt
rtF
)
PUSHMI_TEMPLATE
(
class
Data
,
class
DVF
,
class
DEF
,
class
DDF
,
class
DStrtF
)
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
PUSHMI_AND
defer
::
Invocable
<
DStpF
&
,
Data
&>
))
(
requires
PUSHMI_EXP
(
defer
::
Receiver
<
Data
>
PUSHMI_AND
defer
::
Invocable
<
DDF
&
,
Data
&>
))
flow_single
(
Data
d
,
DVF
vf
,
DEF
ef
,
DDF
df
,
DSt
pF
stpf
,
DSt
rtF
strtf
)
->
flow_single
(
Data
d
,
DVF
vf
,
DEF
ef
,
DDF
df
,
DStrtF
strtf
)
->
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
DSt
pF
,
DSt
rtF
>
;
flow_single
<
Data
,
DVF
,
DEF
,
DDF
,
DStrtF
>
;
#endif
#endif
template
<
class
V
,
class
PE
=
std
::
exception_ptr
,
class
E
=
PE
>
template
<
class
V
,
class
PE
=
std
::
exception_ptr
,
class
E
=
PE
>
...
...
folly/experimental/pushmi/include/pushmi/o/extension_operators.h
View file @
eb464ae8
...
@@ -214,16 +214,6 @@ struct set_done_fn {
...
@@ -214,16 +214,6 @@ struct set_done_fn {
}
}
};
};
struct
set_stopping_fn
{
auto
operator
()()
const
{
return
constrain
(
lazy
::
Receiver
<
_1
>
,
[](
auto
out
)
{
::
pushmi
::
set_stopping
(
out
);
}
);
}
};
struct
set_starting_fn
{
struct
set_starting_fn
{
PUSHMI_TEMPLATE
(
class
Up
)
PUSHMI_TEMPLATE
(
class
Up
)
(
requires
Receiver
<
Up
>
)
(
requires
Receiver
<
Up
>
)
...
@@ -274,7 +264,6 @@ namespace extension_operators {
...
@@ -274,7 +264,6 @@ namespace extension_operators {
PUSHMI_INLINE_VAR
constexpr
detail
::
set_done_fn
set_done
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
set_done_fn
set_done
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
set_error_fn
set_error
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
set_error_fn
set_error
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
set_value_fn
set_value
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
set_value_fn
set_value
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
set_stopping_fn
set_stopping
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
set_starting_fn
set_starting
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
set_starting_fn
set_starting
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
do_submit_fn
submit
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
do_submit_fn
submit
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
now_fn
now
{};
PUSHMI_INLINE_VAR
constexpr
detail
::
now_fn
now
{};
...
...
folly/experimental/pushmi/include/pushmi/o/on.h
View file @
eb464ae8
...
@@ -147,15 +147,6 @@ class fsdon {
...
@@ -147,15 +147,6 @@ class fsdon {
out_.error(std::move(e));
out_.error(std::move(e));
}
}
void stopping() {
if (done_) {
return;
}
done_ = true;
*stopped_ = true;
out_.stopping();
}
template <class Producer>
template <class Producer>
void starting(RefWrapper<Producer> up) {
void starting(RefWrapper<Producer> up) {
upProxy_ =
upProxy_ =
...
...
folly/experimental/pushmi/include/pushmi/o/via.h
View file @
eb464ae8
...
@@ -183,24 +183,6 @@ class fsdvia {
...
@@ -183,24 +183,6 @@ class fsdvia {
});
});
}
}
void stopping() {
if (done_) {
return;
}
if (!upProxy_) {
std::abort();
}
done_ = true;
if (!shared_->stopped_.exchange(true)) {
exec_ |
// must keep out and upProxy alive until out is notified that it
// is unsafe
execute([shared = shared_](auto) mutable {
shared->out_.stopping();
});
}
}
template <class Producer>
template <class Producer>
void starting(RefWrapper<Producer> up) {
void starting(RefWrapper<Producer> up) {
if (!!upProxy_) {
if (!!upProxy_) {
...
...
folly/experimental/pushmi/test/CompileTest.cpp
View file @
eb464ae8
...
@@ -257,13 +257,6 @@ void flow_single_test() {
...
@@ -257,13 +257,6 @@ void flow_single_test() {
pushmi
::
ignoreVF
{},
pushmi
::
ignoreVF
{},
pushmi
::
abortEF
{},
pushmi
::
abortEF
{},
pushmi
::
ignoreDF
{},
pushmi
::
ignoreDF
{},
pushmi
::
ignoreStpF
{});
auto
out9
=
pushmi
::
MAKE
(
flow_single
)(
pushmi
::
ignoreVF
{},
pushmi
::
abortEF
{},
pushmi
::
ignoreDF
{},
pushmi
::
ignoreStpF
{},
pushmi
::
ignoreStrtF
{});
pushmi
::
ignoreStrtF
{});
using
Out0
=
decltype
(
out0
);
using
Out0
=
decltype
(
out0
);
...
@@ -297,11 +290,6 @@ void flow_single_test() {
...
@@ -297,11 +290,6 @@ void flow_single_test() {
pushmi
::
passDVF
{},
pushmi
::
passDVF
{},
pushmi
::
passDEF
{},
pushmi
::
passDEF
{},
pushmi
::
passDDF
{});
pushmi
::
passDDF
{});
auto
proxy9
=
pushmi
::
MAKE
(
flow_single
)(
out0
,
pushmi
::
passDVF
{},
pushmi
::
passDEF
{},
pushmi
::
passDDF
{},
pushmi
::
passDStpF
{});
auto
any2
=
pushmi
::
any_flow_single
<
int
>
(
out0
);
auto
any2
=
pushmi
::
any_flow_single
<
int
>
(
out0
);
auto
any3
=
pushmi
::
any_flow_single
<
int
>
(
proxy0
);
auto
any3
=
pushmi
::
any_flow_single
<
int
>
(
proxy0
);
...
...
folly/experimental/pushmi/test/FlowTest.cpp
View file @
eb464ae8
...
@@ -46,11 +46,11 @@ SCENARIO("flow single immediate cancellation", "[flow][deferred]") {
...
@@ -46,11 +46,11 @@ SCENARIO("flow single immediate cancellation", "[flow][deferred]") {
auto
up
=
mi
::
MAKE
(
none
)(
auto
up
=
mi
::
MAKE
(
none
)(
Data
{
std
::
move
(
tokens
.
second
)},
Data
{
std
::
move
(
tokens
.
second
)},
[
&
](
auto
&
data
,
auto
e
)
noexcept
{
[
&
](
auto
&
data
,
auto
e
)
noexcept
{
signals
+=
100000
0
;
signals
+=
100000
;
data
.
stopper
.
t
(
data
.
stopper
);
data
.
stopper
.
t
(
data
.
stopper
);
},
},
[
&
](
auto
&
data
)
{
[
&
](
auto
&
data
)
{
signals
+=
10000
0
;
signals
+=
10000
;
data
.
stopper
.
t
(
data
.
stopper
);
data
.
stopper
.
t
(
data
.
stopper
);
});
});
...
@@ -64,9 +64,6 @@ SCENARIO("flow single immediate cancellation", "[flow][deferred]") {
...
@@ -64,9 +64,6 @@ SCENARIO("flow single immediate cancellation", "[flow][deferred]") {
// cancellation is not an error
// cancellation is not an error
::
mi
::
set_done
(
out
);
::
mi
::
set_done
(
out
);
}
}
// I want to get rid of this signal it makes usage harder and
// messes up r-value qualifing done, error and value.
::
mi
::
set_stopping
(
out
);
});
});
WHEN
(
"submit is applied and cancels the producer"
)
{
WHEN
(
"submit is applied and cancels the producer"
)
{
...
@@ -75,7 +72,6 @@ SCENARIO("flow single immediate cancellation", "[flow][deferred]") {
...
@@ -75,7 +72,6 @@ SCENARIO("flow single immediate cancellation", "[flow][deferred]") {
mi
::
on_value
([
&
](
int
)
{
signals
+=
100
;
}),
mi
::
on_value
([
&
](
int
)
{
signals
+=
100
;
}),
mi
::
on_error
([
&
](
auto
)
noexcept
{
signals
+=
1000
;
}),
mi
::
on_error
([
&
](
auto
)
noexcept
{
signals
+=
1000
;
}),
mi
::
on_done
([
&
]()
{
signals
+=
1
;
}),
mi
::
on_done
([
&
]()
{
signals
+=
1
;
}),
mi
::
on_stopping
([
&
]()
{
signals
+=
10000
;
}),
// immediately stop producer
// immediately stop producer
mi
::
on_starting
([
&
](
auto
up
)
{
mi
::
on_starting
([
&
](
auto
up
)
{
signals
+=
10
;
signals
+=
10
;
...
@@ -83,8 +79,8 @@ SCENARIO("flow single immediate cancellation", "[flow][deferred]") {
...
@@ -83,8 +79,8 @@ SCENARIO("flow single immediate cancellation", "[flow][deferred]") {
}));
}));
THEN
(
THEN
(
"the starting, up.done
, out.done and out.stopping
signals are each recorded once"
)
{
"the starting, up.done
and out.done
signals are each recorded once"
)
{
REQUIRE
(
signals
==
1
1
0011
);
REQUIRE
(
signals
==
10011
);
}
}
}
}
...
@@ -94,13 +90,12 @@ SCENARIO("flow single immediate cancellation", "[flow][deferred]") {
...
@@ -94,13 +90,12 @@ SCENARIO("flow single immediate cancellation", "[flow][deferred]") {
mi
::
on_value
([
&
](
int
)
{
signals
+=
100
;
}),
mi
::
on_value
([
&
](
int
)
{
signals
+=
100
;
}),
mi
::
on_error
([
&
](
auto
)
noexcept
{
signals
+=
1000
;
}),
mi
::
on_error
([
&
](
auto
)
noexcept
{
signals
+=
1000
;
}),
mi
::
on_done
([
&
]()
{
signals
+=
1
;
}),
mi
::
on_done
([
&
]()
{
signals
+=
1
;
}),
mi
::
on_stopping
([
&
]()
{
signals
+=
10000
;
}),
// do not stop producer before it is scheduled to run
// do not stop producer before it is scheduled to run
mi
::
on_starting
([
&
](
auto
up
)
{
signals
+=
10
;
}));
mi
::
on_starting
([
&
](
auto
up
)
{
signals
+=
10
;
}));
THEN
(
THEN
(
"the starting
, out.value and out.stopping
signals are each recorded once"
)
{
"the starting
and out.value
signals are each recorded once"
)
{
REQUIRE
(
signals
==
1
01
10
);
REQUIRE
(
signals
==
110
);
}
}
}
}
}
}
...
@@ -132,11 +127,11 @@ SCENARIO("flow single cancellation trampoline", "[flow][deferred]") {
...
@@ -132,11 +127,11 @@ SCENARIO("flow single cancellation trampoline", "[flow][deferred]") {
auto
up
=
mi
::
MAKE
(
none
)(
auto
up
=
mi
::
MAKE
(
none
)(
Data
{
std
::
move
(
tokens
.
second
)},
Data
{
std
::
move
(
tokens
.
second
)},
[
&
](
auto
&
data
,
auto
e
)
noexcept
{
[
&
](
auto
&
data
,
auto
e
)
noexcept
{
signals
+=
100000
0
;
signals
+=
100000
;
data
.
stopper
.
t
(
data
.
stopper
);
data
.
stopper
.
t
(
data
.
stopper
);
},
},
[
&
](
auto
&
data
)
{
[
&
](
auto
&
data
)
{
signals
+=
10000
0
;
signals
+=
10000
;
data
.
stopper
.
t
(
data
.
stopper
);
data
.
stopper
.
t
(
data
.
stopper
);
});
});
...
@@ -160,9 +155,6 @@ SCENARIO("flow single cancellation trampoline", "[flow][deferred]") {
...
@@ -160,9 +155,6 @@ SCENARIO("flow single cancellation trampoline", "[flow][deferred]") {
// cancellation is not an error
// cancellation is not an error
::
mi
::
set_done
(
out
);
::
mi
::
set_done
(
out
);
}
}
// I want to get rid of this signal it makes usage harder
// and messes up r-value qualifing done, error and value.
::
mi
::
set_stopping
(
out
);
});
});
});
});
});
});
...
@@ -173,7 +165,6 @@ SCENARIO("flow single cancellation trampoline", "[flow][deferred]") {
...
@@ -173,7 +165,6 @@ SCENARIO("flow single cancellation trampoline", "[flow][deferred]") {
mi
::
on_value
([
&
](
int
)
{
signals
+=
100
;
}),
mi
::
on_value
([
&
](
int
)
{
signals
+=
100
;
}),
mi
::
on_error
([
&
](
auto
)
noexcept
{
signals
+=
1000
;
}),
mi
::
on_error
([
&
](
auto
)
noexcept
{
signals
+=
1000
;
}),
mi
::
on_done
([
&
]()
{
signals
+=
1
;
}),
mi
::
on_done
([
&
]()
{
signals
+=
1
;
}),
mi
::
on_stopping
([
&
]()
{
signals
+=
10000
;
}),
// stop producer before it is scheduled to run
// stop producer before it is scheduled to run
mi
::
on_starting
([
&
](
auto
up
)
{
mi
::
on_starting
([
&
](
auto
up
)
{
signals
+=
10
;
signals
+=
10
;
...
@@ -183,8 +174,8 @@ SCENARIO("flow single cancellation trampoline", "[flow][deferred]") {
...
@@ -183,8 +174,8 @@ SCENARIO("flow single cancellation trampoline", "[flow][deferred]") {
}));
}));
THEN
(
THEN
(
"the starting, up.done
, out.done and out.stopping
signals are each recorded once"
)
{
"the starting, up.done
and out.done
signals are each recorded once"
)
{
REQUIRE
(
signals
==
1
1
0011
);
REQUIRE
(
signals
==
10011
);
}
}
}
}
...
@@ -194,7 +185,6 @@ SCENARIO("flow single cancellation trampoline", "[flow][deferred]") {
...
@@ -194,7 +185,6 @@ SCENARIO("flow single cancellation trampoline", "[flow][deferred]") {
mi
::
on_value
([
&
](
int
)
{
signals
+=
100
;
}),
mi
::
on_value
([
&
](
int
)
{
signals
+=
100
;
}),
mi
::
on_error
([
&
](
auto
)
noexcept
{
signals
+=
1000
;
}),
mi
::
on_error
([
&
](
auto
)
noexcept
{
signals
+=
1000
;
}),
mi
::
on_done
([
&
]()
{
signals
+=
1
;
}),
mi
::
on_done
([
&
]()
{
signals
+=
1
;
}),
mi
::
on_stopping
([
&
]()
{
signals
+=
10000
;
}),
// do not stop producer before it is scheduled to run
// do not stop producer before it is scheduled to run
mi
::
on_starting
([
&
](
auto
up
)
{
mi
::
on_starting
([
&
](
auto
up
)
{
signals
+=
10
;
signals
+=
10
;
...
@@ -205,8 +195,8 @@ SCENARIO("flow single cancellation trampoline", "[flow][deferred]") {
...
@@ -205,8 +195,8 @@ SCENARIO("flow single cancellation trampoline", "[flow][deferred]") {
}));
}));
THEN
(
THEN
(
"the starting, up.done
, out.value and out.stopping
signals are each recorded once"
)
{
"the starting, up.done
and out.value
signals are each recorded once"
)
{
REQUIRE
(
signals
==
1
1
0110
);
REQUIRE
(
signals
==
10110
);
}
}
}
}
}
}
...
@@ -248,11 +238,11 @@ SCENARIO("flow single cancellation new thread", "[flow][deferred]") {
...
@@ -248,11 +238,11 @@ SCENARIO("flow single cancellation new thread", "[flow][deferred]") {
auto
up
=
mi
::
MAKE
(
none
)(
auto
up
=
mi
::
MAKE
(
none
)(
Data
{
std
::
move
(
tokens
.
second
)},
Data
{
std
::
move
(
tokens
.
second
)},
[
&
](
auto
&
data
,
auto
e
)
noexcept
{
[
&
](
auto
&
data
,
auto
e
)
noexcept
{
signals
+=
100000
0
;
signals
+=
100000
;
data
.
stopper
.
t
(
data
.
stopper
);
data
.
stopper
.
t
(
data
.
stopper
);
},
},
[
&
](
auto
&
data
)
{
[
&
](
auto
&
data
)
{
signals
+=
10000
0
;
signals
+=
10000
;
data
.
stopper
.
t
(
data
.
stopper
);
data
.
stopper
.
t
(
data
.
stopper
);
});
});
...
@@ -278,9 +268,6 @@ SCENARIO("flow single cancellation new thread", "[flow][deferred]") {
...
@@ -278,9 +268,6 @@ SCENARIO("flow single cancellation new thread", "[flow][deferred]") {
// cancellation is not an error
// cancellation is not an error
::
mi
::
set_done
(
out
);
::
mi
::
set_done
(
out
);
}
}
// I want to get rid of this signal it makes usage harder
// and messes up r-value qualifing done, error and value.
::
mi
::
set_stopping
(
out
);
});
});
});
});
});
});
...
@@ -291,7 +278,6 @@ SCENARIO("flow single cancellation new thread", "[flow][deferred]") {
...
@@ -291,7 +278,6 @@ SCENARIO("flow single cancellation new thread", "[flow][deferred]") {
mi
::
on_value
([
&
](
int
)
{
signals
+=
100
;
}),
mi
::
on_value
([
&
](
int
)
{
signals
+=
100
;
}),
mi
::
on_error
([
&
](
auto
)
noexcept
{
signals
+=
1000
;
}),
mi
::
on_error
([
&
](
auto
)
noexcept
{
signals
+=
1000
;
}),
mi
::
on_done
([
&
]()
{
signals
+=
1
;
}),
mi
::
on_done
([
&
]()
{
signals
+=
1
;
}),
mi
::
on_stopping
([
&
]()
{
signals
+=
10000
;
}),
// stop producer before it is scheduled to run
// stop producer before it is scheduled to run
mi
::
on_starting
([
&
](
auto
up
)
{
mi
::
on_starting
([
&
](
auto
up
)
{
signals
+=
10
;
signals
+=
10
;
...
@@ -303,8 +289,8 @@ SCENARIO("flow single cancellation new thread", "[flow][deferred]") {
...
@@ -303,8 +289,8 @@ SCENARIO("flow single cancellation new thread", "[flow][deferred]") {
}));
}));
THEN
(
THEN
(
"the starting, up.done
, out.done and out.stopping
signals are each recorded once"
)
{
"the starting, up.done
and out.done
signals are each recorded once"
)
{
REQUIRE
(
signals
==
1
1
0011
);
REQUIRE
(
signals
==
10011
);
}
}
}
}
...
@@ -314,7 +300,6 @@ SCENARIO("flow single cancellation new thread", "[flow][deferred]") {
...
@@ -314,7 +300,6 @@ SCENARIO("flow single cancellation new thread", "[flow][deferred]") {
mi
::
on_value
([
&
](
int
)
{
signals
+=
100
;
}),
mi
::
on_value
([
&
](
int
)
{
signals
+=
100
;
}),
mi
::
on_error
([
&
](
auto
)
noexcept
{
signals
+=
1000
;
}),
mi
::
on_error
([
&
](
auto
)
noexcept
{
signals
+=
1000
;
}),
mi
::
on_done
([
&
]()
{
signals
+=
1
;
}),
mi
::
on_done
([
&
]()
{
signals
+=
1
;
}),
mi
::
on_stopping
([
&
]()
{
signals
+=
10000
;
}),
// do not stop producer before it is scheduled to run
// do not stop producer before it is scheduled to run
mi
::
on_starting
([
&
](
auto
up
)
{
mi
::
on_starting
([
&
](
auto
up
)
{
signals
+=
10
;
signals
+=
10
;
...
@@ -328,16 +313,16 @@ SCENARIO("flow single cancellation new thread", "[flow][deferred]") {
...
@@ -328,16 +313,16 @@ SCENARIO("flow single cancellation new thread", "[flow][deferred]") {
std
::
this_thread
::
sleep_for
(
100ms
);
std
::
this_thread
::
sleep_for
(
100ms
);
THEN
(
THEN
(
"the starting, up.done
, out.value and out.stopping
signals are each recorded once"
)
{
"the starting, up.done
and out.value
signals are each recorded once"
)
{
REQUIRE
(
signals
==
1
1
0110
);
REQUIRE
(
signals
==
10110
);
}
}
}
}
WHEN
(
"submit is applied and cancels the producer at the same time"
)
{
WHEN
(
"submit is applied and cancels the producer at the same time"
)
{
// count known results
// count known results
int
total
=
0
;
int
total
=
0
;
int
cancellostrace
=
0
;
// 1
1
0110
int
cancellostrace
=
0
;
// 10110
int
cancelled
=
0
;
// 1
1
0011
int
cancelled
=
0
;
// 10011
for
(;;)
{
for
(;;)
{
signals
=
0
;
signals
=
0
;
...
@@ -348,7 +333,6 @@ SCENARIO("flow single cancellation new thread", "[flow][deferred]") {
...
@@ -348,7 +333,6 @@ SCENARIO("flow single cancellation new thread", "[flow][deferred]") {
mi
::
on_value
([
&
](
int
)
{
signals
+=
100
;
}),
mi
::
on_value
([
&
](
int
)
{
signals
+=
100
;
}),
mi
::
on_error
([
&
](
auto
)
noexcept
{
signals
+=
1000
;
}),
mi
::
on_error
([
&
](
auto
)
noexcept
{
signals
+=
1000
;
}),
mi
::
on_done
([
&
]()
{
signals
+=
1
;
}),
mi
::
on_done
([
&
]()
{
signals
+=
1
;
}),
mi
::
on_stopping
([
&
]()
{
signals
+=
10000
;
}),
// stop producer at the same time that it is scheduled to run
// stop producer at the same time that it is scheduled to run
mi
::
on_starting
([
&
](
auto
up
)
{
mi
::
on_starting
([
&
](
auto
up
)
{
signals
+=
10
;
signals
+=
10
;
...
@@ -362,8 +346,8 @@ SCENARIO("flow single cancellation new thread", "[flow][deferred]") {
...
@@ -362,8 +346,8 @@ SCENARIO("flow single cancellation new thread", "[flow][deferred]") {
// accumulate known signals
// accumulate known signals
++
total
;
++
total
;
cancellostrace
+=
signals
==
1
1
0110
;
cancellostrace
+=
signals
==
10110
;
cancelled
+=
signals
==
1
1
0011
;
cancelled
+=
signals
==
10011
;
if
(
total
!=
cancellostrace
+
cancelled
)
{
if
(
total
!=
cancellostrace
+
cancelled
)
{
// display the unrecognized signals recorded
// display the unrecognized signals recorded
...
@@ -376,7 +360,7 @@ SCENARIO("flow single cancellation new thread", "[flow][deferred]") {
...
@@ -376,7 +360,7 @@ SCENARIO("flow single cancellation new thread", "[flow][deferred]") {
<<
", cancelled "
<<
cancelled
);
<<
", cancelled "
<<
cancelled
);
break
;
break
;
}
}
if
(
!!
cancellostrace
&&
!!
cancelled
)
{
if
(
cancellostrace
>
4
&&
cancelled
>
4
)
{
// yay all known outcomes were observed!
// yay all known outcomes were observed!
break
;
break
;
}
}
...
...
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