13 #include <FMEThirdPartyWarningsDisable.h>
15 #include <FMEThirdPartyWarningsRestore.h>
19 template<
typename... Args>
60 template<
typename... Args>
70 ProcessorConnection(std::shared_ptr<Source>
source, std::shared_ptr<Target>
target, std::unique_ptr<ExecutionPolicy> execution_policy,
bool mute_until_target_execution_finished =
false)
71 : policy(std::move(execution_policy))
74 auto handle = guard.handle();
75 if (mute_until_target_execution_finished) {
77 auto lock = handle.lock();
80 if (isSynchronousExecution) {
84 policy->execute([
target, skip_until_finished, args...]{
85 target->execute(args...);
92 connection =
source->signal.connect([
this, handle,
target](
const Args&... args) {
93 auto lock = handle.lock();
95 if (isSynchronousExecution) {
99 policy->execute([
target, args...]{
100 target->execute(args...);
120 std::unique_ptr<ExecutionPolicy> policy;
121 bool isSynchronousExecution;
Abstract base class for a connection between two I/O processors.
ProcessorConnection()=default
ProcessorConnection(std::shared_ptr< Source > source, std::shared_ptr< Target > target, std::unique_ptr< ExecutionPolicy > execution_policy, bool mute_until_target_execution_finished=false)
A guard that protects resources of a given class from being detroyed if another thread still works wi...
An synchronous execution policy.
boost::signals2::scoped_connection ScopedSignalConnection
boost::signals2::connection SignalConnection
boost::signals2::shared_connection_block SharedSignalConnectionBlock
ml_vertex_id_map get(vertex_index_t, ml_graph_ptr g)
get() function for vertex id property map vertex_index_t just necessary for overloading
boost::graph_traits< ml_graph_ptr >::vertex_descriptor source(graph_traits< ml_graph_ptr >::edge_descriptor e, const ml_graph_ptr)
Returns the vertex descriptor for u of the edge (u,v) represented by e.
boost::graph_traits< ml_graph_ptr >::vertex_descriptor target(graph_traits< ml_graph_ptr >::edge_descriptor e, const ml_graph_ptr)
Returns the vertex descriptor for v of the edge (u,v) represented by e.