diff --git a/src/voy/CMakeLists.txt b/src/voy/CMakeLists.txt index 5f71f83..e527b7a 100644 --- a/src/voy/CMakeLists.txt +++ b/src/voy/CMakeLists.txt @@ -1,16 +1,13 @@ set ( VOY_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE ) set ( VOY_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/engine/asio/service.cpp" PARENT_SCOPE ) -message ("Voy source dir: ${VOY_SOURCE_DIR}") -message ("Voy sources: ${VOY_SOURCES}") - diff --git a/src/voy/dsl/multiprocess.h b/src/voy/dsl/multiprocess.h index b62f324..ec68398 100644 --- a/src/voy/dsl/multiprocess.h +++ b/src/voy/dsl/multiprocess.h @@ -1,197 +1,208 @@ /* * Copyright (C) 2018 Ivan Čukić * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) version 3, or any * later version accepted by the membership of KDE e.V. (or its * successor approved by the membership of KDE e.V.), which shall * act as a proxy defined in Section 6 of version 3 of the license. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. * If not, see . */ #ifndef VOY_DSL_MULTIPROCESS_H #define VOY_DSL_MULTIPROCESS_H #include "../operations/identity.h" #include "../dsl.h" namespace voy::dsl { namespace detail { template struct pipeline_container { template pipeline_container(LeftTuple&& left, RightTuple&& right) : m_pipelines{std::tuple_cat(voy_fwd(left), voy_fwd(right))} { } template pipeline_container(Tuple&& tuple) : m_pipelines{std::move(tuple)} { } pipeline_container() { } template auto operator|| (NewPipeline&& new_pipeline) && { if constexpr (std::is_same_v) { return pipeline_container( std::move(m_pipelines), std::make_tuple(voy_fwd(new_pipeline))); } else { return pipeline_container( std::move(m_pipelines)); } } std::tuple m_pipelines; }; inline auto multiprocess_pipeline() { return pipeline_container<>{}; } template < typename Left > voy_concept supports_double_pipeline(Left* = nullptr) { if constexpr (std::is_same_v) { return true; } else if constexpr (node_traits::is_connection_expr) { return true; } else if constexpr (node_traits::is_node) { return true; } else { return false; } } } // namespace detail template < typename Left , typename Right , voy_require( detail::supports_double_pipeline() ) > auto operator||(Left&& left, Right&& right) { return voy::dsl::detail::multiprocess_pipeline() || voy_fwd(left) || voy_fwd(right); } } // namespace voy::dsl #define voy_declare_bridge_out(BridgeName) \ auto BridgeName##_send() \ { \ using namespace voy::zmq; \ return publisher<>(ipc(#BridgeName)); \ } \ \ auto BridgeName##_receive() \ { \ return voy::identity<>(); \ } #define voy_declare_bridge_in(BridgeName) \ auto BridgeName##_send() \ { \ return voy::identity<>(); \ } \ \ auto BridgeName##_receive() \ { \ using namespace voy::zmq; \ return subscriber<>(ipc(#BridgeName)); \ } #define voy_declare_bridge_spread(BridgeName) \ auto BridgeName##_send() \ { \ using namespace voy::zmq; \ return publisher(ipc(#BridgeName)); \ } \ \ auto BridgeName##_receive() \ { \ return voy::identity<>(); \ } #define voy_declare_bridge_accept(BridgeName) \ auto BridgeName##_send() \ { \ return voy::identity<>(); \ } \ \ auto BridgeName##_receive() \ { \ using namespace voy::zmq; \ return subscriber(ipc(#BridgeName)); \ } #define voy_declare_bridge_post(BridgeName) \ auto BridgeName##_send() \ { \ using namespace voy::zmq; \ return publisher(ipc(#BridgeName)); \ } \ \ auto BridgeName##_receive() \ { \ return voy::identity<>(); \ } #define voy_declare_bridge_collect(BridgeName) \ auto BridgeName##_send() \ { \ return voy::identity<>(); \ } \ \ auto BridgeName##_receive() \ { \ using namespace voy::zmq; \ return subscriber(ipc(#BridgeName)); \ } #define voy_declare_bridge_ignored(BridgeName) \ auto BridgeName##_send() \ { \ return voy::identity<>(); \ } \ \ auto BridgeName##_receive() \ { \ return voy::identity<>(); \ } +#define voy_declare_bridge_ignored(BridgeName) \ + auto BridgeName##_send() \ + { \ + return voy::identity<>(); \ + } \ + \ + auto BridgeName##_receive() \ + { \ + return voy::identity<>(); \ + } + #define voy_bridge(BridgeName) BridgeName##_send() || BridgeName##_receive() #define voy_multiprocess voy::dsl::multiprocess_pipeline() || #endif // include guard