├── .gitattributes ├── CMakeLists.txt ├── CTestConfig.cmake ├── LICENSE ├── README.md ├── cmake ├── snippets │ ├── boost_tests.cmake │ ├── configuration.cmake │ ├── depends.cmake │ ├── dist.cmake │ ├── flags-gnu.cmake │ ├── flags-msvc.cmake │ ├── flags.cmake │ ├── groups.cmake │ ├── hooks.cmake │ ├── python.cmake │ └── version.cmake └── support │ ├── doxygen.cmake │ ├── pkgconfig.cmake │ └── test.cmake ├── conf ├── .gitattributes ├── CMakeLists.txt ├── CTestCustom.cmake.in ├── dashboard.ctest.in ├── sprokit-config-build.cmake.in ├── sprokit-config-common.cmake.in ├── sprokit-config-install.cmake.in ├── sprokit-macro-configure.cmake ├── sprokit-macro-fixes.cmake ├── sprokit-macro-python.cmake ├── sprokit-macro-targets.cmake ├── sprokit-macro-tests.cmake └── sprokit.pc.in ├── extra ├── .gitattributes ├── CMakeLists.txt ├── dist │ └── snap-script.cmake ├── doxygen │ ├── Doxyfile.common.in │ ├── Doxyfile.in │ └── Doxyfile.tag.in └── vim │ ├── CMakeLists.txt │ └── pipe.vim ├── src ├── CMakeLists.txt ├── bindings │ ├── CMakeLists.txt │ └── python │ │ ├── CMakeLists.txt │ │ ├── modules │ │ ├── CMakeLists.txt │ │ ├── loaders.py │ │ ├── modules-config.h │ │ ├── modules.py │ │ ├── registration.cxx │ │ └── registration.h │ │ ├── processes │ │ ├── CMakeLists.txt │ │ └── test │ │ │ ├── CMakeLists.txt │ │ │ ├── __init__.py │ │ │ └── examples.py │ │ ├── schedulers │ │ ├── CMakeLists.txt │ │ └── examples │ │ │ ├── CMakeLists.txt │ │ │ ├── __init__.py │ │ │ └── pythread_per_process_scheduler.py │ │ ├── sprokit │ │ ├── CMakeLists.txt │ │ ├── pipeline │ │ │ ├── CMakeLists.txt │ │ │ ├── config.cxx │ │ │ ├── datum.cxx │ │ │ ├── edge.cxx │ │ │ ├── modules.cxx │ │ │ ├── pipeline.cxx │ │ │ ├── process.cxx │ │ │ ├── process_cluster.cxx │ │ │ ├── process_registry.cxx │ │ │ ├── scheduler.cxx │ │ │ ├── scheduler_registry.cxx │ │ │ ├── stamp.cxx │ │ │ ├── utils.cxx │ │ │ └── version.cxx │ │ └── pipeline_util │ │ │ ├── CMakeLists.txt │ │ │ ├── bake.cxx │ │ │ ├── export.cxx │ │ │ └── load.cxx │ │ └── test │ │ ├── .NoDartCoverage │ │ ├── CMakeLists.txt │ │ ├── python │ │ ├── CMakeLists.txt │ │ └── modules │ │ │ ├── CMakeLists.txt │ │ │ └── extras.py │ │ └── test.py ├── fixes │ ├── CMakeLists.txt │ ├── exceptions_in_override │ │ └── boost │ │ │ └── python │ │ │ └── override.hpp │ ├── python.cmake │ ├── threading │ │ └── boost │ │ │ └── python │ │ │ ├── converter │ │ │ ├── shared_ptr_from_python.hpp │ │ │ ├── shared_ptr_to_python.hpp │ │ │ └── threaded_shared_ptr_deleter.hpp │ │ │ └── detail │ │ │ └── invoke.hpp │ ├── tools.cmake │ └── value_name │ │ └── boost │ │ └── program_options │ │ └── value_semantic.hpp ├── processes │ ├── CMakeLists.txt │ ├── clusters │ │ ├── CMakeLists.txt │ │ ├── cluster-paths.h.in │ │ ├── clusters-config.h │ │ ├── registration.cxx │ │ └── registration.h │ ├── examples │ │ ├── .NoDartCoverage │ │ ├── CMakeLists.txt │ │ ├── any_source_process.cxx │ │ ├── any_source_process.h │ │ ├── const_number_process.cxx │ │ ├── const_number_process.h │ │ ├── const_process.cxx │ │ ├── const_process.h │ │ ├── data_dependent_process.cxx │ │ ├── data_dependent_process.h │ │ ├── duplicate_process.cxx │ │ ├── duplicate_process.h │ │ ├── examples-config.h │ │ ├── expect_process.cxx │ │ ├── expect_process.h │ │ ├── feedback_process.cxx │ │ ├── feedback_process.h │ │ ├── flow_dependent_process.cxx │ │ ├── flow_dependent_process.h │ │ ├── multiplication_process.cxx │ │ ├── multiplication_process.h │ │ ├── multiplier_cluster.cxx │ │ ├── multiplier_cluster.h │ │ ├── mutate_process.cxx │ │ ├── mutate_process.h │ │ ├── number_process.cxx │ │ ├── number_process.h │ │ ├── orphan_cluster.cxx │ │ ├── orphan_cluster.h │ │ ├── orphan_process.cxx │ │ ├── orphan_process.h │ │ ├── print_number_process.cxx │ │ ├── print_number_process.h │ │ ├── registration.cxx │ │ ├── registration.h │ │ ├── shared_process.cxx │ │ ├── shared_process.h │ │ ├── skip_process.cxx │ │ ├── skip_process.h │ │ ├── tagged_flow_dependent_process.cxx │ │ ├── tagged_flow_dependent_process.h │ │ ├── take_number_process.cxx │ │ ├── take_number_process.h │ │ ├── take_string_process.cxx │ │ ├── take_string_process.h │ │ ├── tunable_process.cxx │ │ └── tunable_process.h │ ├── flow │ │ ├── CMakeLists.txt │ │ ├── collate_process.cxx │ │ ├── collate_process.h │ │ ├── distribute_process.cxx │ │ ├── distribute_process.h │ │ ├── flow-config.h │ │ ├── pass_process.cxx │ │ ├── pass_process.h │ │ ├── registration.cxx │ │ ├── registration.h │ │ ├── sink_process.cxx │ │ └── sink_process.h │ └── helpers │ │ ├── CMakeLists.txt │ │ └── functions │ │ ├── CMakeLists.txt │ │ ├── function_process.h │ │ ├── function_process_impl.h │ │ └── function_process_register.h ├── schedulers │ ├── CMakeLists.txt │ └── examples │ │ ├── CMakeLists.txt │ │ ├── examples-config.h │ │ ├── registration.cxx │ │ ├── registration.h │ │ ├── sync_scheduler.cxx │ │ ├── sync_scheduler.h │ │ ├── thread_per_process_scheduler.cxx │ │ ├── thread_per_process_scheduler.h │ │ ├── thread_pool_scheduler.cxx │ │ └── thread_pool_scheduler.h ├── sprokit │ ├── .gitattributes │ ├── CMakeLists.txt │ ├── config.h.in │ ├── pipeline │ │ ├── CMakeLists.txt │ │ ├── config.cxx │ │ ├── config.h │ │ ├── datum.cxx │ │ ├── datum.h │ │ ├── doc │ │ │ ├── design.dox │ │ │ ├── examples │ │ │ │ └── how_to_process.cxx.ex │ │ │ ├── glossary.dox │ │ │ ├── how_to.dox │ │ │ ├── how_to_process.dox │ │ │ ├── new_pipeline.dox │ │ │ └── porting.dox │ │ ├── edge.cxx │ │ ├── edge.h │ │ ├── edge_exception.cxx │ │ ├── edge_exception.h │ │ ├── module-paths.h.in │ │ ├── modules.cxx │ │ ├── modules.h │ │ ├── pipeline-config.h │ │ ├── pipeline.cxx │ │ ├── pipeline.h │ │ ├── pipeline_exception.cxx │ │ ├── pipeline_exception.h │ │ ├── process.cxx │ │ ├── process.h │ │ ├── process_cluster.cxx │ │ ├── process_cluster.h │ │ ├── process_cluster_exception.cxx │ │ ├── process_cluster_exception.h │ │ ├── process_exception.cxx │ │ ├── process_exception.h │ │ ├── process_registry.cxx │ │ ├── process_registry.h │ │ ├── process_registry_exception.cxx │ │ ├── process_registry_exception.h │ │ ├── scheduler.cxx │ │ ├── scheduler.h │ │ ├── scheduler_exception.cxx │ │ ├── scheduler_exception.h │ │ ├── scheduler_registry.cxx │ │ ├── scheduler_registry.h │ │ ├── scheduler_registry_exception.cxx │ │ ├── scheduler_registry_exception.h │ │ ├── sprokit-pipeline.pc.in │ │ ├── stamp.cxx │ │ ├── stamp.h │ │ ├── thread_naming.cmake │ │ ├── types.cxx │ │ ├── types.h │ │ ├── utils.cxx │ │ ├── utils.h │ │ ├── version.cxx │ │ └── version.h │ ├── pipeline_util │ │ ├── CMakeLists.txt │ │ ├── doc │ │ │ ├── pipeline_declaration.dox │ │ │ └── pipeline_util.dox │ │ ├── export_dot.cxx │ │ ├── export_dot.h │ │ ├── export_dot_exception.cxx │ │ ├── export_dot_exception.h │ │ ├── include-paths.h.in │ │ ├── load_pipe.cxx │ │ ├── load_pipe.h │ │ ├── load_pipe_exception.cxx │ │ ├── load_pipe_exception.h │ │ ├── path.h │ │ ├── pipe_bakery.cxx │ │ ├── pipe_bakery.h │ │ ├── pipe_bakery_exception.cxx │ │ ├── pipe_bakery_exception.h │ │ ├── pipe_declaration_types.h │ │ ├── pipe_grammar.cxx │ │ ├── pipe_grammar.h │ │ ├── pipeline_util-config.h │ │ ├── providers.cxx │ │ ├── providers.h │ │ └── sprokit-pipeline_util.pc.in │ ├── python │ │ ├── CMakeLists.txt │ │ ├── any_conversion │ │ │ ├── CMakeLists.txt │ │ │ ├── any_conversion-config.h │ │ │ ├── prototypes.h │ │ │ ├── registration.cxx │ │ │ ├── registration.h │ │ │ └── sprokit-python_any_conversion.pc.in │ │ └── util │ │ │ ├── CMakeLists.txt │ │ │ ├── pystream.cxx │ │ │ ├── pystream.h │ │ │ ├── python_allow_threads.cxx │ │ │ ├── python_allow_threads.h │ │ │ ├── python_convert_optional.h │ │ │ ├── python_exceptions.cxx │ │ │ ├── python_exceptions.h │ │ │ ├── python_gil.cxx │ │ │ ├── python_gil.h │ │ │ ├── python_threading.cxx │ │ │ ├── python_threading.h │ │ │ ├── python_wrap_const_shared_ptr.h │ │ │ ├── set_indexing_suite.h │ │ │ ├── sprokit-python_util.pc.in │ │ │ └── util-config.h │ ├── scoring │ │ ├── CMakeLists.txt │ │ ├── scoring-config.h │ │ ├── sprokit-scoring.pc.in │ │ ├── statistics.cxx │ │ └── statistics.h │ ├── tools │ │ ├── CMakeLists.txt │ │ ├── literal_pipeline.h │ │ ├── pipeline_builder.cxx │ │ ├── pipeline_builder.h │ │ ├── sprokit-tools.pc.in │ │ ├── tool_io.cxx │ │ ├── tool_io.h │ │ ├── tool_main.h │ │ ├── tool_usage.cxx │ │ ├── tool_usage.h │ │ └── tools-config.h │ └── version.h.in └── tools │ ├── CMakeLists.txt │ ├── pipe_config.cxx │ ├── pipe_to_dot.cxx │ ├── pipeline_runner.cxx │ ├── pipelines │ ├── CMakeLists.txt │ ├── clusters │ │ └── CMakeLists.txt │ └── include │ │ └── CMakeLists.txt │ └── processopedia.cxx └── tests ├── .NoDartCoverage ├── CMakeLists.txt ├── bindings ├── CMakeLists.txt └── python │ ├── CMakeLists.txt │ ├── modules │ ├── CMakeLists.txt │ ├── sprokit │ │ ├── processes │ │ │ ├── __init__.py │ │ │ └── pythonpath_test_process.py │ │ └── schedulers │ │ │ ├── __init__.py │ │ │ └── pythonpath_test_scheduler.py │ └── test-pymodules.py │ ├── sprokit │ ├── CMakeLists.txt │ ├── pipeline │ │ ├── CMakeLists.txt │ │ ├── test-config.py │ │ ├── test-datum.py │ │ ├── test-edge.py │ │ ├── test-modules.py │ │ ├── test-pipeline.py │ │ ├── test-process.py │ │ ├── test-process_cluster.py │ │ ├── test-process_registry.py │ │ ├── test-run.py │ │ ├── test-scheduler.py │ │ ├── test-scheduler_registry.py │ │ ├── test-stamp.py │ │ ├── test-utils.py │ │ └── test-version.py │ └── pipeline_util │ │ ├── CMakeLists.txt │ │ ├── test-bake.py │ │ ├── test-export_.py │ │ └── test-load.py │ └── test │ ├── CMakeLists.txt │ └── test-test.py ├── data ├── pipelines │ ├── cluster_all.pipe │ ├── cluster_config.pipe │ ├── cluster_configuration_default.pipe │ ├── cluster_configuration_provide.pipe │ ├── cluster_declare.pipe │ ├── cluster_duplicate_input.pipe │ ├── cluster_duplicate_output.pipe │ ├── cluster_empty_name.pipe │ ├── cluster_input_map.pipe │ ├── cluster_input_map_with_slash.pipe │ ├── cluster_input_multi_map.pipe │ ├── cluster_map_config.pipe │ ├── cluster_map_config_modified.pipe │ ├── cluster_map_config_not_from_cluster.pipe │ ├── cluster_map_config_not_read_only.pipe │ ├── cluster_map_config_only_conf_provided.pipe │ ├── cluster_map_config_only_provided.pipe │ ├── cluster_map_config_redirect.pipe │ ├── cluster_map_config_to_non_process.pipe │ ├── cluster_map_config_tunable.pipe │ ├── cluster_mappings.pipe │ ├── cluster_missing_config_description.pipe │ ├── cluster_missing_input_description.pipe │ ├── cluster_missing_output_description.pipe │ ├── cluster_missing_ports.pipe │ ├── cluster_missing_processes.pipe │ ├── cluster_missing_type.pipe │ ├── cluster_missing_type_description.pipe │ ├── cluster_multiple_clusters.pipe │ ├── cluster_multiplier.pipe │ ├── cluster_not_first.pipe │ ├── cluster_output_map.pipe │ ├── cluster_output_map_with_slash.pipe │ ├── cluster_override_mapped.pipe │ ├── cluster_with_slash.pipe │ ├── comments.pipe │ ├── config_append.pipe │ ├── config_append_comma.pipe │ ├── config_append_comma_empty.pipe │ ├── config_append_flag_mismatch_ac.pipe │ ├── config_append_flag_mismatch_all.pipe │ ├── config_append_flag_mismatch_ap.pipe │ ├── config_append_flag_mismatch_cp.pipe │ ├── config_append_path.pipe │ ├── config_append_path_empty.pipe │ ├── config_append_provided.pipe │ ├── config_append_provided_ro.pipe │ ├── config_append_ro.pipe │ ├── config_append_space.pipe │ ├── config_append_space_empty.pipe │ ├── config_block.pipe │ ├── config_block_notalnum.pipe │ ├── config_dotted_key.pipe │ ├── config_dotted_nested_key.pipe │ ├── config_not_a_flag.pipe │ ├── config_overrides.pipe │ ├── config_provider_conf.pipe │ ├── config_provider_conf_circular_dep.pipe │ ├── config_provider_conf_dep.pipe │ ├── config_provider_env.pipe │ ├── config_provider_read_only.pipe │ ├── config_provider_read_only_override.pipe │ ├── config_provider_unprovided.pipe │ ├── config_read_only.pipe │ ├── config_read_only_override.pipe │ ├── config_value_spaces.pipe │ ├── connect_input_with_slash.pipe │ ├── connect_output_with_slash.pipe │ ├── connected_processes.pipe │ ├── connected_processes_notalnum.pipe │ ├── empty.pipe │ ├── empty_config.pipe │ ├── include.pipe │ ├── include_no_exist.pipe │ ├── include_not_a_file.pipe │ ├── no_parse.pipe │ ├── not_a_file.pipe │ │ └── dummy │ ├── one_process.pipe │ ├── parse_error.pipe │ ├── pipeline_multiplier.pipe │ ├── pipeline_setup_no_setup.pipe │ ├── pipeline_setup_no_success.pipe │ ├── process_with_slash.pipe │ ├── simple_pipeline.pipe │ ├── simple_pipeline_cluster.pipe │ └── simple_pipeline_setup.pipe └── valgrind │ ├── boost.supp │ ├── glibc.supp │ └── python2.7.supp ├── sprokit ├── CMakeLists.txt ├── pipeline │ ├── CMakeLists.txt │ ├── not_a_plugin.cxx │ ├── processes_test.cxx │ ├── schedulers_test.cxx │ ├── test_config.cxx │ ├── test_datum.cxx │ ├── test_edge.cxx │ ├── test_modules.cxx │ ├── test_pipeline.cxx │ ├── test_process.cxx │ ├── test_process_cluster.cxx │ ├── test_process_introspection.cxx │ ├── test_process_registry.cxx │ ├── test_run.cxx │ ├── test_scheduler.cxx │ ├── test_scheduler_introspection.cxx │ ├── test_scheduler_registry.cxx │ └── test_stamp.cxx ├── pipeline_util │ ├── CMakeLists.txt │ ├── include_test.pipe │ ├── test_export_dot.cxx │ ├── test_load_pipe.cxx │ └── test_pipe_bakery.cxx └── test │ ├── CMakeLists.txt │ ├── test_dlopen.cxx │ └── test_test.cxx └── test_common.h /.gitattributes: -------------------------------------------------------------------------------- 1 | *.h hooks.checkcopyright diff=cpp 2 | *.h.in hooks.checkcopyright diff=cpp 3 | *.cxx hooks.checkcopyright diff=cpp 4 | *.txx hooks.checkcopyright diff=cpp 5 | *.py hooks.checkcopyright diff=python 6 | *.in hooks.checkcopyright 7 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit) 2 | 3 | cmake_minimum_required(VERSION 2.8.8) 4 | 5 | option(SPROKIT_USE_BUILD_TREE "Whether the build tree should be used for default paths" ON) 6 | mark_as_advanced(SPROKIT_USE_BUILD_TREE) 7 | 8 | set(sprokit_source_dir "${CMAKE_CURRENT_SOURCE_DIR}") 9 | set(sprokit_binary_dir "${CMAKE_CURRENT_BINARY_DIR}") 10 | 11 | # Add the cmake directory for CMake modules. 12 | list(INSERT CMAKE_MODULE_PATH 0 13 | "${sprokit_source_dir}/cmake/modules") 14 | 15 | option(BUILD_SHARED_LIBS "Build shared libraries" ON) 16 | 17 | if (NOT IS_ABSOLUTE "${CMAKE_INSTALL_PREFIX}") 18 | message(FATAL_ERROR "Sprokit does not support a relative install prefix (${CMAKE_INSTALL_PREFIX}).") 19 | endif () 20 | 21 | include(CMakeDependentOption) 22 | 23 | set(sprokit_output_dir 24 | "${sprokit_binary_dir}") 25 | 26 | # Sprokit macros 27 | include("${sprokit_source_dir}/conf/sprokit-macro-configure.cmake") 28 | include("${sprokit_source_dir}/conf/sprokit-macro-targets.cmake") 29 | include("${sprokit_source_dir}/conf/sprokit-macro-python.cmake") 30 | 31 | # Support functions. 32 | include("${sprokit_source_dir}/cmake/support/pkgconfig.cmake") 33 | include("${sprokit_source_dir}/cmake/support/doxygen.cmake") 34 | 35 | find_package(Git) 36 | 37 | if (GIT_FOUND) 38 | if (IS_DIRECTORY "${sprokit_source_dir}/.git") 39 | set(sprokit_is_in_git ON) 40 | endif () 41 | endif () 42 | 43 | # Project setup. 44 | include("${sprokit_source_dir}/cmake/snippets/version.cmake") 45 | include("${sprokit_source_dir}/cmake/snippets/flags.cmake") 46 | include("${sprokit_source_dir}/cmake/snippets/configuration.cmake") 47 | include("${sprokit_source_dir}/cmake/snippets/groups.cmake") 48 | if (sprokit_is_in_git) 49 | include("${sprokit_source_dir}/cmake/snippets/dist.cmake") 50 | include("${sprokit_source_dir}/cmake/snippets/hooks.cmake") 51 | endif () 52 | 53 | # Dependencies. 54 | include("${sprokit_source_dir}/cmake/snippets/python.cmake") 55 | include("${sprokit_source_dir}/cmake/snippets/depends.cmake") 56 | 57 | set(export_name 58 | sprokit_exports) 59 | 60 | add_subdirectory(src) 61 | 62 | option(SPROKIT_ENABLE_EXTRAS "Enable extra files to help with tooling" OFF) 63 | if (SPROKIT_ENABLE_EXTRAS) 64 | add_subdirectory(extra) 65 | endif () 66 | 67 | option(SPROKIT_ENABLE_TESTING "Build tests" OFF) 68 | if (SPROKIT_ENABLE_TESTING) 69 | include(CTest) 70 | 71 | add_subdirectory(tests) 72 | endif () 73 | 74 | add_subdirectory(conf) 75 | -------------------------------------------------------------------------------- /CTestConfig.cmake: -------------------------------------------------------------------------------- 1 | set(CTEST_PROJECT_NAME "sprokit") 2 | set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") 3 | 4 | set(CTEST_DROP_METHOD "http") 5 | set(CTEST_DROP_SITE "open.cdash.org") 6 | set(CTEST_DROP_LOCATION "/submit.php?project=sprokit") 7 | set(CTEST_DROP_SITE_CDASH TRUE) 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2014 Kitware, Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither name of Kitware, Inc. nor the names of any contributors may be used 15 | to endorse or promote products derived from this software without specific 16 | prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 22 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /cmake/snippets/boost_tests.cmake: -------------------------------------------------------------------------------- 1 | set(cmakefiles_dir 2 | "${sprokit_binary_dir}/CMakeFiles") 3 | 4 | if (CMAKE_CROSSCOMPILING) 5 | set(BOOST_MANGLE_NAMESPACE "boost" CACHE STRING "The mangled boost namespace") 6 | else () 7 | set(boost_mangle_namespace_path 8 | "${cmakefiles_dir}/boost_mangle_namespace.cxx") 9 | file(WRITE "${boost_mangle_namespace_path}" 10 | " 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | #include 17 | 18 | int 19 | main() 20 | { 21 | #ifdef boost 22 | std::cout << BOOST_PP_STRINGIZE(boost) << std::endl; 23 | #else 24 | std::cout << \"boost\" << std::endl; 25 | #endif 26 | 27 | return EXIT_SUCCESS; 28 | } 29 | ") 30 | 31 | try_run(boost_mangle_namespace_run boost_mangle_namespace_compile 32 | "${sprokit_binary_dir}" 33 | "${boost_mangle_namespace_path}" 34 | CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${Boost_INCLUDE_DIRS}" 35 | RUN_OUTPUT_VARIABLE boost_detect_mangle_namespace) 36 | string(STRIP "${boost_detect_mangle_namespace}" boost_detect_mangle_namespace) 37 | # The mangled namespace is detected, so make the value INTERNAL to prevent 38 | # accidentally changing in in a GUI. 39 | set(BOOST_MANGLE_NAMESPACE "${boost_detect_mangle_namespace}" 40 | CACHE INTERNAL "The detected mangled boost namespace") 41 | endif () 42 | -------------------------------------------------------------------------------- /cmake/snippets/configuration.cmake: -------------------------------------------------------------------------------- 1 | # Add defines for code that care about configuration types. 2 | 3 | #add_compile_options( 4 | # "SPROKIT_CONFIGURATION=\"$\"" 5 | # "SPROKIT_CONFIGURATION_L=L\"$\"") 6 | 7 | # XXX(cmake): 2.8.12 8 | foreach (config IN LISTS CMAKE_CONFIGURATION_TYPES) 9 | string(TOUPPER "${config}" upper_config) 10 | 11 | set(config_defines 12 | "SPROKIT_CONFIGURATION=\"${config}\"" 13 | "SPROKIT_CONFIGURATION_L=L\"${config}\"") 14 | 15 | set_directory_properties( 16 | PROPERTIES 17 | COMPILE_DEFINITIONS_${upper_config} "${config_defines}") 18 | endforeach () 19 | -------------------------------------------------------------------------------- /cmake/snippets/depends.cmake: -------------------------------------------------------------------------------- 1 | # Find dependencies. 2 | 3 | ######################################## 4 | # Boost 5 | ######################################## 6 | 7 | set(sprokit_boost_version 1.47) 8 | 9 | if (SPROKIT_ENABLE_PYTHON) 10 | set(sprokit_boost_version 1.48) 11 | endif () 12 | 13 | # Required for Boost.Thread. 14 | find_package(Threads REQUIRED) 15 | 16 | option(Boost_USE_STATIC_LIBS "Use a statically-linked Boost" OFF) 17 | find_package(Boost ${sprokit_boost_version} REQUIRED 18 | COMPONENTS 19 | chrono 20 | date_time 21 | filesystem 22 | program_options 23 | system 24 | thread) 25 | 26 | include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) 27 | link_directories(${Boost_LIBRARY_DIRS}) 28 | 29 | if (WIN32) 30 | add_definitions(-DBOOST_ALL_NO_LIB) 31 | endif () 32 | 33 | include("${sprokit_source_dir}/cmake/snippets/boost_tests.cmake") 34 | -------------------------------------------------------------------------------- /cmake/snippets/dist.cmake: -------------------------------------------------------------------------------- 1 | add_custom_target(dist) 2 | add_custom_command( 3 | TARGET dist 4 | COMMAND "${GIT_EXECUTABLE}" 5 | archive 6 | --format=tar 7 | --prefix=sprokit-${sprokit_version}/ 8 | v${sprokit_version} | bzip2 > sprokit-${sprokit_version}.tar.bz2 9 | WORKING_DIRECTORY 10 | "${sprokit_source_dir}" 11 | COMMENT "Making a tarball of version ${sprokit_version}") 12 | 13 | add_custom_target(snap) 14 | add_custom_command( 15 | TARGET snap 16 | COMMAND "${CMAKE_COMMAND}" 17 | -D "sprokit_version=${sprokit_version}" 18 | -D "sprokit_source_dir=${sprokit_source_dir}" 19 | -D "sprokit_binary_dir=${sprokit_binary_dir}" 20 | -D "GIT_EXECUTABLE=${GIT_EXECUTABLE}" 21 | -P "${sprokit_source_dir}/extra/dist/snap-script.cmake" 22 | WORKING_DIRECTORY 23 | "${sprokit_source_dir}" 24 | COMMENT "Making a tarball for the current checkout") 25 | -------------------------------------------------------------------------------- /cmake/snippets/flags-msvc.cmake: -------------------------------------------------------------------------------- 1 | option(SPROKIT_ENABLE_DLLHELL_WARNINGS "Enables warnings about DLL visibility" OFF) 2 | if (NOT SPROKIT_ENABLE_DLLHELL_WARNINGS) 3 | # C4251: STL interface warnings 4 | sprokit_want_compiler_flag(/wd4251) 5 | # C4275: Inheritance warnings 6 | sprokit_want_compiler_flag(/wd4275) 7 | endif () 8 | 9 | option(SPROKIT_ENABLE_ANALYZE "Enables MSVC static analysis" OFF) 10 | if (SPROKIT_ENABLE_ANALYZE) 11 | sprokit_want_compiler_flag(/analyze) 12 | endif () 13 | 14 | sprokit_want_compiler_flag(/W3) 15 | 16 | # ----------------------------------------------------------------------------- 17 | # Disable deprecation warnings for standard C and STL functions in VS2005 and 18 | # later 19 | # ----------------------------------------------------------------------------- 20 | # XXX(msvc): 1400 21 | if (MSVC_VERSION GREATER 1400 OR 22 | MSVC_VERSION EQUAL 1400) 23 | add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) 24 | add_definitions(-D_CRT_SECURE_NO_WARNINGS) 25 | add_definitions(-D_SCL_SECURE_NO_DEPRECATE) 26 | endif () 27 | 28 | # Prevent namespace pollution. 29 | add_definitions(-DWIN32_LEAN_AND_MEAN) 30 | add_definitions(-DNOMINMAX) 31 | add_definitions(-DWINDOWS_EXTRA_LEAN) 32 | -------------------------------------------------------------------------------- /cmake/snippets/flags.cmake: -------------------------------------------------------------------------------- 1 | # Set up flags for the compiler. 2 | 3 | include(CheckCXXCompilerFlag) 4 | 5 | function (sprokit_add_flag flag) 6 | #if (ARGN) 7 | # string(REPLACE "," "$" genflag "${flag}") 8 | # string(REPLACE ";" "$" genflag "${genflag}") 9 | # string(REPLACE ">" "$" genflag "${genflag}") 10 | # foreach (config IN LISTS ARGN) 11 | # add_compile_options("$<$:${genflag}>") 12 | # endforeach () 13 | #else () 14 | # add_compile_options("${flag}") 15 | #endif () 16 | # XXX(cmake): 2.8.12 17 | if (ARGN) 18 | foreach (config IN LISTS ARGN) 19 | set_property(GLOBAL APPEND_STRING 20 | PROPERTY "sprokit_flags_${config}" 21 | " ${flag}") 22 | endforeach () 23 | else () 24 | set_property(GLOBAL APPEND_STRING 25 | PROPERTY sprokit_flags 26 | " ${flag}") 27 | endif () 28 | endfunction () 29 | 30 | function (sprokit_want_compiler_flag flag) 31 | string(REPLACE "+" "plus" safeflag "${flag}") 32 | 33 | check_cxx_compiler_flag("${flag}" "have_compiler_flag-${safeflag}") 34 | 35 | if ("have_compiler_flag-${safeflag}") 36 | sprokit_add_flag("${flag}" ${ARGN}) 37 | endif () 38 | endfunction () 39 | 40 | # XXX(cmake): 2.8.12 41 | foreach (config IN LISTS CMAKE_CONFIGURATION_TYPES) 42 | set_property(GLOBAL 43 | PROPERTY "sprokit_flags_${config}") 44 | endforeach () 45 | set_property(GLOBAL 46 | PROPERTY "sprokit_flags") 47 | 48 | if (MSVC) 49 | include("${CMAKE_CURRENT_LIST_DIR}/flags-msvc.cmake") 50 | else () 51 | # Assume GCC-compatible 52 | include("${CMAKE_CURRENT_LIST_DIR}/flags-gnu.cmake") 53 | endif () 54 | 55 | foreach (config IN LISTS CMAKE_CONFIGURATION_TYPES) 56 | get_property(sprokit_flags GLOBAL 57 | PROPERTY "sprokit_flags_${config}") 58 | string(TOUPPER "${config}" upper_config) 59 | set("CMAKE_CXX_FLAGS_${upper_config}" 60 | "${CMAKE_CXX_FLAGS_${upper_config}}${sprokit_flags}") 61 | endforeach () 62 | get_property(sprokit_flags GLOBAL 63 | PROPERTY sprokit_flags) 64 | set(CMAKE_CXX_FLAGS 65 | "${CMAKE_CXX_FLAGS}${sprokit_flags}") 66 | # XXX(cmake): 2.8.12 67 | if (CMAKE_CONFIGURATION_TYPES) 68 | foreach (config IN LISTS CMAKE_CONFIGURATION_TYPES) 69 | get_property(sprokit_flags GLOBAL 70 | PROPERTY "sprokit_flags_${config}") 71 | string(TOUPPER "${config}" upper_config) 72 | set("CMAKE_CXX_FLAGS_${upper_config}" 73 | "${CMAKE_CXX_FLAGS_${upper_config}}${sprokit_flags}") 74 | endforeach () 75 | else () 76 | get_property(sprokit_flags GLOBAL 77 | PROPERTY "sprokit_flags_${CMAKE_BUILD_TYPE}") 78 | set(CMAKE_CXX_FLAGS 79 | "${CMAKE_CXX_FLAGS}${sprokit_flags}") 80 | endif () 81 | -------------------------------------------------------------------------------- /cmake/snippets/groups.cmake: -------------------------------------------------------------------------------- 1 | # Set up source groups. 2 | 3 | source_group("Configured Files" 4 | REGULAR_EXPRESSION ".*\\.in$") 5 | source_group("Template Files" 6 | REGULAR_EXPRESSION ".*\\.txx$") 7 | -------------------------------------------------------------------------------- /cmake/snippets/hooks.cmake: -------------------------------------------------------------------------------- 1 | set(hooks_directory 2 | "${sprokit_source_dir}/.git/hooks") 3 | 4 | add_custom_command( 5 | OUTPUT "${hooks_directory}/.git" 6 | COMMAND "${GIT_EXECUTABLE}" 7 | init 8 | --quiet 9 | COMMAND "${GIT_EXECUTABLE}" 10 | config 11 | remote.origin.url 12 | ../.. 13 | COMMAND "${GIT_EXECUTABLE}" 14 | config 15 | remote.origin.fetch 16 | +refs/heads/hooks:refs/remotes/origin/hooks 17 | WORKING_DIRECTORY 18 | "${hooks_directory}" 19 | COMMENT "Initializing the hooks repository") 20 | add_custom_target(hooks-init 21 | DEPENDS 22 | "${hooks_directory}/.git") 23 | 24 | add_custom_target(hooks-update ALL 25 | DEPENDS 26 | hooks-init) 27 | add_custom_command( 28 | TARGET hooks-update 29 | COMMAND "${GIT_EXECUTABLE}" 30 | fetch 31 | --quiet 32 | origin 33 | remotes/origin/hooks 34 | COMMAND "${GIT_EXECUTABLE}" 35 | merge 36 | --quiet 37 | FETCH_HEAD 38 | WORKING_DIRECTORY 39 | "${hooks_directory}" 40 | COMMENT "Updating hooks repository") 41 | -------------------------------------------------------------------------------- /cmake/snippets/python.cmake: -------------------------------------------------------------------------------- 1 | # Set up options for Python. 2 | 3 | option(SPROKIT_ENABLE_PYTHON "Enable Python bindings" OFF) 4 | cmake_dependent_option(SPROKIT_ENABLE_PYTHON3 "Use Python3" OFF 5 | SPROKIT_ENABLE_PYTHON OFF) 6 | if (SPROKIT_ENABLE_PYTHON) 7 | set(sprokit_python_subdir "python${PYTHON_VERSION}${PYTHON_ABIFLAGS}") 8 | set(sprokit_python_output_path "${sprokit_binary_dir}/lib/${sprokit_python_subdir}") 9 | 10 | set(PYTHON_VERSION "2.7" 11 | CACHE STRING "The version of python to use for bindings") 12 | set(PYTHON_ABIFLAGS "" 13 | CACHE STRING "The ABI flags for the version of Python being used") 14 | 15 | if (SPROKIT_ENABLE_PYTHON3) 16 | set(Python_ADDITIONAL_VERSIONS 17 | 3 18 | ${PYTHON_VERSION}) 19 | 20 | if (PYTHON_VERSION VERSION_LESS "3.0") 21 | set(PYTHON_VERSION "3.0" 22 | CACHE STRING "The version of python to use for bindings" FORCE) 23 | endif () 24 | endif () 25 | 26 | # This is to avoid Boost.Python's headers to have __declspec(dllimport) in 27 | # the headers which confuses Visual Studio's linker. 28 | cmake_dependent_option(SPROKIT_HACK_LINK_BOOST_PYTHON_STATIC "Link Boost.Python statically" ON 29 | WIN32 OFF) 30 | mark_as_advanced(SPROKIT_HACK_LINK_BOOST_PYTHON_STATIC) 31 | if (SPROKIT_HACK_LINK_BOOST_PYTHON_STATIC) 32 | add_definitions(-DBOOST_PYTHON_STATIC_LIB) 33 | endif () 34 | endif () 35 | -------------------------------------------------------------------------------- /cmake/snippets/version.cmake: -------------------------------------------------------------------------------- 1 | # Set variables for the sprokit version. 2 | 3 | set(sprokit_version_major 0) 4 | set(sprokit_version_minor 1) 5 | set(sprokit_version_patch 0) 6 | set(sprokit_version "${sprokit_version_major}.${sprokit_version_minor}.${sprokit_version_patch}") 7 | -------------------------------------------------------------------------------- /cmake/support/pkgconfig.cmake: -------------------------------------------------------------------------------- 1 | function (sprokit_configure_pkgconfig module) 2 | if (UNIX) 3 | set(pkgconfig_file "${sprokit_binary_dir}/lib/pkgconfig/${module}.pc") 4 | 5 | sprokit_configure_file(sprokit-${module}.pc 6 | "${CMAKE_CURRENT_SOURCE_DIR}/${module}.pc.in" 7 | "${pkgconfig_file}" 8 | sprokit_version 9 | CMAKE_INSTALL_PREFIX 10 | LIB_SUFFIX 11 | ${ARGN}) 12 | 13 | sprokit_install( 14 | FILES "${pkgconfig_file}" 15 | DESTINATION "lib${LIB_SUFFIX}/pkgconfig" 16 | COMPONENT development) 17 | endif () 18 | endfunction () 19 | -------------------------------------------------------------------------------- /conf/.gitattributes: -------------------------------------------------------------------------------- 1 | dashboard.ctest.in export-subst 2 | -------------------------------------------------------------------------------- /conf/CTestCustom.cmake.in: -------------------------------------------------------------------------------- 1 | # For further details regarding this file, 2 | # see http://www.vtk.org/Wiki/CMake_Testing_With_CTest#Customizing_CTest 3 | 4 | set(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 0) 5 | set(CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 0) 6 | set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 500) 7 | set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 500) 8 | 9 | # Warnings to explicitly ignore 10 | list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION 11 | "LINK : warning LNK4224: /INCREMENTAL:YES is no longer supported; ignored") 12 | -------------------------------------------------------------------------------- /conf/sprokit-config-build.cmake.in: -------------------------------------------------------------------------------- 1 | include("${CMAKE_CURRENT_LIST_DIR}/sprokit-config-targets.cmake") 2 | 3 | set(SPROKIT_BUILT_SHARED 4 | "@BUILD_SHARED_LIBS@") 5 | 6 | # sprokit include directory 7 | set(SPROKIT_INCLUDE_DIR 8 | "@sprokit_source_dir@/src" 9 | "@sprokit_binary_dir@/src") 10 | set(SPROKIT_INCLUDE_DIRS 11 | ${SPROKIT_INCLUDE_DIR} 12 | ${Boost_INCLUDE_DIRS}) 13 | if (WIN32) 14 | set(SPROKIT_LIBRARY_DIR 15 | "@sprokit_binary_dir@/bin") 16 | else () 17 | set(SPROKIT_LIBRARY_DIR 18 | "@sprokit_binary_dir@/lib") 19 | endif () 20 | set(SPROKIT_LIBRARY_DIRS 21 | ${SPROKIT_LIBRARY_DIR} 22 | ${Boost_LIBRARY_DIRS}) 23 | set(SPROKIT_MODULE_DIR 24 | "${SPROKIT_LIBRARY_DIR}/sprokit") 25 | set(SPROKIT_DOCUMENTATION_DIR 26 | "@sprokit_binary_dir@/doc") 27 | 28 | set(SPROKIT_ENABLE_PYTHON 29 | "@SPROKIT_ENABLE_PYTHON@") 30 | if (SPROKIT_ENABLE_PYTHON) 31 | set(SPROKIT_ENABLE_PYTHON3 32 | "@SPROKIT_ENABLE_PYTHON3@") 33 | set(SPROKIT_PYTHON_EXECUTABLE 34 | "@PYTHON_EXECUTABLE@") 35 | set(SPROKIT_PYTHON_VERSION 36 | "@PYTHON_VERSION@") 37 | set(SPROKIT_PYTHON_ABIFLAGS 38 | "@PYTHON_ABIFLAGS@") 39 | 40 | set(SPROKIT_PYTHONPATH 41 | "@sprokit_python_output_path@") 42 | endif () 43 | 44 | set(SPROKIT_ENABLE_CXX11 45 | "@SPROKIT_ENABLE_CXX11@") 46 | -------------------------------------------------------------------------------- /conf/sprokit-config-common.cmake.in: -------------------------------------------------------------------------------- 1 | if (CMAKE_VERSION VERSION_LESS 2.8.8) 2 | message(FATAL_ERROR "sprokit requires at least CMake version 2.8.8") 3 | endif () 4 | 5 | # Version checks. 6 | set(SPROKIT_VERSION 7 | "@sprokit_version@") 8 | 9 | if (SPROKIT_VERSION VERSION_LESS sprokit_FIND_VERSION) 10 | set(sprokit_FOUND FALSE) 11 | return() 12 | endif () 13 | if (sprokit_FIND_VERSION_EXACT AND 14 | NOT SPROKIT_VERSION STREQUAL sprokit_FIND_VERSION) 15 | set(sprokit_FOUND FALSE) 16 | return() 17 | endif () 18 | 19 | # Find dependent packages. 20 | set(subpkg_required) 21 | if (sprokit_FIND_REQUIRED) 22 | set(subpkg_required REQUIRED) 23 | endif () 24 | 25 | set(SPROKIT_BOOST_VERSION 26 | "@Boost_MAJOR_VERSION@.@Boost_MINOR_VERSION@.@Boost_SUBMINOR_VERSION@") 27 | set(SPROKIT_BOOST_MANGLE_NAMESPACE 28 | "@BOOST_MANGLE_NAMESPACE@") 29 | set(SPROKIT_BOOST_USE_STATIC 30 | "@Boost_USE_STATIC_LIBS@") 31 | set(SPROKIT_BOOST_INCLUDE_DIR 32 | "@Boost_INCLUDE_DIR@") 33 | 34 | if (NOT Boost_INCLUDE_DIR) 35 | set(Boost_INCLUDE_DIR 36 | "@Boost_INCLUDE_DIR@") 37 | endif () 38 | set(Boost_USE_STATIC_LIBS "${SPROKIT_BOOST_USE_STATIC}") 39 | find_package(Boost "${SPROKIT_BOOST_VERSION}" EXACT ${subpkg_required} 40 | COMPONENTS 41 | chrono 42 | filesystem 43 | program_options 44 | system) 45 | 46 | if (NOT Boost_FOUND) 47 | set(sprokit_FOUND FALSE) 48 | return() 49 | endif () 50 | 51 | # We've found everything sprokit needs...set the variables. 52 | include("${CMAKE_CURRENT_LIST_DIR}/sprokit-config-variables.cmake") 53 | -------------------------------------------------------------------------------- /conf/sprokit-config-install.cmake.in: -------------------------------------------------------------------------------- 1 | include("${CMAKE_CURRENT_LIST_DIR}/sprokit-config-targets.cmake") 2 | 3 | set(SPROKIT_BUILT_SHARED 4 | "@BUILD_SHARED_LIBS@") 5 | 6 | if (WIN32) 7 | set(libdir "bin") 8 | else () 9 | set(libdir "lib@LIB_SUFFIX@") 10 | endif () 11 | 12 | # sprokit include directory 13 | set(SPROKIT_INCLUDE_DIR 14 | "@CMAKE_INSTALL_PREFIX@/include") 15 | set(SPROKIT_INCLUDE_DIRS 16 | ${SPROKIT_INCLUDE_DIR} 17 | ${Boost_INCLUDE_DIRS}) 18 | set(SPROKIT_LIBRARY_DIR 19 | "@CMAKE_INSTALL_PREFIX@/${libdir}") 20 | set(SPROKIT_LIBRARY_DIRS 21 | ${SPROKIT_LIBRARY_DIR} 22 | ${Boost_LIBRARY_DIRS}) 23 | set(SPROKIT_MODULE_DIR 24 | "${SPROKIT_LIBRARY_DIR}/sprokit") 25 | set(SPROKIT_DOCUMENTATION_DIR 26 | "@CMAKE_INSTALL_PREFIX@/share/doc/sprokit-@sprokit_version@") 27 | 28 | set(SPROKIT_PIPE_INSTALL_PATH 29 | "@CMAKE_INSTALL_PREFIX@/share/sprokit/pipelines") 30 | set(SPROKIT_PIPE_INCLUDE_INSTALL_PATH 31 | "${SPROKIT_PIPE_INSTALL_PATH}/include") 32 | set(SPROKIT_PIPE_CLUSTER_INSTALL_PATH 33 | "${SPROKIT_PIPE_INSTALL_PATH}/clusters") 34 | 35 | set(SPROKIT_ENABLE_PYTHON 36 | "@SPROKIT_ENABLE_PYTHON@") 37 | if (SPROKIT_ENABLE_PYTHON) 38 | set(SPROKIT_ENABLE_PYTHON3 39 | "@SPROKIT_ENABLE_PYTHON3@") 40 | set(SPROKIT_PYTHON_EXECUTABLE 41 | "@PYTHON_EXECUTABLE@") 42 | set(SPROKIT_PYTHON_VERSION 43 | "@PYTHON_VERSION@") 44 | set(SPROKIT_PYTHON_ABIFLAGS 45 | "@PYTHON_ABIFLAGS@") 46 | 47 | set(SPROKIT_PYTHONPATH 48 | "@CMAKE_INSTALL_PREFIX@/${libdir}/python@PYTHON_VERSION@") 49 | endif () 50 | 51 | set(SPROKIT_ENABLE_CXX11 52 | "@SPROKIT_ENABLE_CXX11@") 53 | -------------------------------------------------------------------------------- /conf/sprokit-macro-fixes.cmake: -------------------------------------------------------------------------------- 1 | # Fixes functions for the sprokit project 2 | # The following functions are defined: 3 | # 4 | # sprokit_use_fixes 5 | # 6 | # Their syntax is: 7 | # 8 | # sprokit_use_fixes([name ...]) 9 | # Set up future targets to use fixes for Boost used in sprokit. 10 | # Does not affect parent directories. If called without arguments, all 11 | # known fixes are used. 12 | 13 | define_property(GLOBAL 14 | PROPERTY sprokit_fixes 15 | BRIEF_DOCS "A list of all fixes sprokit provides for various headers." 16 | FULL_DOCS "Some things in sprokit require a patched header (usually for " 17 | "Boost) and as such, requires extra include directories for each " 18 | "fix. The fixes available depends on whether sprokit was built " 19 | "using them or not.") 20 | set_property(GLOBAL 21 | PROPERTY sprokit_fixes 22 | "@sprokit_fixes@") 23 | 24 | function (sprokit_use_fixes) 25 | if (ARGN) 26 | set(fixes "${ARGN}") 27 | else () 28 | get_property(fixes GLOBAL 29 | PROPERTY sprokit_fixes) 30 | endif () 31 | foreach (fix IN LISTS fixes) 32 | foreach (includedir IN LISTS SPROKIT_INCLUDE_DIR) 33 | include_directories(BEFORE SYSTEM "${includedir}/fixes/${fix}") 34 | endforeach () 35 | endforeach () 36 | endfunction () 37 | -------------------------------------------------------------------------------- /conf/sprokit.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | includedir=${prefix}/include 4 | libdir=${prefix}/lib@LIB_SUFFIX@ 5 | 6 | Name: sprokit 7 | Description: The sprokit project 8 | Version: @sprokit_version@ 9 | Cflags: -I${includedir} 10 | Libs: -L${libdir} 11 | -------------------------------------------------------------------------------- /extra/.gitattributes: -------------------------------------------------------------------------------- 1 | git export-ignore 2 | kitware export-ignore 3 | -------------------------------------------------------------------------------- /extra/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_extra) 2 | 3 | option(SPROKIT_ENABLE_EXTRAS_VIM "Enable extra files for Vim" OFF) 4 | if (SPROKIT_ENABLE_EXTRAS_VIM) 5 | add_subdirectory(vim) 6 | endif () 7 | -------------------------------------------------------------------------------- /extra/dist/snap-script.cmake: -------------------------------------------------------------------------------- 1 | execute_process( 2 | COMMAND date 3 | +%Y%m%d 4 | WORKING_DIRECTORY "${sprokit_source_dir}" 5 | RESULT_VARIABLE date_return 6 | OUTPUT_VARIABLE sprokit_date) 7 | execute_process( 8 | COMMAND date 9 | +%H%M%S 10 | WORKING_DIRECTORY "${sprokit_source_dir}" 11 | RESULT_VARIABLE time_return 12 | OUTPUT_VARIABLE sprokit_time) 13 | execute_process( 14 | COMMAND "${GIT_EXECUTABLE}" 15 | rev-parse 16 | --short 17 | HEAD 18 | WORKING_DIRECTORY "${sprokit_source_dir}" 19 | RESULT_VARIABLE git_return 20 | OUTPUT_VARIABLE sprokit_git_hash_short) 21 | execute_process( 22 | COMMAND "${GIT_EXECUTABLE}" 23 | diff 24 | --no-ext-diff 25 | --quiet 26 | --exit-code 27 | WORKING_DIRECTORY "${sprokit_source_dir}" 28 | RESULT_VARIABLE git_return) 29 | 30 | string(STRIP "${sprokit_date}" sprokit_date) 31 | string(STRIP "${sprokit_time}" sprokit_time) 32 | string(STRIP "${sprokit_git_hash_short}" sprokit_git_hash_short) 33 | 34 | set(snap_suffix ".${sprokit_date}git${sprokit_git_hash_short}") 35 | set(dirty_suffix ".dirty${sprokit_time}") 36 | 37 | execute_process( 38 | COMMAND "${GIT_EXECUTABLE}" 39 | archive 40 | --format=tar 41 | --prefix=sprokit-${sprokit_version}/ 42 | HEAD 43 | COMMAND bzip2 44 | OUTPUT_FILE "${sprokit_binary_dir}/sprokit-${sprokit_version}${snap_suffix}.tar.bz2" 45 | WORKING_DIRECTORY "${sprokit_source_dir}") 46 | if (git_return) 47 | execute_process( 48 | COMMAND "${GIT_EXECUTABLE}" 49 | diff 50 | HEAD 51 | OUTPUT_FILE "${sprokit_binary_dir}/sprokit-${sprokit_version}${snap_suffix}${dirty_suffix}.patch" 52 | WORKING_DIRECTORY "${sprokit_source_dir}") 53 | endif () 54 | -------------------------------------------------------------------------------- /extra/doxygen/Doxyfile.tag.in: -------------------------------------------------------------------------------- 1 | # Doxyfile 1.5.7.1-KDevelop 2 | 3 | @INCLUDE = Doxyfile.common 4 | 5 | #--------------------------------------------------------------------------- 6 | # configuration options related to warning and progress messages 7 | #--------------------------------------------------------------------------- 8 | WARN_LOGFILE = @doxy_documentation_output_path@/@doxy_project_name@.tags.warnings 9 | #--------------------------------------------------------------------------- 10 | # configuration options related to the HTML output 11 | #--------------------------------------------------------------------------- 12 | GENERATE_HTML = NO 13 | #--------------------------------------------------------------------------- 14 | # configuration options related to the LaTeX output 15 | #--------------------------------------------------------------------------- 16 | GENERATE_LATEX = NO 17 | #--------------------------------------------------------------------------- 18 | # configuration options related to the RTF output 19 | #--------------------------------------------------------------------------- 20 | GENERATE_RTF = NO 21 | #--------------------------------------------------------------------------- 22 | # configuration options related to the man page output 23 | #--------------------------------------------------------------------------- 24 | GENERATE_MAN = NO 25 | #--------------------------------------------------------------------------- 26 | # configuration options related to the XML output 27 | #--------------------------------------------------------------------------- 28 | GENERATE_XML = NO 29 | #--------------------------------------------------------------------------- 30 | # configuration options for the AutoGen Definitions output 31 | #--------------------------------------------------------------------------- 32 | GENERATE_AUTOGEN_DEF = NO 33 | #--------------------------------------------------------------------------- 34 | # configuration options related to the Perl module output 35 | #--------------------------------------------------------------------------- 36 | GENERATE_PERLMOD = NO 37 | -------------------------------------------------------------------------------- /extra/vim/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_extra_vim) 2 | 3 | set(VIM_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${PREFIX}/share/vim/vimfiles) 4 | 5 | install( 6 | FILES pipe.vim 7 | DESTINATION "${VIM_INSTALL_PATH}/syntax" 8 | COMPONENT metadata) 9 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories("${CMAKE_CURRENT_SOURCE_DIR}") 2 | include_directories("${CMAKE_CURRENT_BINARY_DIR}") 3 | 4 | add_subdirectory(fixes) 5 | 6 | add_subdirectory(sprokit) 7 | 8 | option(SPROKIT_ENABLE_TOOLS "Build tools" ON) 9 | if (SPROKIT_ENABLE_TOOLS) 10 | add_subdirectory(tools) 11 | endif () 12 | 13 | add_subdirectory(bindings) 14 | add_subdirectory(processes) 15 | add_subdirectory(schedulers) 16 | 17 | # ---------------------------------------------------------------- 18 | # build master documentation 19 | 20 | sprokit_create_doxygen( 21 | "${CMAKE_CURRENT_SOURCE_DIR}" 22 | sprokit-all) 23 | -------------------------------------------------------------------------------- /src/bindings/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_bindings) 2 | 3 | include_directories("${CMAKE_CURRENT_SOURCE_DIR}") 4 | 5 | if (SPROKIT_ENABLE_PYTHON) 6 | add_subdirectory(python) 7 | endif () 8 | -------------------------------------------------------------------------------- /src/bindings/python/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_python) 2 | 3 | set(boost_python_library 4 | python) 5 | 6 | if (SPROKIT_ENABLE_PYTHON3) 7 | set(boost_python_library 8 | python3) 9 | endif () 10 | 11 | string(TOUPPER ${boost_python_library} boost_python_library_upper) 12 | set(boost_python_library_var 13 | Boost_${boost_python_library_upper}_LIBRARY) 14 | 15 | find_package(Boost ${sprokit_boost_version} REQUIRED 16 | COMPONENTS 17 | iostreams 18 | ${boost_python_library}) 19 | 20 | find_package(PythonLibs ${PYTHON_VERSION} REQUIRED) 21 | include_directories(SYSTEM ${PYTHON_INCLUDE_DIR}) 22 | 23 | sprokit_use_python_fixes() 24 | 25 | function (_sprokit_add_python_library name modpath) 26 | _sprokit_create_safe_modpath(${modpath} safe_modpath) 27 | 28 | sprokit_add_python_library(${name} ${modpath} 29 | ${ARGN}) 30 | 31 | sprokit_require_python_fixes(python-${safe_modpath}-${name}) 32 | endfunction () 33 | 34 | set(copyright_header 35 | "#ckwg +4 36 | # Copyright 2013 by Kitware, Inc. All Rights Reserved. Please refer to 37 | # KITWARE_LICENSE.TXT for licensing information, or contact General Counsel, 38 | # Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.") 39 | 40 | add_subdirectory(sprokit) 41 | add_subdirectory(modules) 42 | add_subdirectory(processes) 43 | add_subdirectory(schedulers) 44 | add_subdirectory(test) 45 | 46 | set (python_both_arch TRUE) 47 | 48 | sprokit_create_python_init(sprokit) 49 | -------------------------------------------------------------------------------- /src/bindings/python/modules/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_python_modules) 2 | 3 | set(modules_python_srcs 4 | registration.cxx) 5 | 6 | set(modules_python_private_headers 7 | modules-config.h 8 | registration.h) 9 | 10 | sprokit_private_header_group(${modules_python_private_headers}) 11 | sprokit_add_plugin(modules_python 12 | MAKE_SPROKIT_MODULES_PYTHON_LIB 13 | ${modules_python_srcs} 14 | ${modules_python_private_headers}) 15 | target_link_libraries(modules_python 16 | LINK_PRIVATE 17 | sprokit_pipeline 18 | sprokit_python_util 19 | ${${boost_python_library_var}} 20 | ${PYTHON_LIBRARIES}) 21 | 22 | sprokit_add_python_module("${CMAKE_CURRENT_SOURCE_DIR}/modules.py" 23 | sprokit/modules 24 | modules) 25 | 26 | execute_process( 27 | COMMAND "${PYTHON_EXECUTABLE}" -c 28 | "import pkg_resources; pkg_resources.require('straight.plugin >= 1.3.1')" 29 | WORKING_DIRECTORY "${sprokit_source_dir}" 30 | RESULT_VARIABLE straight_return 31 | OUTPUT_QUIET 32 | ERROR_QUIET) 33 | 34 | set(default_have_straight OFF) 35 | if (NOT straight_return) 36 | set(default_have_straight ON) 37 | endif () 38 | 39 | option(SPROKIT_ASSUME_STRAIGHT_PLUGIN "Assume the straight.plugin Python module exists (needs >= 1.3.1)" "${default_have_straight}") 40 | if (NOT SPROKIT_ASSUME_STRAIGHT_PLUGIN) 41 | sprokit_add_python_module("${CMAKE_CURRENT_SOURCE_DIR}/loaders.py" 42 | sprokit/modules 43 | loaders) 44 | endif () 45 | 46 | sprokit_create_python_init(sprokit/modules) 47 | # modules) 48 | 49 | set (python_both_arch TRUE) 50 | 51 | sprokit_create_python_plugin_init(sprokit/processes) 52 | sprokit_create_python_plugin_init(sprokit/schedulers) 53 | -------------------------------------------------------------------------------- /src/bindings/python/modules/modules-config.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011, 2013-2014 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_MODULES_PYTHON_MODULES_CONFIG_H 32 | #define SPROKIT_MODULES_PYTHON_MODULES_CONFIG_H 33 | 34 | #include 35 | 36 | #ifdef MAKE_SPROKIT_MODULES_PYTHON_LIB 37 | /// Export the symbol if building the library. 38 | #define SPROKIT_MODULES_PYTHON_EXPORT SPROKIT_EXPORT 39 | #else 40 | /// Import the symbol if including the library. 41 | #define SPROKIT_MODULES_PYTHON_EXPORT SPROKIT_IMPORT 42 | #endif 43 | 44 | /// Hide the symbol from the library interface. 45 | #define SPROKIT_MODULES_PYTHON_NO_EXPORT SPROKIT_NO_EXPORT 46 | 47 | /// Mark as deprecated. 48 | #define SPROKIT_MODULES_PYTHON_EXPORT_DEPRECATED SPROKIT_DEPRECATED SPROKIT_MODULES_PYTHON_EXPORT 49 | 50 | #endif // SPROKIT_MODULES_PYTHON_MODULES_CONFIG_H 51 | -------------------------------------------------------------------------------- /src/bindings/python/modules/registration.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_MODULES_PYTHON_REGISTRATION_H 32 | #define SPROKIT_MODULES_PYTHON_REGISTRATION_H 33 | 34 | #include "modules-config.h" 35 | 36 | /** 37 | * \file python/modules/registration.h 38 | * 39 | * \brief Register processes for use. 40 | */ 41 | 42 | extern "C" 43 | { 44 | 45 | /** 46 | * \brief Register processes. 47 | */ 48 | void SPROKIT_MODULES_PYTHON_EXPORT register_processes(); 49 | 50 | } 51 | 52 | #endif // SPROKIT_MODULES_PYTHON_REGISTRATION_H 53 | -------------------------------------------------------------------------------- /src/bindings/python/processes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_python_processes) 2 | 3 | if (SPROKIT_ENABLE_TESTING) 4 | add_subdirectory(test) 5 | endif () 6 | -------------------------------------------------------------------------------- /src/bindings/python/processes/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_python_processes_test) 2 | 3 | set(no_install TRUE) 4 | 5 | sprokit_add_python_module(${CMAKE_CURRENT_SOURCE_DIR}/__init__.py 6 | sprokit/processes/test 7 | __init__) 8 | 9 | sprokit_add_python_module(${CMAKE_CURRENT_SOURCE_DIR}/examples.py 10 | sprokit/processes/test 11 | examples) 12 | -------------------------------------------------------------------------------- /src/bindings/python/processes/test/__init__.py: -------------------------------------------------------------------------------- 1 | #ckwg +28 2 | # Copyright 2012 by Kitware, Inc. 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # 11 | # * Redistributions in binary form must reproduce the above copyright notice, 12 | # this list of conditions and the following disclaimer in the documentation 13 | # and/or other materials provided with the distribution. 14 | # 15 | # * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | # to endorse or promote products derived from this software without specific 17 | # prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | from sprokit.processes.test import examples 32 | 33 | 34 | def __sprokit_register__(): 35 | from sprokit.pipeline import process_registry 36 | 37 | module_name = 'python:test.examples' 38 | 39 | reg = process_registry.ProcessRegistry.self() 40 | 41 | if reg.is_module_loaded(module_name): 42 | return 43 | 44 | reg.register_process('test_python_process', 'A test Python process', examples.TestPythonProcess) 45 | reg.register_process('pyprint_number', 'A Python process which prints numbers', examples.PythonPrintNumberProcess) 46 | 47 | reg.mark_module_as_loaded(module_name) 48 | -------------------------------------------------------------------------------- /src/bindings/python/schedulers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_python_schedulers) 2 | 3 | add_subdirectory(examples) 4 | -------------------------------------------------------------------------------- /src/bindings/python/schedulers/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_python_schedulers_examples) 2 | 3 | #set(no_install TRUE) 4 | 5 | sprokit_add_python_module(${CMAKE_CURRENT_SOURCE_DIR}/__init__.py 6 | sprokit/schedulers/examples 7 | __init__) 8 | 9 | sprokit_add_python_module(${CMAKE_CURRENT_SOURCE_DIR}/pythread_per_process_scheduler.py 10 | sprokit/schedulers/examples 11 | pythread_per_process_scheduler) 12 | -------------------------------------------------------------------------------- /src/bindings/python/schedulers/examples/__init__.py: -------------------------------------------------------------------------------- 1 | #ckwg +28 2 | # Copyright 2012 by Kitware, Inc. 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # 11 | # * Redistributions in binary form must reproduce the above copyright notice, 12 | # this list of conditions and the following disclaimer in the documentation 13 | # and/or other materials provided with the distribution. 14 | # 15 | # * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | # to endorse or promote products derived from this software without specific 17 | # prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | from sprokit.schedulers.examples import pythread_per_process_scheduler 32 | 33 | 34 | def __sprokit_register__(): 35 | from sprokit.pipeline import scheduler_registry 36 | 37 | module_name = 'python:schedulers.examples' 38 | 39 | reg = scheduler_registry.SchedulerRegistry.self() 40 | 41 | if reg.is_module_loaded(module_name): 42 | return 43 | 44 | reg.register_scheduler('pythread_per_process', 'Run each process in its own Python thread', pythread_per_process_scheduler.PyThreadPerProcessScheduler) 45 | 46 | reg.mark_module_as_loaded(module_name) 47 | -------------------------------------------------------------------------------- /src/bindings/python/sprokit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_python_sprokit) 2 | 3 | add_subdirectory(pipeline) 4 | add_subdirectory(pipeline_util) 5 | -------------------------------------------------------------------------------- /src/bindings/python/sprokit/pipeline/modules.cxx: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011-2012 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | 33 | #include 34 | #include 35 | 36 | /** 37 | * \file modules.cxx 38 | * 39 | * \brief Python bindings for module loading. 40 | */ 41 | 42 | using namespace boost::python; 43 | 44 | BOOST_PYTHON_MODULE(modules) 45 | { 46 | def("load_known_modules", &sprokit::load_known_modules 47 | , "Loads sprokit modules to populate the process and scheduler registries."); 48 | } 49 | -------------------------------------------------------------------------------- /src/bindings/python/sprokit/pipeline/utils.cxx: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | /** 38 | * \file utils.cxx 39 | * 40 | * \brief Python bindings for utils. 41 | */ 42 | 43 | using namespace boost::python; 44 | 45 | BOOST_PYTHON_MODULE(utils) 46 | { 47 | class_("ThreadName" 48 | , "A type for the name of a thread."); 49 | 50 | def("name_thread", &sprokit::name_thread 51 | , (arg("name")) 52 | , "Names the currently running thread."); 53 | } 54 | -------------------------------------------------------------------------------- /src/bindings/python/sprokit/pipeline_util/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_python_sprokit_pipeline_util) 2 | 3 | _sprokit_add_python_library(bake 4 | sprokit/pipeline_util 5 | bake.cxx) 6 | target_link_libraries(python-sprokit.pipeline_util-bake 7 | LINK_PRIVATE 8 | sprokit_pipeline 9 | sprokit_pipeline_util 10 | sprokit_python_util 11 | ${Boost_IOSTREAMS_LIBRARY} 12 | ${Boost_SYSTEM_LIBRARY} 13 | ${${boost_python_library_var}} 14 | ${PYTHON_LIBRARIES}) 15 | 16 | _sprokit_add_python_library(export_ 17 | sprokit/pipeline_util 18 | export.cxx) 19 | target_link_libraries(python-sprokit.pipeline_util-export_ 20 | LINK_PRIVATE 21 | sprokit_pipeline 22 | sprokit_pipeline_util 23 | sprokit_python_util 24 | ${${boost_python_library_var}} 25 | ${PYTHON_LIBRARIES}) 26 | 27 | _sprokit_add_python_library(load 28 | sprokit/pipeline_util 29 | load.cxx) 30 | target_link_libraries(python-sprokit.pipeline_util-load 31 | LINK_PRIVATE 32 | sprokit_pipeline 33 | sprokit_pipeline_util 34 | sprokit_python_util 35 | ${Boost_IOSTREAMS_LIBRARY} 36 | ${Boost_SYSTEM_LIBRARY} 37 | ${${boost_python_library_var}} 38 | ${PYTHON_LIBRARIES}) 39 | 40 | sprokit_create_python_init(sprokit/pipeline_util) 41 | # bake 42 | # export_ 43 | # load) 44 | -------------------------------------------------------------------------------- /src/bindings/python/test/.NoDartCoverage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kitware/sprokit/6b3f6cf87f625904e9061a447bd16f96800fef77/src/bindings/python/test/.NoDartCoverage -------------------------------------------------------------------------------- /src/bindings/python/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_python_test) 2 | 3 | sprokit_add_python_module(${CMAKE_CURRENT_SOURCE_DIR}/test.py 4 | sprokit/test 5 | test) 6 | 7 | sprokit_create_python_init(sprokit/test) 8 | 9 | if (SPROKIT_ENABLE_TESTING) 10 | add_subdirectory(python) 11 | endif () 12 | -------------------------------------------------------------------------------- /src/bindings/python/test/python/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_python_test_python) 2 | 3 | set(no_install TRUE) 4 | 5 | add_subdirectory(modules) 6 | 7 | sprokit_create_python_init(sprokit/test/python) 8 | -------------------------------------------------------------------------------- /src/bindings/python/test/python/modules/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_python_test_python_modules) 2 | 3 | sprokit_add_python_module(${CMAKE_CURRENT_SOURCE_DIR}/extras.py 4 | sprokit/test/python/modules 5 | extras) 6 | 7 | sprokit_create_python_plugin_init(sprokit/test/python/modules) 8 | -------------------------------------------------------------------------------- /src/bindings/python/test/python/modules/extras.py: -------------------------------------------------------------------------------- 1 | #ckwg +28 2 | # Copyright 2012 by Kitware, Inc. 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # 11 | # * Redistributions in binary form must reproduce the above copyright notice, 12 | # this list of conditions and the following disclaimer in the documentation 13 | # and/or other materials provided with the distribution. 14 | # 15 | # * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | # to endorse or promote products derived from this software without specific 17 | # prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | from sprokit.pipeline import process 32 | 33 | 34 | class TestPythonProcess(process.PythonProcess): 35 | def __init__(self, conf): 36 | process.PythonProcess.__init__(self, conf) 37 | 38 | 39 | def __sprokit_register__(): 40 | from sprokit.pipeline import process_registry 41 | 42 | module_name = 'python:test.python.extras' 43 | 44 | reg = process_registry.ProcessRegistry.self() 45 | 46 | if reg.is_module_loaded(module_name): 47 | return 48 | 49 | reg.register_process('extra_test_python_process', 'An extra test Python process', TestPythonProcess) 50 | 51 | reg.mark_module_as_loaded(module_name) 52 | -------------------------------------------------------------------------------- /src/fixes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_fixes) 2 | 3 | set_property(GLOBAL 4 | PROPERTY sprokit_fix_source_dir 5 | "${CMAKE_CURRENT_SOURCE_DIR}") 6 | set_property(GLOBAL 7 | PROPERTY sprokit_fix_binary_dir 8 | "${CMAKE_CURRENT_BINARY_DIR}") 9 | set_property(GLOBAL 10 | PROPERTY sprokit_fixes) 11 | 12 | function (sprokit_add_fix fix property) 13 | get_property(sprokit_fix_source_dir GLOBAL 14 | PROPERTY sprokit_fix_source_dir) 15 | get_property(sprokit_fix_binary_dir GLOBAL 16 | PROPERTY sprokit_fix_binary_dir) 17 | sprokit_configure_directory("fixes-${fix}" 18 | "${sprokit_fix_source_dir}/${fix}/boost" 19 | "${sprokit_fix_binary_dir}/${fix}/${BOOST_MANGLE_NAMESPACE}") 20 | set_property(GLOBAL APPEND 21 | PROPERTY sprokit_fixes 22 | "${fix}") 23 | set_property(GLOBAL APPEND 24 | PROPERTY "${property}" 25 | "${fix}") 26 | endfunction () 27 | 28 | function (sprokit_use_fix fix) 29 | if (NOT BOOST_MANGLE_NAMESPACE STREQUAL "boost") 30 | get_property(sprokit_fix_source_dir GLOBAL 31 | PROPERTY sprokit_fix_source_dir) 32 | include_directories(BEFORE SYSTEM "${sprokit_fix_source_dir}/${fix}") 33 | endif () 34 | get_property(sprokit_fix_binary_dir GLOBAL 35 | PROPERTY sprokit_fix_binary_dir) 36 | include_directories(BEFORE SYSTEM "${sprokit_fix_binary_dir}/${fix}") 37 | endfunction () 38 | 39 | function (sprokit_require_fix target fix) 40 | add_dependencies("${target}" 41 | "configure-fixes-${fix}") 42 | endfunction () 43 | 44 | if (SPROKIT_ENABLE_PYTHON) 45 | include("${CMAKE_CURRENT_SOURCE_DIR}/python.cmake") 46 | endif () 47 | include("${CMAKE_CURRENT_SOURCE_DIR}/tools.cmake") 48 | 49 | # Install the fixes. 50 | function (sprokit_install_fix_directory directory) 51 | sprokit_install( 52 | DIRECTORY "${directory}" 53 | DESTINATION include/sprokit/fixes 54 | COMPONENT development) 55 | endfunction () 56 | 57 | function (sprokit_install_fix fix) 58 | if (NOT BOOST_MANGLE_NAMESPACE STREQUAL "boost") 59 | get_property(sprokit_fix_source_dir GLOBAL 60 | PROPERTY sprokit_fix_source_dir) 61 | sprokit_install_fix_directory("${sprokit_fix_source_dir}/${fix}") 62 | endif () 63 | get_property(sprokit_fix_binary_dir GLOBAL 64 | PROPERTY sprokit_fix_binary_dir) 65 | sprokit_install_fix_directory("${sprokit_fix_binary_dir}/${fix}") 66 | endfunction () 67 | 68 | get_property(fixes GLOBAL 69 | PROPERTY sprokit_fixes) 70 | foreach (fix IN LISTS fixes) 71 | sprokit_install_fix("${fix}") 72 | endforeach () 73 | -------------------------------------------------------------------------------- /src/fixes/python.cmake: -------------------------------------------------------------------------------- 1 | set_property(GLOBAL 2 | PROPERTY sprokit_python_fixes) 3 | 4 | option(SPROKIT_ENABLE_BOOST_PYTHON_FIXES "Enables fixes for Boost.Python bugs (recommended)" ON) 5 | mark_as_advanced(SPROKIT_ENABLE_BOOST_PYTHON_FIXES) 6 | if (SPROKIT_ENABLE_BOOST_PYTHON_FIXES) 7 | # Not fixed yet. 8 | #if (Boost_VERSION LESS 10XX00) 9 | # Override Boost's invoke.hpp 10 | sprokit_add_fix(threading sprokit_python_fixes) 11 | #endif () 12 | # Not fixed yet. 13 | #if (Boost_VERSION LESS 10XX00) 14 | # Override Boost's override.hpp 15 | sprokit_add_fix(exceptions_in_override sprokit_python_fixes) 16 | #endif () 17 | endif () 18 | 19 | function (sprokit_use_python_fixes) 20 | get_property(fixes GLOBAL 21 | PROPERTY sprokit_python_fixes) 22 | foreach (fix IN LISTS fixes) 23 | sprokit_use_fix("${fix}") 24 | endforeach () 25 | endfunction () 26 | 27 | function (sprokit_require_python_fixes target) 28 | get_property(fixes GLOBAL 29 | PROPERTY sprokit_python_fixes) 30 | foreach (fix IN LISTS fixes) 31 | sprokit_require_fix("${target}" "${fix}") 32 | endforeach () 33 | endfunction () 34 | -------------------------------------------------------------------------------- /src/fixes/threading/boost/python/converter/shared_ptr_from_python.hpp: -------------------------------------------------------------------------------- 1 | // Copyright David Abrahams 2002. 2 | // Distributed under the Boost Software License, Version 1.0. (See 3 | // accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | #ifndef SHARED_PTR_FROM_PYTHON_DWA20021130_HPP 6 | # define SHARED_PTR_FROM_PYTHON_DWA20021130_HPP 7 | 8 | #include 9 | 10 | # include 11 | # include 12 | # include 13 | # include 14 | # include 15 | #ifndef BOOST_PYTHON_NO_PY_SIGNATURES 16 | # include 17 | #endif 18 | # include 19 | 20 | namespace boost { namespace python { namespace converter { 21 | 22 | template 23 | struct shared_ptr_from_python 24 | { 25 | shared_ptr_from_python() 26 | { 27 | converter::registry::insert(&convertible, &construct, type_id >() 28 | #ifndef BOOST_PYTHON_NO_PY_SIGNATURES 29 | , &converter::expected_from_python_type_direct::get_pytype 30 | #endif 31 | ); 32 | } 33 | 34 | private: 35 | static void* convertible(PyObject* p) 36 | { 37 | if (p == Py_None) 38 | return p; 39 | 40 | sprokit::python::python_gil gil; 41 | (void)gil; 42 | 43 | return converter::get_lvalue_from_python(p, registered::converters); 44 | } 45 | 46 | static void construct(PyObject* source, rvalue_from_python_stage1_data* data) 47 | { 48 | sprokit::python::python_gil gil; 49 | (void)gil; 50 | 51 | void* const storage = ((converter::rvalue_from_python_storage >*)data)->storage.bytes; 52 | // Deal with the "None" case. 53 | if (data->convertible == source) 54 | new (storage) shared_ptr(); 55 | else 56 | { 57 | boost::shared_ptr hold_convertible_ref_count( 58 | (void*)0, threaded_shared_ptr_deleter(handle<>(borrowed(source))) ); 59 | // use aliasing constructor 60 | new (storage) shared_ptr( 61 | hold_convertible_ref_count, 62 | static_cast(data->convertible)); 63 | } 64 | 65 | data->convertible = storage; 66 | } 67 | }; 68 | 69 | }}} // namespace boost::python::converter 70 | 71 | #endif // SHARED_PTR_FROM_PYTHON_DWA20021130_HPP 72 | -------------------------------------------------------------------------------- /src/fixes/threading/boost/python/converter/shared_ptr_to_python.hpp: -------------------------------------------------------------------------------- 1 | // Copyright David Abrahams 2003. 2 | // Distributed under the Boost Software License, Version 1.0. (See 3 | // accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | #ifndef SHARED_PTR_TO_PYTHON_DWA2003224_HPP 6 | # define SHARED_PTR_TO_PYTHON_DWA2003224_HPP 7 | 8 | #include 9 | 10 | # include 11 | # include 12 | # include 13 | # include 14 | 15 | namespace boost { namespace python { namespace converter { 16 | 17 | template 18 | PyObject* shared_ptr_to_python(shared_ptr const& x) 19 | { 20 | sprokit::python::python_gil gil; 21 | (void)gil; 22 | 23 | if (!x) 24 | return python::detail::none(); 25 | else if (shared_ptr_deleter* d = boost::get_deleter(x)) 26 | return incref( get_pointer( d->owner ) ); 27 | else 28 | return converter::registered const&>::converters.to_python(&x); 29 | } 30 | 31 | }}} // namespace boost::python::converter 32 | 33 | #endif // SHARED_PTR_TO_PYTHON_DWA2003224_HPP 34 | -------------------------------------------------------------------------------- /src/fixes/threading/boost/python/converter/threaded_shared_ptr_deleter.hpp: -------------------------------------------------------------------------------- 1 | // Copyright David Abrahams 2002. 2 | // Distributed under the Boost Software License, Version 1.0. (See 3 | // accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | #ifndef THREADED_SHARED_PTR_DELETER_DWA2002121_HPP 6 | # define THREADED_SHARED_PTR_DELETER_DWA2002121_HPP 7 | 8 | #include 9 | 10 | # include 11 | 12 | namespace boost { namespace python { namespace converter { 13 | 14 | struct threaded_shared_ptr_deleter 15 | : public shared_ptr_deleter 16 | { 17 | threaded_shared_ptr_deleter(handle<> owner) 18 | : shared_ptr_deleter(owner) 19 | { 20 | } 21 | ~threaded_shared_ptr_deleter() 22 | { 23 | } 24 | 25 | void operator()(void const* ptr) 26 | { 27 | sprokit::python::python_gil gil; 28 | (void)gil; 29 | 30 | shared_ptr_deleter::operator () (ptr); 31 | } 32 | }; 33 | 34 | }}} // namespace boost::python::converter 35 | 36 | #endif // THREADED_SHARED_PTR_DELETER_DWA2002121_HPP 37 | -------------------------------------------------------------------------------- /src/fixes/tools.cmake: -------------------------------------------------------------------------------- 1 | set_property(GLOBAL 2 | PROPERTY sprokit_tools_fixes) 3 | 4 | option(SPROKIT_ENABLE_BOOST_PROGRAM_OPTIONS_FIXES "Enables fixes for boost::program_options bugs (recommended)" ON) 5 | mark_as_advanced(SPROKIT_ENABLE_BOOST_PROGRAM_OPTIONS_FIXES) 6 | if (SPROKIT_ENABLE_BOOST_PROGRAM_OPTIONS_FIXES) 7 | # XXX(Boost): 1.50.0 8 | if (Boost_VERSION LESS 105000) 9 | # Override Boost's value_semantic.hpp 10 | sprokit_add_fix(value_name sprokit_tools_fixes) 11 | endif () 12 | endif () 13 | 14 | function (sprokit_use_tools_fixes) 15 | get_property(fixes GLOBAL 16 | PROPERTY sprokit_tools_fixes) 17 | foreach (fix IN LISTS fixes) 18 | sprokit_use_fix("${fix}") 19 | endforeach () 20 | endfunction () 21 | 22 | function (sprokit_require_tools_fixes target) 23 | get_property(fixes GLOBAL 24 | PROPERTY sprokit_tools_fixes) 25 | foreach (fix IN LISTS fixes) 26 | sprokit_require_fix("${target}" "${fix}") 27 | endforeach () 28 | endfunction () 29 | -------------------------------------------------------------------------------- /src/processes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_processes) 2 | 3 | add_subdirectory(helpers) 4 | add_subdirectory(clusters) 5 | add_subdirectory(flow) 6 | 7 | if (SPROKIT_ENABLE_TESTING) 8 | add_subdirectory(examples) 9 | endif () 10 | 11 | set(DOXY_EXCLUDE_PATTERNS 12 | "*/examples/* */helpers/*") 13 | 14 | sprokit_create_doxygen( 15 | "${CMAKE_CURRENT_SOURCE_DIR}" 16 | processes 17 | pipeline) 18 | -------------------------------------------------------------------------------- /src/processes/clusters/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_processes_clusters) 2 | 3 | set(clusters_srcs 4 | registration.cxx) 5 | 6 | set(clusters_private_headers 7 | clusters-config.h 8 | registration.h) 9 | 10 | set(sprokit_default_cluster_paths 11 | "${CMAKE_INSTALL_PREFIX}/share/sprokit/pipelines/clusters") 12 | 13 | if (WIN32) 14 | set(path_sep ";") 15 | else () 16 | set(path_sep ":") 17 | endif () 18 | 19 | option(SPROKIT_USE_BUILD_CLUSTER_PATHS "Whether to use the build tree for the default cluster path" ${SPROKIT_USE_BUILD_TREE}) 20 | mark_as_advanced(SPROKIT_USE_BUILD_CLUSTER_PATHS) 21 | if (SPROKIT_USE_BUILD_CLUSTER_PATHS) 22 | set(sprokit_default_cluster_paths 23 | "${sprokit_default_cluster_paths}${path_sep}${sprokit_source_dir}/src/tools/pipelines/clusters") 24 | endif () 25 | 26 | set(path_prefix) 27 | 28 | if (WIN32) 29 | set(path_prefix "L") 30 | endif () 31 | 32 | set(SPROKIT_DEFAULT_CLUSTER_PATHS "${sprokit_default_cluster_paths}" 33 | CACHE STRING "The default paths to search for clusters in") 34 | set(cluster_build_options 35 | "DEFAULT_CLUSTER_PATHS=${path_prefix}\"${SPROKIT_DEFAULT_CLUSTER_PATHS}\"") 36 | 37 | set(registration_build_options) 38 | 39 | if (WIN32) 40 | sprokit_configure_file(cluster-paths.h 41 | "${CMAKE_CURRENT_SOURCE_DIR}/cluster-paths.h.in" 42 | "${CMAKE_CURRENT_BINARY_DIR}/cluster-paths.h" 43 | SPROKIT_DEFAULT_CLUSTER_PATHS 44 | path_prefix) 45 | 46 | list(APPEND clusters_private_headers 47 | cluster-paths.h.in) 48 | else () 49 | list(APPEND registration_build_options 50 | ${cluster_build_options}) 51 | endif () 52 | 53 | set_source_files_properties(registration.cxx 54 | PROPERTIES 55 | COMPILE_DEFINITIONS "${registration_build_options}") 56 | 57 | sprokit_private_header_group(${clusters_private_headers}) 58 | sprokit_add_plugin(processes_clusters 59 | MAKE_SPROKIT_PROCESSES_CLUSTERS_LIB 60 | ${clusters_srcs} 61 | ${clusters_private_headers}) 62 | target_link_libraries(processes_clusters 63 | sprokit_pipeline_util 64 | sprokit_pipeline 65 | ${Boost_FILESYSTEM_LIBRARY} 66 | ${Boost_SYSTEM_LIBRARY}) 67 | -------------------------------------------------------------------------------- /src/processes/clusters/cluster-paths.h.in: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2012 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_PROCESSES_CLUSTERS_CLUSTER_PATHS_H 32 | #define SPROKIT_PROCESSES_CLUSTERS_CLUSTER_PATHS_H 33 | 34 | #define DEFAULT_CLUSTER_PATHS @path_prefix@"@SPROKIT_DEFAULT_CLUSTER_PATHS@" 35 | 36 | #endif // SPROKIT_PROCESSES_CLUSTERS_CLUSTER_PATHS_H 37 | -------------------------------------------------------------------------------- /src/processes/clusters/clusters-config.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011, 2013-2014 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_PROCESSES_CLUSTERS_CLUSTERS_CONFIG_H 32 | #define SPROKIT_PROCESSES_CLUSTERS_CLUSTERS_CONFIG_H 33 | 34 | #include 35 | 36 | /** 37 | * \file clusters-config.h 38 | * 39 | * \brief Defines for symbol visibility in cluster processes. 40 | */ 41 | 42 | #ifdef MAKE_SPROKIT_PROCESSES_CLUSTERS_LIB 43 | /// Export the symbol if building the library. 44 | #define SPROKIT_PROCESSES_CLUSTERS_EXPORT SPROKIT_EXPORT 45 | #else 46 | /// Import the symbol if including the library. 47 | #define SPROKIT_PROCESSES_CLUSTERS_EXPORT SPROKIT_IMPORT 48 | #endif 49 | 50 | /// Hide the symbol from the library interface. 51 | #define SPROKIT_PROCESSES_CLUSTERS_NO_EXPORT SPROKIT_NO_EXPORT 52 | 53 | /// Mark as deprecated. 54 | #define SPROKIT_PROCESSES_CLUSTERS_EXPORT_DEPRECATED SPROKIT_DEPRECATED SPROKIT_PROCESSES_CLUSTERS_EXPORT 55 | 56 | #endif // SPROKIT_PROCESSES_CLUSTERS_CLUSTERS_CONFIG_H 57 | -------------------------------------------------------------------------------- /src/processes/clusters/registration.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_PROCESSES_CLUSTERS_REGISTRATION_H 32 | #define SPROKIT_PROCESSES_CLUSTERS_REGISTRATION_H 33 | 34 | #include "clusters-config.h" 35 | 36 | /** 37 | * \file clusters/registration.h 38 | * 39 | * \brief Register processes for use. 40 | */ 41 | 42 | extern "C" 43 | { 44 | 45 | /** 46 | * \brief Register processes. 47 | */ 48 | void SPROKIT_PROCESSES_CLUSTERS_EXPORT register_processes(); 49 | 50 | } 51 | 52 | #endif // SPROKIT_PROCESSES_CLUSTERS_REGISTRATION_H 53 | -------------------------------------------------------------------------------- /src/processes/examples/.NoDartCoverage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kitware/sprokit/6b3f6cf87f625904e9061a447bd16f96800fef77/src/processes/examples/.NoDartCoverage -------------------------------------------------------------------------------- /src/processes/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_processes_examples) 2 | 3 | set(examples_srcs 4 | any_source_process.cxx 5 | const_process.cxx 6 | const_number_process.cxx 7 | data_dependent_process.cxx 8 | duplicate_process.cxx 9 | expect_process.cxx 10 | feedback_process.cxx 11 | flow_dependent_process.cxx 12 | multiplication_process.cxx 13 | multiplier_cluster.cxx 14 | mutate_process.cxx 15 | number_process.cxx 16 | orphan_cluster.cxx 17 | orphan_process.cxx 18 | print_number_process.cxx 19 | registration.cxx 20 | shared_process.cxx 21 | skip_process.cxx 22 | tagged_flow_dependent_process.cxx 23 | take_number_process.cxx 24 | take_string_process.cxx 25 | tunable_process.cxx) 26 | 27 | set(examples_private_headers 28 | any_source_process.h 29 | const_process.h 30 | const_number_process.h 31 | data_dependent_process.h 32 | duplicate_process.h 33 | examples-config.h 34 | expect_process.h 35 | feedback_process.h 36 | flow_dependent_process.h 37 | multiplication_process.h 38 | multiplier_cluster.h 39 | mutate_process.h 40 | number_process.h 41 | orphan_cluster.h 42 | orphan_process.h 43 | print_number_process.h 44 | registration.h 45 | shared_process.h 46 | skip_process.h 47 | tagged_flow_dependent_process.h 48 | take_number_process.h 49 | take_string_process.h 50 | tunable_process.h) 51 | 52 | set(no_install TRUE) 53 | 54 | sprokit_private_header_group(${examples_private_headers}) 55 | sprokit_add_plugin(processes_examples 56 | MAKE_SPROKIT_PROCESSES_EXAMPLES_LIB 57 | ${examples_srcs} 58 | ${examples_private_headers}) 59 | target_link_libraries(processes_examples 60 | LINK_PRIVATE 61 | sprokit_pipeline 62 | ${Boost_FILESYSTEM_LIBRARY} 63 | ${Boost_SYSTEM_LIBRARY}) 64 | -------------------------------------------------------------------------------- /src/processes/examples/examples-config.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011, 2013-2014 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_PROCESSES_EXAMPLES_EXAMPLES_CONFIG_H 32 | #define SPROKIT_PROCESSES_EXAMPLES_EXAMPLES_CONFIG_H 33 | 34 | #include 35 | 36 | /** 37 | * \file examples-config.h 38 | * 39 | * \brief Defines for symbol visibility in example processes. 40 | */ 41 | 42 | #ifdef MAKE_SPROKIT_PROCESSES_EXAMPLES_LIB 43 | /// Export the symbol if building the library. 44 | #define SPROKIT_PROCESSES_EXAMPLES_EXPORT SPROKIT_EXPORT 45 | #else 46 | /// Import the symbol if including the library. 47 | #define SPROKIT_PROCESSES_EXAMPLES_EXPORT SPROKIT_IMPORT 48 | #endif 49 | 50 | /// Hide the symbol from the library interface. 51 | #define SPROKIT_PROCESSES_EXAMPLES_NO_EXPORT SPROKIT_NO_EXPORT 52 | 53 | /// Mark as deprecated. 54 | #define SPROKIT_PROCESSES_EXAMPLES_EXPORT_DEPRECATED SPROKIT_DEPRECATED SPROKIT_PROCESSES_EXAMPLES_EXPORT 55 | 56 | #endif // SPROKIT_PROCESSES_EXAMPLES_EXAMPLES_CONFIG_H 57 | -------------------------------------------------------------------------------- /src/processes/examples/orphan_cluster.cxx: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include "orphan_cluster.h" 32 | 33 | /** 34 | * \file orphan_cluster.cxx 35 | * 36 | * \brief Implementation of the orphan cluster. 37 | */ 38 | 39 | namespace sprokit 40 | { 41 | 42 | orphan_cluster 43 | ::orphan_cluster(config_t const& config) 44 | : process_cluster(config) 45 | { 46 | } 47 | 48 | orphan_cluster 49 | ::~orphan_cluster() 50 | { 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/processes/examples/orphan_cluster.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2012 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_PROCESSES_EXAMPLES_ORPHAN_CLUSTER_H 32 | #define SPROKIT_PROCESSES_EXAMPLES_ORPHAN_CLUSTER_H 33 | 34 | #include "examples-config.h" 35 | 36 | #include 37 | 38 | /** 39 | * \file orphan_cluster.h 40 | * 41 | * \brief Declaration of the orphan cluster. 42 | */ 43 | 44 | namespace sprokit 45 | { 46 | 47 | /** 48 | * \class orphan_cluster 49 | * 50 | * \brief A no-op cluster. 51 | * 52 | * \process A no-op cluster. 53 | * 54 | * \ingroup examples 55 | */ 56 | class SPROKIT_PROCESSES_EXAMPLES_NO_EXPORT orphan_cluster 57 | : public process_cluster 58 | { 59 | public: 60 | /** 61 | * \brief Constructor. 62 | * 63 | * \param config The configuration for the process. 64 | */ 65 | orphan_cluster(config_t const& config); 66 | /** 67 | * \brief Destructor. 68 | */ 69 | ~orphan_cluster(); 70 | }; 71 | 72 | } 73 | 74 | #endif // SPROKIT_PROCESSES_EXAMPLES_ORPHAN_CLUSTER_H 75 | -------------------------------------------------------------------------------- /src/processes/examples/orphan_process.cxx: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include "orphan_process.h" 32 | 33 | /** 34 | * \file orphan_process.cxx 35 | * 36 | * \brief Implementation of the orphan process. 37 | */ 38 | 39 | namespace sprokit 40 | { 41 | 42 | orphan_process 43 | ::orphan_process(config_t const& config) 44 | : process(config) 45 | { 46 | } 47 | 48 | orphan_process 49 | ::~orphan_process() 50 | { 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/processes/examples/orphan_process.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011-2012 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_PROCESSES_EXAMPLES_ORPHAN_PROCESS_H 32 | #define SPROKIT_PROCESSES_EXAMPLES_ORPHAN_PROCESS_H 33 | 34 | #include "examples-config.h" 35 | 36 | #include 37 | 38 | /** 39 | * \file orphan_process.h 40 | * 41 | * \brief Declaration of the orphan process. 42 | */ 43 | 44 | namespace sprokit 45 | { 46 | 47 | /** 48 | * \class orphan_process 49 | * 50 | * \brief A no-op process. 51 | * 52 | * \process A no-op process. 53 | * 54 | * \ingroup examples 55 | */ 56 | class SPROKIT_PROCESSES_EXAMPLES_NO_EXPORT orphan_process 57 | : public process 58 | { 59 | public: 60 | /** 61 | * \brief Constructor. 62 | * 63 | * \param config The configuration for the process. 64 | */ 65 | orphan_process(config_t const& config); 66 | /** 67 | * \brief Destructor. 68 | */ 69 | ~orphan_process(); 70 | }; 71 | 72 | } 73 | 74 | #endif // SPROKIT_PROCESSES_EXAMPLES_ORPHAN_PROCESS_H 75 | -------------------------------------------------------------------------------- /src/processes/examples/registration.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_PROCESSES_EXAMPLES_REGISTRATION_H 32 | #define SPROKIT_PROCESSES_EXAMPLES_REGISTRATION_H 33 | 34 | #include "examples-config.h" 35 | 36 | /** 37 | * \file examples/registration.h 38 | * 39 | * \brief Register processes for use. 40 | */ 41 | 42 | extern "C" 43 | { 44 | 45 | /** 46 | * \brief Register processes. 47 | */ 48 | SPROKIT_PROCESSES_EXAMPLES_EXPORT void register_processes(); 49 | 50 | } 51 | 52 | #endif // SPROKIT_PROCESSES_EXAMPLES_REGISTRATION_H 53 | -------------------------------------------------------------------------------- /src/processes/flow/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_processes_flow) 2 | 3 | set(flow_srcs 4 | collate_process.cxx 5 | distribute_process.cxx 6 | pass_process.cxx 7 | registration.cxx 8 | sink_process.cxx) 9 | 10 | set(flow_private_headers 11 | collate_process.h 12 | distribute_process.h 13 | flow-config.h 14 | pass_process.h 15 | registration.h 16 | sink_process.h) 17 | 18 | sprokit_private_header_group(${flow_private_headers}) 19 | sprokit_add_plugin(processes_flow 20 | MAKE_SPROKIT_PROCESSES_FLOW_LIB 21 | ${flow_srcs} 22 | ${flow_private_headers}) 23 | target_link_libraries(processes_flow 24 | LINK_PRIVATE 25 | sprokit_pipeline) 26 | -------------------------------------------------------------------------------- /src/processes/flow/flow-config.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011, 2013-2014 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_PROCESSES_FLOW_FLOW_CONFIG_H 32 | #define SPROKIT_PROCESSES_FLOW_FLOW_CONFIG_H 33 | 34 | #include 35 | 36 | /** 37 | * \file flow-config.h 38 | * 39 | * \brief Defines for symbol visibility in the flow processes. 40 | */ 41 | 42 | #ifdef MAKE_SPROKIT_PROCESSES_FLOW_LIB 43 | /// Export the symbol if building the library. 44 | #define SPROKIT_PROCESSES_FLOW_EXPORT SPROKIT_EXPORT 45 | #else 46 | /// Import the symbol if including the library. 47 | #define SPROKIT_PROCESSES_FLOW_EXPORT SPROKIT_IMPORT 48 | #endif 49 | 50 | /// Hide the symbol from the library interface. 51 | #define SPROKIT_PROCESSES_FLOW_NO_EXPORT SPROKIT_NO_EXPORT 52 | 53 | /// Mark as deprecated. 54 | #define SPROKIT_PROCESSES_FLOW_EXPORT_DEPRECATED SPROKIT_DEPRECATED SPROKIT_PROCESSES_FLOW_EXPORT 55 | 56 | #endif // SPROKIT_PROCESSES_FLOW_FLOW_CONFIG_H 57 | -------------------------------------------------------------------------------- /src/processes/flow/registration.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_PROCESSES_FLOW_REGISTRATION_H 32 | #define SPROKIT_PROCESSES_FLOW_REGISTRATION_H 33 | 34 | #include "flow-config.h" 35 | 36 | /** 37 | * \file flow/registration.h 38 | * 39 | * \brief Register processes for use. 40 | */ 41 | 42 | extern "C" 43 | { 44 | 45 | /** 46 | * \brief Register processes. 47 | */ 48 | SPROKIT_PROCESSES_FLOW_EXPORT void register_processes(); 49 | 50 | } 51 | 52 | #endif // SPROKIT_PROCESSES_FLOW_REGISTRATION_H 53 | -------------------------------------------------------------------------------- /src/processes/helpers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_processes_helpers) 2 | 3 | add_subdirectory(functions) 4 | -------------------------------------------------------------------------------- /src/processes/helpers/functions/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_processes_helpers_functions) 2 | -------------------------------------------------------------------------------- /src/processes/helpers/functions/function_process_register.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011-2012 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_PROCESSES_HELPER_FUNCTIONS_FUNCTION_PROCESS_REGISTER_H 32 | #define SPROKIT_PROCESSES_HELPER_FUNCTIONS_FUNCTION_PROCESS_REGISTER_H 33 | 34 | #include "function_process.h" 35 | 36 | /** 37 | * \file function_process_register.h 38 | * 39 | * \brief Macros for registering a process which wraps a function. 40 | */ 41 | 42 | /** 43 | * \def REGISTER_FUNCTION 44 | * 45 | * \brief Registers the class with the registry. 46 | * 47 | * \param name The base name of the process. 48 | * \param desc A description of the process. 49 | */ 50 | #define REGISTER_FUNCTION(name, desc) \ 51 | registry->register_process(#name, sprokit::process_registry::description_t(desc), sprokit::create_process) 52 | 53 | #endif // SPROKIT_PROCESSES_HELPER_FUNCTIONS_FUNCTION_PROCESS_REGISTER_H 54 | -------------------------------------------------------------------------------- /src/schedulers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_schedulers) 2 | 3 | add_subdirectory(examples) 4 | 5 | sprokit_create_doxygen( 6 | "${CMAKE_CURRENT_SOURCE_DIR}" 7 | schedulers 8 | pipeline) 9 | -------------------------------------------------------------------------------- /src/schedulers/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_schedulers_examples) 2 | 3 | set(examples_srcs 4 | registration.cxx 5 | sync_scheduler.cxx 6 | thread_per_process_scheduler.cxx 7 | thread_pool_scheduler.cxx) 8 | 9 | set(examples_private_headers 10 | examples-config.h 11 | registration.h 12 | sync_scheduler.h 13 | thread_per_process_scheduler.h 14 | thread_pool_scheduler.h) 15 | 16 | sprokit_private_header_group(${examples_private_headers}) 17 | sprokit_add_plugin(schedulers_examples 18 | MAKE_SPROKIT_SCHEDULERS_EXAMPLES_LIB 19 | ${examples_srcs} 20 | ${examples_private_headers}) 21 | target_link_libraries(schedulers_examples 22 | LINK_PRIVATE 23 | sprokit_pipeline 24 | ${Boost_CHRONO_LIBRARY} 25 | ${Boost_DATE_TIME_LIBRARY} 26 | ${Boost_THREAD_LIBRARY} 27 | ${Boost_SYSTEM_LIBRARY} 28 | ${CMAKE_THREAD_LIBS_INIT}) 29 | -------------------------------------------------------------------------------- /src/schedulers/examples/examples-config.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011-2014 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_SCHEDULERS_EXAMPLES_EXAMPLES_CONFIG_H 32 | #define SPROKIT_SCHEDULERS_EXAMPLES_EXAMPLES_CONFIG_H 33 | 34 | #include 35 | 36 | /** 37 | * \file examples-config.h 38 | * 39 | * \brief Defines for symbol visibility in example schedulers. 40 | */ 41 | 42 | #ifdef MAKE_SPROKIT_SCHEDULERS_EXAMPLES_LIB 43 | /// Export the symbol if building the library. 44 | #define SPROKIT_SCHEDULERS_EXAMPLES_EXPORT SPROKIT_EXPORT 45 | #else 46 | /// Import the symbol if including the library. 47 | #define SPROKIT_SCHEDULERS_EXAMPLES_EXPORT SPROKIT_IMPORT 48 | #endif 49 | 50 | /// Hide the symbol from the library interface. 51 | #define SPROKIT_SCHEDULERS_EXAMPLES_NO_EXPORT SPROKIT_NO_EXPORT 52 | 53 | /// Mark as deprecated. 54 | #define SPROKIT_SCHEDULERS_EXAMPLES_EXPORT_DEPRECATED SPROKIT_DEPRECATED SPROKIT_SCHEDULERS_EXAMPLES_EXPORT 55 | 56 | #endif // SPROKIT_SCHEDULERS_EXAMPLES_EXAMPLES_CONFIG_H 57 | -------------------------------------------------------------------------------- /src/schedulers/examples/registration.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011-2012 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_SCHEDULERS_EXAMPLES_SCHEDULERS_REGISTRATION_H 32 | #define SPROKIT_SCHEDULERS_EXAMPLES_SCHEDULERS_REGISTRATION_H 33 | 34 | #include "examples-config.h" 35 | 36 | /** 37 | * \file examples/registration.h 38 | * 39 | * \brief Register schedulers for use. 40 | */ 41 | 42 | extern "C" 43 | { 44 | 45 | /** 46 | * \brief Register schedulers. 47 | */ 48 | SPROKIT_SCHEDULERS_EXAMPLES_EXPORT void register_schedulers(); 49 | 50 | } 51 | 52 | #endif // SPROKIT_SCHEDULERS_EXAMPLES_SCHEDULERS_REGISTRATION_H 53 | -------------------------------------------------------------------------------- /src/sprokit/.gitattributes: -------------------------------------------------------------------------------- 1 | CMakeLists.txt export-subst 2 | -------------------------------------------------------------------------------- /src/sprokit/pipeline/doc/glossary.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \page glossary Glossary 3 | * 4 | *
5 | * \term{datum} 6 | * \termdef{A single packet of information within the pipeline. Datum packets 7 | * can carry one of four states: empty\, complete\, error\, or a result from 8 | * the previous process.} 9 | * \term{edge} 10 | * \termdef{A connection between two ports along which a stream of datum 11 | * packets flows.} 12 | * \term{pipeline} 13 | * \termdef{A collection of processes connected with edges.} 14 | * \term{port} 15 | * \termdef{An address on a process where datum packets can be received or be 16 | * made available.} 17 | * \term{process} 18 | * \termdef{A node within a pipeline which optionally takes input datum 19 | * packets\, uses it to compute some result\, and then outputs the results as 20 | * datum packets.} 21 | * \term{subblock} 22 | * \termdef{A group of related configuration keys which are typically passed 23 | * around as a group.} 24 | *
25 | */ 26 | -------------------------------------------------------------------------------- /src/sprokit/pipeline/doc/how_to.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \page how_to How to 3 | * 4 | * \subpage how_to_process Build a process 5 | */ 6 | -------------------------------------------------------------------------------- /src/sprokit/pipeline/doc/new_pipeline.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \mainpage The sprokit Pipeline API Documentation 3 | * 4 | * \section introduction Introduction 5 | * 6 | * This is the sprokit pipeline API that addresses issues that have arisen in the 7 | * vidtk pipeline. 8 | * 9 | * \todo Write introduction. 10 | */ 11 | -------------------------------------------------------------------------------- /src/sprokit/pipeline/module-paths.h.in: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2012 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_PIPELINE_MODULE_PATHS_H 32 | #define SPROKIT_PIPELINE_MODULE_PATHS_H 33 | 34 | #define DEFAULT_MODULE_PATHS @path_prefix@"@SPROKIT_DEFAULT_MODULE_PATHS@" 35 | 36 | #endif // SPROKIT_PIPELINE_MODULE_PATHS_H 37 | -------------------------------------------------------------------------------- /src/sprokit/pipeline/modules.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011-2012 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_PIPELINE_MODULES_H 32 | #define SPROKIT_PIPELINE_MODULES_H 33 | 34 | #include "pipeline-config.h" 35 | 36 | /** 37 | * \file modules.h 38 | * 39 | * \brief Functions dealing with modules in sprokit. 40 | */ 41 | 42 | namespace sprokit 43 | { 44 | 45 | /** 46 | * \brief Load modules from the system path. 47 | * 48 | * This function loads all known modules. That is, all modules that 49 | * can be found. Modules are shared objects or DLL's that are in one 50 | * of the search paths and have a register_processes() symbol 51 | * available. 52 | * 53 | * The default module path is based on where sprokit will be installed 54 | * and points to the \b sprokit subdirectory of the installed libraries. 55 | * 56 | * Additional modules can be fetched from a path specified in the 57 | * environment \b SPROKIT_MODULE_PATH. 58 | */ 59 | SPROKIT_PIPELINE_EXPORT void load_known_modules(); 60 | 61 | } 62 | 63 | #endif // SPROKIT_PIPELINE_MODULES_H 64 | -------------------------------------------------------------------------------- /src/sprokit/pipeline/pipeline-config.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011, 2013-2014 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_PIPELINE_PIPELINE_CONFIG_H 32 | #define SPROKIT_PIPELINE_PIPELINE_CONFIG_H 33 | 34 | #include 35 | 36 | /** 37 | * \file pipeline-config.h 38 | * 39 | * \brief Defines for symbol visibility in pipeline. 40 | */ 41 | 42 | #ifdef MAKE_SPROKIT_PIPELINE_LIB 43 | /// Export the symbol if building the library. 44 | #define SPROKIT_PIPELINE_EXPORT SPROKIT_EXPORT 45 | #else 46 | /// Import the symbol if including the library. 47 | #define SPROKIT_PIPELINE_EXPORT SPROKIT_IMPORT 48 | #endif 49 | 50 | /// Hide the symbol from the library interface. 51 | #define SPROKIT_PIPELINE_NO_EXPORT SPROKIT_NO_EXPORT 52 | 53 | /// Mark as deprecated. 54 | #define SPROKIT_PIPELINE_EXPORT_DEPRECATED SPROKIT_DEPRECATED SPROKIT_PIPELINE_EXPORT 55 | 56 | #endif // SPROKIT_PIPELINE_PIPELINE_CONFIG_H 57 | -------------------------------------------------------------------------------- /src/sprokit/pipeline/sprokit-pipeline.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | includedir=${prefix}/include 4 | libdir=${prefix}/lib@LIB_SUFFIX@ 5 | sprokitplugindir=${libdir}/sprokit 6 | 7 | Name: sprokit-pipeline 8 | Description: The sprokit-pipeline library 9 | Version: @sprokit_version@ 10 | Requires: sprokit = @sprokit_version@ 11 | Libs: -lsprokit_pipeline 12 | -------------------------------------------------------------------------------- /src/sprokit/pipeline/thread_naming.cmake: -------------------------------------------------------------------------------- 1 | set(thread_naming_defines) 2 | 3 | include(CMakePushCheckState) 4 | include(CheckFunctionExists) 5 | 6 | if (CMAKE_USE_PTHREADS_INIT) 7 | cmake_push_check_state() 8 | set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) 9 | check_function_exists(pthread_setname_np have_pthread_setname_np) 10 | check_function_exists(pthread_set_name_np have_pthread_set_name_np) 11 | cmake_pop_check_state() 12 | 13 | if (have_pthread_setname_np OR have_pthread_set_name_np) 14 | set(thread_naming_defines 15 | ${thread_naming_defines} 16 | HAVE_PTHREAD_NAMING) 17 | endif () 18 | 19 | if (have_pthread_setname_np) 20 | set(thread_naming_defines 21 | ${thread_naming_defines} 22 | HAVE_PTHREAD_SETNAME_NP) 23 | 24 | set(cmakefiles_dir 25 | "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles") 26 | set(pthread_setname_np_takes_id_path 27 | "${cmakefiles_dir}/pthread_setname_np_takes_id.cxx") 28 | file(WRITE "${pthread_setname_np_takes_id_path}" 29 | " 30 | #include 31 | 32 | #include 33 | 34 | int 35 | main() 36 | { 37 | pthread_t const tid = pthread_self(); 38 | 39 | pthread_setname_np(tid, \"test\"); 40 | 41 | return EXIT_SUCCESS; 42 | } 43 | ") 44 | try_compile(pthread_setname_np_takes_id 45 | "${cmakefiles_dir}/pthread_setname_np_takes_id" 46 | "${pthread_setname_np_takes_id_path}" 47 | CMAKE_FLAGS 48 | "-DLINK_LIBRARIES=${CMAKE_THREAD_LIBS_INIT}") 49 | 50 | if (pthread_setname_np_takes_id) 51 | set(thread_naming_defines 52 | ${thread_naming_defines} 53 | PTHREAD_SETNAME_NP_TAKES_ID) 54 | endif () 55 | endif () 56 | 57 | if (have_pthread_set_name_np) 58 | set(thread_naming_defines 59 | ${thread_naming_defines} 60 | HAVE_PTHREAD_SET_NAME_NP) 61 | endif () 62 | endif () 63 | 64 | cmake_push_check_state() 65 | check_function_exists(setproctitle have_setproctitle) 66 | cmake_pop_check_state() 67 | 68 | if (have_setproctitle) 69 | set(thread_naming_defines 70 | ${thread_naming_defines} 71 | HAVE_SETPROCTITLE) 72 | endif () 73 | -------------------------------------------------------------------------------- /src/sprokit/pipeline/types.cxx: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011, 2013 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include "types.h" 32 | 33 | /** 34 | * \file types.cxx 35 | * 36 | * \brief Implementation of base type logic. 37 | */ 38 | 39 | namespace sprokit 40 | { 41 | 42 | pipeline_exception 43 | ::pipeline_exception() SPROKIT_NOTHROW 44 | : std::exception() 45 | , m_what() 46 | { 47 | } 48 | 49 | pipeline_exception 50 | ::~pipeline_exception() SPROKIT_NOTHROW 51 | { 52 | } 53 | 54 | char const* 55 | pipeline_exception 56 | ::what() const SPROKIT_NOTHROW 57 | { 58 | return m_what.c_str(); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/sprokit/pipeline_util/doc/pipeline_util.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \mainpage Pipeline Utilities Documentation 3 | * 4 | * \section introduction Introduction 5 | * 6 | * \todo Write introduction. 7 | */ 8 | -------------------------------------------------------------------------------- /src/sprokit/pipeline_util/include-paths.h.in: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2012 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_PIPELINE_UTIL_INCLUDE_PATHS_H 32 | #define SPROKIT_PIPELINE_UTIL_INCLUDE_PATHS_H 33 | 34 | #define DEFAULT_PIPE_INCLUDE_PATHS "@SPROKIT_DEFAULT_PIPE_INCLUDE_PATHS@" 35 | 36 | #endif // SPROKIT_PIPELINE_UTIL_INCLUDE_PATHS_H 37 | -------------------------------------------------------------------------------- /src/sprokit/pipeline_util/path.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011-2013 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_PIPELINE_UTIL_PATH_H 32 | #define SPROKIT_PIPELINE_UTIL_PATH_H 33 | 34 | #ifndef BOOST_FILESYSTEM_NO_DEPRECATED 35 | #define BOOST_FILESYSTEM_NO_DEPRECATED 36 | #endif 37 | 38 | // XXX(boost): 1.50.0 39 | #ifndef BOOST_FILESYSTEM_VERSION 40 | #define BOOST_FILESYSTEM_VERSION 3 41 | #else 42 | #if BOOST_FILESYSTEM_VERSION == 2 43 | #error "Only boost::filesystem version 3 is supported." 44 | #endif 45 | #endif 46 | 47 | #include 48 | 49 | #include 50 | 51 | /** 52 | * \file path.h 53 | * 54 | * \brief Types for paths. 55 | */ 56 | 57 | namespace sprokit 58 | { 59 | 60 | /// A path on the filesystem. 61 | typedef boost::filesystem::path path_t; 62 | /// A collection of paths on the filesystem. 63 | typedef std::vector paths_t; 64 | 65 | } 66 | 67 | #endif // SPROKIT_PIPELINE_UTIL_PATH_H 68 | -------------------------------------------------------------------------------- /src/sprokit/pipeline_util/pipeline_util-config.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011, 2013-2014 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_PIPELINE_UTIL_PIPELINE_UTIL_CONFIG_H 32 | #define SPROKIT_PIPELINE_UTIL_PIPELINE_UTIL_CONFIG_H 33 | 34 | #include 35 | 36 | /** 37 | * \file pipeline_util-config.h 38 | * 39 | * \brief Defines for symbol visibility in pipeline_util. 40 | */ 41 | 42 | #ifdef MAKE_SPROKIT_PIPELINE_UTIL_LIB 43 | /// Export the symbol if building the library. 44 | #define SPROKIT_PIPELINE_UTIL_EXPORT SPROKIT_EXPORT 45 | #else 46 | /// Import the symbol if including the library. 47 | #define SPROKIT_PIPELINE_UTIL_EXPORT SPROKIT_IMPORT 48 | #endif 49 | 50 | /// Hide the symbol from the library interface. 51 | #define SPROKIT_PIPELINE_UTIL_NO_EXPORT SPROKIT_NO_EXPORT 52 | 53 | /// Mark as deprecated. 54 | #define SPROKIT_PIPELINE_UTIL_EXPORT_DEPRECATED SPROKIT_DEPRECATED SPROKIT_PIPELINE_UTIL_EXPORT 55 | 56 | #endif // SPROKIT_PIPELINE_UTIL_PIPELINE_UTIL_CONFIG_H 57 | -------------------------------------------------------------------------------- /src/sprokit/pipeline_util/sprokit-pipeline_util.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | includedir=${prefix}/include 4 | libdir=${prefix}/lib@LIB_SUFFIX@ 5 | sprokitpipeincludedirs=${prefix}/share/sprokit/include 6 | 7 | Name: sprokit-pipeline_util 8 | Description: The sprokit-pipeline_util library 9 | Version: @sprokit_version@ 10 | Requires: sprokit-pipeline = @sprokit_version@ 11 | Libs: -lsprokit_pipeline_util 12 | -------------------------------------------------------------------------------- /src/sprokit/python/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(boost_python_library 2 | python) 3 | 4 | if (SPROKIT_ENABLE_PYTHON3) 5 | set(boost_python_library 6 | python3) 7 | endif () 8 | 9 | string(TOUPPER ${boost_python_library} boost_python_library_upper) 10 | set(boost_python_library_var 11 | Boost_${boost_python_library_upper}_LIBRARY) 12 | 13 | find_package(Boost ${sprokit_boost_version} REQUIRED 14 | COMPONENTS 15 | iostreams 16 | ${boost_python_library}) 17 | 18 | find_package(PythonLibs ${PYTHON_VERSION} REQUIRED) 19 | include_directories(SYSTEM ${PYTHON_INCLUDE_DIR}) 20 | 21 | find_package(PythonInterp ${PYTHON_VERSION}) 22 | 23 | add_subdirectory(util) 24 | add_subdirectory(any_conversion) 25 | 26 | sprokit_create_doxygen( 27 | "${CMAKE_CURRENT_SOURCE_DIR}" 28 | python) 29 | -------------------------------------------------------------------------------- /src/sprokit/python/any_conversion/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_python_any_conversion) 2 | 3 | set(python_any_conversion_srcs 4 | registration.cxx) 5 | 6 | set(python_any_conversion_headers 7 | any_conversion-config.h 8 | prototypes.h 9 | registration.h) 10 | 11 | # XXX: Force building shared (see src/sprokit/pipeline/CMakeLists.txt as to why 12 | # this must be done). 13 | sprokit_add_library(sprokit_python_any_conversion SHARED 14 | ${python_any_conversion_srcs} 15 | ${python_any_conversion_headers}) 16 | target_link_libraries(sprokit_python_any_conversion 17 | LINK_PUBLIC 18 | sprokit_python_util 19 | ${${boost_python_library_var}} 20 | ${PYTHON_LIBRARIES} 21 | LINK_PRIVATE 22 | ${Boost_THREAD_LIBRARY} 23 | ${Boost_CHRONO_LIBRARY} 24 | ${Boost_SYSTEM_LIBRARY} 25 | ${Boost_SYSTEM_LIBRARY} 26 | ${CMAKE_THREAD_LIBS_INIT}) 27 | set_target_properties(sprokit_python_any_conversion 28 | PROPERTIES 29 | VERSION ${sprokit_version} 30 | SOVERSION 0 31 | DEFINE_SYMBOL MAKE_SPROKIT_PYTHON_ANY_CONVERSION_LIB) 32 | 33 | sprokit_install_headers(sprokit/python/any_conversion ${python_any_conversion_headers}) 34 | 35 | sprokit_configure_pkgconfig(sprokit-python_any_conversion 36 | PYTHON_VERSION) 37 | -------------------------------------------------------------------------------- /src/sprokit/python/any_conversion/any_conversion-config.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011, 2013-2014 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_PYTHON_ANY_CONVERSION_ANY_CONVERSION_CONFIG_H 32 | #define SPROKIT_PYTHON_ANY_CONVERSION_ANY_CONVERSION_CONFIG_H 33 | 34 | #include 35 | 36 | /** 37 | * \file any_conversion-config.h 38 | * 39 | * \brief Defines for symbol visibility in any_conversion. 40 | */ 41 | 42 | #ifdef MAKE_SPROKIT_PYTHON_ANY_CONVERSION_LIB 43 | /// Export the symbol if building the library. 44 | #define SPROKIT_PYTHON_ANY_CONVERSION_EXPORT SPROKIT_EXPORT 45 | #else 46 | /// Import the symbol if including the library. 47 | #define SPROKIT_PYTHON_ANY_CONVERSION_EXPORT SPROKIT_IMPORT 48 | #endif 49 | 50 | /// Hide the symbol from the library interface. 51 | #define SPROKIT_PYTHON_ANY_CONVERSION_NO_EXPORT SPROKIT_NO_EXPORT 52 | 53 | /// Mark as deprecated. 54 | #define SPROKIT_PYTHON_ANY_CONVERSION_EXPORT_DEPRECATED SPROKIT_DEPRECATED SPROKIT_PYTHON_ANY_CONVERSION_EXPORT 55 | 56 | #endif // SPROKIT_PYTHON_ANY_CONVERSION_ANY_CONVERSION_CONFIG_H 57 | -------------------------------------------------------------------------------- /src/sprokit/python/any_conversion/sprokit-python_any_conversion.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | includedir=${prefix}/include 4 | libdir=${prefix}/lib@LIB_SUFFIX@ 5 | 6 | Name: sprokit-python_any_conversion 7 | Description: The sprokit-python_any_conversion library 8 | Version: @sprokit_version@ 9 | Requires: sprokit = @sprokit_version@ 10 | Libs: -lsprokit_python_any_conversion 11 | -------------------------------------------------------------------------------- /src/sprokit/python/util/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_python_util) 2 | 3 | set(python_util_srcs 4 | pystream.cxx 5 | python_allow_threads.cxx 6 | python_exceptions.cxx 7 | python_gil.cxx 8 | python_threading.cxx) 9 | 10 | set(python_util_headers 11 | pystream.h 12 | python_allow_threads.h 13 | python_convert_optional.h 14 | python_exceptions.h 15 | python_gil.h 16 | python_threading.h 17 | python_wrap_const_shared_ptr.h 18 | set_indexing_suite.h 19 | util-config.h) 20 | 21 | sprokit_add_library(sprokit_python_util 22 | ${python_util_srcs} 23 | ${python_util_headers}) 24 | target_link_libraries(sprokit_python_util 25 | LINK_PUBLIC 26 | ${${boost_python_library_var}} 27 | ${PYTHON_LIBRARIES} 28 | LINK_PRIVATE 29 | ${Boost_IOSTREAMS_LIBRARY} 30 | ${Boost_SYSTEM_LIBRARY}) 31 | set_target_properties(sprokit_python_util 32 | PROPERTIES 33 | VERSION ${sprokit_version} 34 | SOVERSION 0 35 | DEFINE_SYMBOL MAKE_SPROKIT_PYTHON_UTIL_LIB) 36 | 37 | sprokit_install_headers(sprokit/python/util ${python_util_headers}) 38 | 39 | sprokit_configure_pkgconfig(sprokit-python_util 40 | PYTHON_VERSION) 41 | -------------------------------------------------------------------------------- /src/sprokit/python/util/python_allow_threads.cxx: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2012 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include "python_allow_threads.h" 32 | 33 | /** 34 | * \file python_allow_threads.cxx 35 | * 36 | * \brief RAII class for calling into non-Python code. 37 | */ 38 | 39 | namespace sprokit 40 | { 41 | 42 | namespace python 43 | { 44 | 45 | python_allow_threads 46 | ::python_allow_threads(bool save) 47 | : thread(save ? PyEval_SaveThread() : NULL) 48 | { 49 | } 50 | 51 | python_allow_threads 52 | ::~python_allow_threads() 53 | { 54 | release(); 55 | } 56 | 57 | void 58 | python_allow_threads 59 | ::release() 60 | { 61 | if (thread) 62 | { 63 | PyEval_RestoreThread(thread); 64 | thread = NULL; 65 | } 66 | } 67 | 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /src/sprokit/python/util/python_exceptions.cxx: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2012-2013 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include "python_exceptions.h" 32 | 33 | #include 34 | 35 | namespace sprokit 36 | { 37 | 38 | namespace python 39 | { 40 | 41 | void 42 | python_print_exception() 43 | { 44 | PyObject* type; 45 | PyObject* value; 46 | PyObject* traceback; 47 | 48 | // Increments refcounts for returns. 49 | PyErr_Fetch(&type, &value, &traceback); 50 | 51 | // Increment ourselves. 52 | Py_XINCREF(type); 53 | Py_XINCREF(value); 54 | Py_XINCREF(traceback); 55 | 56 | // Put the error back (decrements refcounts). 57 | PyErr_Restore(type, value, traceback); 58 | 59 | // Print the error (also clears it). 60 | PyErr_PrintEx(0); 61 | 62 | // Put the error back for everyone else. 63 | PyErr_Restore(type, value, traceback); 64 | } 65 | 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/sprokit/python/util/python_gil.cxx: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011-2012 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include "python_gil.h" 32 | 33 | namespace sprokit 34 | { 35 | 36 | namespace python 37 | { 38 | 39 | python_gil 40 | ::python_gil() 41 | : state(PyGILState_Ensure()) 42 | { 43 | } 44 | 45 | python_gil 46 | ::~python_gil() 47 | { 48 | PyGILState_Release(state); 49 | } 50 | 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/sprokit/python/util/python_gil.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011-2012 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_PYTHON_UTIL_PYTHON_GIL_H 32 | #define SPROKIT_PYTHON_UTIL_PYTHON_GIL_H 33 | 34 | #include "util-config.h" 35 | 36 | #include 37 | 38 | #include 39 | 40 | /** 41 | * \file python_gil.h 42 | * 43 | * \brief RAII class for grabbing the Python GIL. 44 | */ 45 | 46 | namespace sprokit 47 | { 48 | 49 | namespace python 50 | { 51 | 52 | /** 53 | * \class python_gil python_gil.h 54 | * 55 | * \brief Grabs the Python GIL and uses RAII to ensure it is released. 56 | */ 57 | class SPROKIT_PYTHON_UTIL_EXPORT python_gil 58 | : boost::noncopyable 59 | { 60 | public: 61 | /** 62 | * \brief Constructor. 63 | */ 64 | python_gil(); 65 | /** 66 | * \brief Destructor. 67 | */ 68 | ~python_gil(); 69 | private: 70 | PyGILState_STATE const state; 71 | }; 72 | 73 | } 74 | 75 | } 76 | 77 | #endif // SPROKIT_PYTHON_UTIL_PYTHON_GIL_H 78 | -------------------------------------------------------------------------------- /src/sprokit/python/util/python_threading.cxx: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011-2013 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include "python_threading.h" 32 | 33 | #include 34 | 35 | namespace sprokit 36 | { 37 | 38 | namespace python 39 | { 40 | 41 | python_threading 42 | ::python_threading() 43 | { 44 | if (!PyEval_ThreadsInitialized()) 45 | { 46 | PyEval_InitThreads(); 47 | } 48 | } 49 | 50 | python_threading 51 | ::~python_threading() 52 | { 53 | } 54 | 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/sprokit/python/util/python_threading.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011-2013 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_PYTHON_UTIL_PYTHON_THREADING_H 32 | #define SPROKIT_PYTHON_UTIL_PYTHON_THREADING_H 33 | 34 | #include "util-config.h" 35 | 36 | namespace sprokit 37 | { 38 | 39 | namespace python 40 | { 41 | 42 | class SPROKIT_PYTHON_UTIL_EXPORT python_threading 43 | { 44 | public: 45 | python_threading(); 46 | virtual ~python_threading(); 47 | }; 48 | 49 | } 50 | 51 | } 52 | 53 | #endif // SPROKIT_PYTHON_UTIL_PYTHON_THREADING_H 54 | -------------------------------------------------------------------------------- /src/sprokit/python/util/python_wrap_const_shared_ptr.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2011-2013 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_PYTHON_UTIL_PYTHON_WRAP_CONST_SHARED_PTR_H 32 | #define SPROKIT_PYTHON_UTIL_PYTHON_WRAP_CONST_SHARED_PTR_H 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | // Retrieved from http://mail.python.org/pipermail/cplusplus-sig/2006-November/011329.html 39 | namespace boost 40 | { 41 | 42 | namespace python 43 | { 44 | 45 | template 46 | inline 47 | T* 48 | get_pointer(boost::shared_ptr const& p) 49 | { 50 | return const_cast(p.get()); 51 | } 52 | 53 | template 54 | struct pointee > 55 | { 56 | typedef T type; 57 | }; 58 | 59 | // Don't hide other get_pointer instances. 60 | using boost::python::get_pointer; 61 | using boost::get_pointer; 62 | 63 | } 64 | 65 | } 66 | 67 | #endif // SPROKIT_PYTHON_UTIL_PYTHON_WRAP_CONST_SHARED_PTR_H 68 | -------------------------------------------------------------------------------- /src/sprokit/python/util/sprokit-python_util.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | includedir=${prefix}/include 4 | libdir=${prefix}/lib@LIB_SUFFIX@ 5 | 6 | Name: sprokit-python_any_conversion 7 | Description: The sprokit-python_any_conversion library 8 | Version: @sprokit_version@ 9 | Requires: sprokit = @sprokit_version@ 10 | Libs: -lsprokit_python_any_conversion 11 | -------------------------------------------------------------------------------- /src/sprokit/python/util/util-config.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2012-2014 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_PYTHON_UTIL_UTIL_CONFIG_H 32 | #define SPROKIT_PYTHON_UTIL_UTIL_CONFIG_H 33 | 34 | #include 35 | 36 | /** 37 | * \file util-config.h 38 | * 39 | * \brief Defines for symbol visibility in util. 40 | */ 41 | 42 | #ifdef MAKE_SPROKIT_PYTHON_UTIL_LIB 43 | /// Export the symbol if building the library. 44 | #define SPROKIT_PYTHON_UTIL_EXPORT SPROKIT_EXPORT 45 | #else 46 | /// Import the symbol if including the library. 47 | #define SPROKIT_PYTHON_UTIL_EXPORT SPROKIT_IMPORT 48 | #endif 49 | 50 | /// Hide the symbol from the library interface. 51 | #define SPROKIT_PYTHON_UTIL_NO_EXPORT SPROKIT_NO_EXPORT 52 | 53 | /// Mark as deprecated. 54 | #define SPROKIT_PYTHON_UTIL_EXPORT_DEPRECATED SPROKIT_DEPRECATED SPROKIT_PYTHON_UTIL_EXPORT 55 | 56 | #endif // SPROKIT_PYTHON_UTIL_UTIL_CONFIG_H 57 | -------------------------------------------------------------------------------- /src/sprokit/scoring/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_scoring) 2 | 3 | set(scoring_srcs 4 | statistics.cxx) 5 | 6 | set(scoring_headers 7 | scoring-config.h 8 | statistics.h) 9 | 10 | sprokit_add_library(sprokit_scoring 11 | ${scoring_srcs} 12 | ${scoring_headers}) 13 | set_target_properties(sprokit_scoring 14 | PROPERTIES 15 | VERSION ${sprokit_version} 16 | SOVERSION 0 17 | DEFINE_SYMBOL MAKE_SPROKIT_SCORING_LIB) 18 | 19 | sprokit_create_doxygen( 20 | "${CMAKE_CURRENT_SOURCE_DIR}" 21 | scoring) 22 | 23 | sprokit_install_headers(sprokit/scoring ${scoring_headers}) 24 | 25 | sprokit_configure_pkgconfig(sprokit-scoring) 26 | -------------------------------------------------------------------------------- /src/sprokit/scoring/scoring-config.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2012-2014 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_SCORING_SCORING_CONFIG_H 32 | #define SPROKIT_SCORING_SCORING_CONFIG_H 33 | 34 | #include 35 | 36 | /** 37 | * \file scoring-config.h 38 | * 39 | * \brief Defines for symbol visibility in scoring. 40 | */ 41 | 42 | #ifdef MAKE_SPROKIT_SCORING_LIB 43 | /// Export the symbol if building the library. 44 | #define SPROKIT_SCORING_EXPORT SPROKIT_EXPORT 45 | #else 46 | /// Import the symbol if including the library. 47 | #define SPROKIT_SCORING_EXPORT SPROKIT_IMPORT 48 | #endif 49 | 50 | /// Hide the symbol from the library interface. 51 | #define SPROKIT_SCORING_NO_EXPORT SPROKIT_NO_EXPORT 52 | 53 | /// Mark as deprecated. 54 | #define SPROKIT_SCORING_EXPORT_DEPRECATED SPROKIT_DEPRECATED SPROKIT_SCORING_EXPORT 55 | 56 | #endif // SPROKIT_SCORING_SCORING_CONFIG_H 57 | -------------------------------------------------------------------------------- /src/sprokit/scoring/sprokit-scoring.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | includedir=${prefix}/include 4 | libdir=${prefix}/lib@LIB_SUFFIX@ 5 | 6 | Name: sprokit-scoring 7 | Description: The sprokit-scoring library 8 | Version: @sprokit_version@ 9 | Requires: sprokit = @sprokit_version@ 10 | Libs: -lsprokit_scoring 11 | -------------------------------------------------------------------------------- /src/sprokit/tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_tools) 2 | 3 | sprokit_use_tools_fixes() 4 | 5 | set(tools_srcs 6 | pipeline_builder.cxx 7 | tool_io.cxx 8 | tool_usage.cxx) 9 | 10 | set(tools_headers 11 | literal_pipeline.h 12 | pipeline_builder.h 13 | tool_io.h 14 | tool_main.h 15 | tool_usage.h 16 | tools-config.h) 17 | 18 | sprokit_add_library(sprokit_tools 19 | ${tools_srcs} 20 | ${tools_headers}) 21 | target_link_libraries(sprokit_tools 22 | LINK_PUBLIC 23 | sprokit_pipeline_util 24 | sprokit_pipeline 25 | ${Boost_PROGRAM_OPTIONS_LIBRARY} 26 | LINK_PRIVATE 27 | ${Boost_FILESYSTEM_LIBRARY} 28 | ${Boost_SYSTEM_LIBRARY}) 29 | set_target_properties(sprokit_tools 30 | PROPERTIES 31 | VERSION ${sprokit_version} 32 | SOVERSION 0 33 | DEFINE_SYMBOL MAKE_SPROKIT_TOOLS_LIB) 34 | sprokit_require_tools_fixes(sprokit_tools) 35 | 36 | sprokit_create_doxygen( 37 | "${CMAKE_CURRENT_SOURCE_DIR}" 38 | tools) 39 | 40 | sprokit_install_headers(sprokit/tools ${tools_headers}) 41 | 42 | sprokit_configure_pkgconfig(sprokit-tools) 43 | -------------------------------------------------------------------------------- /src/sprokit/tools/sprokit-tools.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | includedir=${prefix}/include 4 | libdir=${prefix}/lib@LIB_SUFFIX@ 5 | 6 | Name: sprokit-tools 7 | Description: The sprokit-tools library 8 | Version: @sprokit_version@ 9 | Requires: sprokit = @sprokit_version@ 10 | Libs: -lsprokit_tools 11 | -------------------------------------------------------------------------------- /src/sprokit/tools/tool_io.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2013 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_TOOLS_TOOL_IO_H 32 | #define SPROKIT_TOOLS_TOOL_IO_H 33 | 34 | #include "tools-config.h" 35 | 36 | #include 37 | 38 | #include 39 | 40 | #include 41 | #include 42 | 43 | namespace sprokit 44 | { 45 | 46 | typedef boost::shared_ptr istream_t; 47 | typedef boost::shared_ptr ostream_t; 48 | 49 | SPROKIT_TOOLS_EXPORT istream_t open_istream(sprokit::path_t const& path); 50 | SPROKIT_TOOLS_EXPORT ostream_t open_ostream(sprokit::path_t const& path); 51 | 52 | } 53 | 54 | #endif // SPROKIT_TOOLS_TOOL_IO_H 55 | -------------------------------------------------------------------------------- /src/sprokit/tools/tool_usage.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2012-2013 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_TOOLS_TOOL_USAGE_H 32 | #define SPROKIT_TOOLS_TOOL_USAGE_H 33 | 34 | #include "tools-config.h" 35 | 36 | #include 37 | #include 38 | 39 | namespace sprokit 40 | { 41 | 42 | SPROKIT_TOOLS_EXPORT SPROKIT_NO_RETURN void tool_usage(int ret, boost::program_options::options_description const& options); 43 | SPROKIT_TOOLS_EXPORT void tool_version_message(); 44 | 45 | SPROKIT_TOOLS_EXPORT boost::program_options::options_description tool_common_options(); 46 | 47 | SPROKIT_TOOLS_EXPORT boost::program_options::variables_map tool_parse( 48 | int argc, char const* argv[], 49 | boost::program_options::options_description const& desc, 50 | std::string const& program_description); 51 | 52 | } 53 | 54 | #endif // SPROKIT_TOOLS_TOOL_USAGE_H 55 | -------------------------------------------------------------------------------- /src/sprokit/tools/tools-config.h: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2012-2014 by Kitware, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef SPROKIT_TOOLS_TOOLS_CONFIG_H 32 | #define SPROKIT_TOOLS_TOOLS_CONFIG_H 33 | 34 | #include 35 | 36 | /** 37 | * \file scoring-config.h 38 | * 39 | * \brief Defines for symbol visibility in scoring. 40 | */ 41 | 42 | #ifdef MAKE_SPROKIT_TOOLS_LIB 43 | /// Export the symbol if building the library. 44 | #define SPROKIT_TOOLS_EXPORT SPROKIT_EXPORT 45 | #else 46 | /// Import the symbol if including the library. 47 | #define SPROKIT_TOOLS_EXPORT SPROKIT_IMPORT 48 | #endif 49 | 50 | /// Hide the symbol from the library interface. 51 | #define SPROKIT_TOOLS_NO_EXPORT SPROKIT_NO_EXPORT 52 | 53 | /// Mark as deprecated. 54 | #define SPROKIT_TOOLS_EXPORT_DEPRECATED SPROKIT_DEPRECATED SPROKIT_TOOLS_EXPORT 55 | 56 | #endif // SPROKIT_TOOLS_TOOLS_CONFIG_H 57 | -------------------------------------------------------------------------------- /src/tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_tools) 2 | 3 | add_subdirectory(pipelines) 4 | 5 | sprokit_use_tools_fixes() 6 | 7 | function (add_tool name) 8 | set(component tool) 9 | 10 | sprokit_add_executable(${name} 11 | ${name}.cxx) 12 | target_link_libraries(${name} 13 | LINK_PRIVATE 14 | ${ARGN}) 15 | sprokit_require_tools_fixes(${name}) 16 | endfunction () 17 | 18 | function (add_python_tool name) 19 | if (SPROKIT_ENABLE_PYTHON) 20 | sprokit_configure_file(tool-python-${name} 21 | "${CMAKE_CURRENT_SOURCE_DIR}/${name}.py" 22 | "${sprokit_binary_dir}/bin/${name}" 23 | PYTHON_EXECUTABLE) 24 | 25 | sprokit_install( 26 | PROGRAMS "${sprokit_binary_dir}/bin/${name}" 27 | DESTINATION bin 28 | COMPONENT tool) 29 | endif () 30 | endfunction () 31 | 32 | add_tool(pipe_config 33 | sprokit_tools 34 | sprokit_pipeline 35 | ${Boost_FILESYSTEM_LIBRARY} 36 | ${Boost_PROGRAM_OPTIONS_LIBRARY} 37 | ${Boost_SYSTEM_LIBRARY}) 38 | 39 | add_tool(pipe_to_dot 40 | sprokit_tools 41 | sprokit_pipeline 42 | ${Boost_FILESYSTEM_LIBRARY} 43 | ${Boost_PROGRAM_OPTIONS_LIBRARY} 44 | ${Boost_SYSTEM_LIBRARY}) 45 | 46 | add_tool(pipeline_runner 47 | sprokit_tools 48 | sprokit_pipeline 49 | ${Boost_FILESYSTEM_LIBRARY} 50 | ${Boost_PROGRAM_OPTIONS_LIBRARY} 51 | ${Boost_SYSTEM_LIBRARY}) 52 | 53 | add_tool(processopedia 54 | sprokit_tools 55 | sprokit_pipeline 56 | ${Boost_FILESYSTEM_LIBRARY} 57 | ${Boost_PROGRAM_OPTIONS_LIBRARY} 58 | ${Boost_SYSTEM_LIBRARY}) 59 | -------------------------------------------------------------------------------- /src/tools/pipelines/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_tools_pipelines) 2 | 3 | add_subdirectory(clusters) 4 | add_subdirectory(include) 5 | 6 | set(pipelines) 7 | 8 | sprokit_install_pipelines(${pipelines}) 9 | -------------------------------------------------------------------------------- /src/tools/pipelines/clusters/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_tools_pipelines_clusters) 2 | 3 | set(pipeline_clusters) 4 | 5 | sprokit_install_clusters(${pipeline_clusters}) 6 | -------------------------------------------------------------------------------- /src/tools/pipelines/include/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_tools_pipelines_include) 2 | 3 | set(pipeline_includes) 4 | 5 | sprokit_install_includes(${pipeline_includes}) 6 | -------------------------------------------------------------------------------- /tests/.NoDartCoverage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kitware/sprokit/6b3f6cf87f625904e9061a447bd16f96800fef77/tests/.NoDartCoverage -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_tests) 2 | 3 | set(no_install TRUE) 4 | 5 | if (WIN32) 6 | # TODO: Output to a different directory and then use $ in the 7 | # working path when generator expressions are supported in test properties. 8 | set(sprokit_test_output_path 9 | "${sprokit_output_dir}/bin") 10 | else () 11 | set(sprokit_test_output_path 12 | "${sprokit_binary_dir}/tests/bin") 13 | set(sprokit_test_working_path 14 | "${sprokit_binary_dir}/tests") 15 | endif () 16 | 17 | include("${sprokit_source_dir}/conf/sprokit-macro-tests.cmake") 18 | include("${sprokit_source_dir}/cmake/support/test.cmake") 19 | 20 | set(sprokit_test_data_directory 21 | "${CMAKE_CURRENT_SOURCE_DIR}/data") 22 | 23 | add_subdirectory(bindings) 24 | 25 | include_directories("${CMAKE_CURRENT_SOURCE_DIR}") 26 | 27 | add_subdirectory(sprokit) 28 | -------------------------------------------------------------------------------- /tests/bindings/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_tests_bindings) 2 | 3 | if (SPROKIT_ENABLE_PYTHON) 4 | add_subdirectory(python) 5 | endif () 6 | -------------------------------------------------------------------------------- /tests/bindings/python/modules/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_test_python_modules) 2 | 3 | ############################## 4 | # Module tests 5 | ############################## 6 | sprokit_discover_python_tests(pymodules test-pymodules.py) 7 | -------------------------------------------------------------------------------- /tests/bindings/python/modules/sprokit/processes/__init__.py: -------------------------------------------------------------------------------- 1 | #ckwg +28 2 | # Copyright 2012 by Kitware, Inc. 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # 11 | # * Redistributions in binary form must reproduce the above copyright notice, 12 | # this list of conditions and the following disclaimer in the documentation 13 | # and/or other materials provided with the distribution. 14 | # 15 | # * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | # to endorse or promote products derived from this software without specific 17 | # prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | from pkgutil import extend_path 32 | __path__ = extend_path(__path__, __name__) 33 | -------------------------------------------------------------------------------- /tests/bindings/python/modules/sprokit/processes/pythonpath_test_process.py: -------------------------------------------------------------------------------- 1 | #ckwg +28 2 | # Copyright 2012 by Kitware, Inc. 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # 11 | # * Redistributions in binary form must reproduce the above copyright notice, 12 | # this list of conditions and the following disclaimer in the documentation 13 | # and/or other materials provided with the distribution. 14 | # 15 | # * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | # to endorse or promote products derived from this software without specific 17 | # prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | from sprokit.pipeline import config 32 | from sprokit.pipeline import process 33 | 34 | 35 | class TestPythonProcess(process.PythonProcess): 36 | def __init__(self, conf): 37 | process.PythonProcess.__init__(self, conf) 38 | 39 | 40 | def __sprokit_register__(): 41 | from sprokit.pipeline import process_registry 42 | 43 | module_name = 'python:test.pythonpath.test' 44 | 45 | reg = process_registry.ProcessRegistry.self() 46 | 47 | if reg.is_module_loaded(module_name): 48 | return 49 | 50 | reg.register_process('pythonpath_test_process', 'A test process.', TestPythonProcess) 51 | 52 | reg.mark_module_as_loaded(module_name) 53 | -------------------------------------------------------------------------------- /tests/bindings/python/modules/sprokit/schedulers/__init__.py: -------------------------------------------------------------------------------- 1 | #ckwg +28 2 | # Copyright 2012 by Kitware, Inc. 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # 11 | # * Redistributions in binary form must reproduce the above copyright notice, 12 | # this list of conditions and the following disclaimer in the documentation 13 | # and/or other materials provided with the distribution. 14 | # 15 | # * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | # to endorse or promote products derived from this software without specific 17 | # prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | from pkgutil import extend_path 32 | __path__ = extend_path(__path__, __name__) 33 | -------------------------------------------------------------------------------- /tests/bindings/python/modules/sprokit/schedulers/pythonpath_test_scheduler.py: -------------------------------------------------------------------------------- 1 | #ckwg +28 2 | # Copyright 2012 by Kitware, Inc. 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # 11 | # * Redistributions in binary form must reproduce the above copyright notice, 12 | # this list of conditions and the following disclaimer in the documentation 13 | # and/or other materials provided with the distribution. 14 | # 15 | # * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | # to endorse or promote products derived from this software without specific 17 | # prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | from sprokit.pipeline import config 32 | from sprokit.pipeline import pipeline 33 | from sprokit.pipeline import scheduler 34 | 35 | 36 | class TestPythonScheduler(scheduler.PythonScheduler): 37 | def __init__(self, conf, pipe): 38 | scheduler.PythonScheduler.__init__(self, conf, pipe) 39 | 40 | 41 | def __sprokit_register__(): 42 | from sprokit.pipeline import scheduler_registry 43 | 44 | module_name = 'python:test.pythonpath.test' 45 | 46 | reg = scheduler_registry.SchedulerRegistry.self() 47 | 48 | if reg.is_module_loaded(module_name): 49 | return 50 | 51 | reg.register_scheduler('pythonpath_test_scheduler', 'A test scheduler.', TestPythonScheduler) 52 | 53 | reg.mark_module_as_loaded(module_name) 54 | -------------------------------------------------------------------------------- /tests/bindings/python/sprokit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_test_python_sprokit) 2 | 3 | add_subdirectory(pipeline) 4 | add_subdirectory(pipeline_util) 5 | -------------------------------------------------------------------------------- /tests/bindings/python/sprokit/pipeline/test-modules.py: -------------------------------------------------------------------------------- 1 | #!@PYTHON_EXECUTABLE@ 2 | #ckwg +28 3 | # Copyright 2011-2013 by Kitware, Inc. 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # 9 | # * Redistributions of source code must retain the above copyright notice, 10 | # this list of conditions and the following disclaimer. 11 | # 12 | # * Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 16 | # * Neither name of Kitware, Inc. nor the names of any contributors may be used 17 | # to endorse or promote products derived from this software without specific 18 | # prior written permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 21 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 24 | # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | 32 | def test_import(): 33 | try: 34 | import sprokit.pipeline.modules 35 | except: 36 | test_error("Failed to import the modules module") 37 | 38 | 39 | def test_load(): 40 | from sprokit.pipeline import modules 41 | 42 | modules.load_known_modules() 43 | 44 | 45 | if __name__ == '__main__': 46 | import os 47 | import sys 48 | 49 | if not len(sys.argv) == 4: 50 | test_error("Expected three arguments") 51 | sys.exit(1) 52 | 53 | testname = sys.argv[1] 54 | 55 | os.chdir(sys.argv[2]) 56 | 57 | sys.path.append(sys.argv[3]) 58 | 59 | from sprokit.test.test import * 60 | 61 | run_test(testname, find_tests(locals())) 62 | -------------------------------------------------------------------------------- /tests/bindings/python/sprokit/pipeline/test-scheduler.py: -------------------------------------------------------------------------------- 1 | #!@PYTHON_EXECUTABLE@ 2 | #ckwg +28 3 | # Copyright 2011-2013 by Kitware, Inc. 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # 9 | # * Redistributions of source code must retain the above copyright notice, 10 | # this list of conditions and the following disclaimer. 11 | # 12 | # * Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 16 | # * Neither name of Kitware, Inc. nor the names of any contributors may be used 17 | # to endorse or promote products derived from this software without specific 18 | # prior written permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 21 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 24 | # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | 32 | def test_import(): 33 | try: 34 | import sprokit.pipeline.scheduler 35 | except: 36 | test_error("Failed to import the scheduler module") 37 | 38 | 39 | if __name__ == '__main__': 40 | import os 41 | import sys 42 | 43 | if not len(sys.argv) == 4: 44 | test_error("Expected three arguments") 45 | sys.exit(1) 46 | 47 | testname = sys.argv[1] 48 | 49 | os.chdir(sys.argv[2]) 50 | 51 | sys.path.append(sys.argv[3]) 52 | 53 | from sprokit.test.test import * 54 | 55 | run_test(testname, find_tests(locals())) 56 | -------------------------------------------------------------------------------- /tests/bindings/python/sprokit/pipeline/test-utils.py: -------------------------------------------------------------------------------- 1 | #!@PYTHON_EXECUTABLE@ 2 | #ckwg +28 3 | # Copyright 2011-2013 by Kitware, Inc. 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # 9 | # * Redistributions of source code must retain the above copyright notice, 10 | # this list of conditions and the following disclaimer. 11 | # 12 | # * Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 16 | # * Neither name of Kitware, Inc. nor the names of any contributors may be used 17 | # to endorse or promote products derived from this software without specific 18 | # prior written permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 21 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 24 | # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | 32 | def test_import(): 33 | try: 34 | import sprokit.pipeline.utils 35 | except: 36 | test_error("Failed to import the utils module") 37 | 38 | 39 | def test_create(): 40 | from sprokit.pipeline import utils 41 | 42 | utils.ThreadName() 43 | 44 | 45 | def test_name_thread(): 46 | from sprokit.pipeline import utils 47 | 48 | utils.name_thread("a_name") 49 | 50 | 51 | if __name__ == '__main__': 52 | import os 53 | import sys 54 | 55 | if not len(sys.argv) == 4: 56 | test_error("Expected three arguments") 57 | sys.exit(1) 58 | 59 | testname = sys.argv[1] 60 | 61 | os.chdir(sys.argv[2]) 62 | 63 | sys.path.append(sys.argv[3]) 64 | 65 | from sprokit.test.test import * 66 | 67 | run_test(testname, find_tests(locals())) 68 | -------------------------------------------------------------------------------- /tests/bindings/python/sprokit/pipeline_util/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_test_python_sprokit_pipeline_util) 2 | 3 | set(sprokit_test_pipelines_directory 4 | "${sprokit_test_data_directory}/pipelines") 5 | 6 | ############################## 7 | # Bake tests 8 | ############################## 9 | sprokit_discover_python_tests(bake test-bake.py 10 | "${sprokit_test_pipelines_directory}") 11 | 12 | ############################## 13 | # Export tests 14 | ############################## 15 | sprokit_discover_python_tests(export_ test-export_.py 16 | "${sprokit_test_pipelines_directory}") 17 | 18 | ############################## 19 | # Load tests 20 | ############################## 21 | sprokit_discover_python_tests(load test-load.py 22 | "${sprokit_test_pipelines_directory}") 23 | -------------------------------------------------------------------------------- /tests/bindings/python/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_test_python_test) 2 | 3 | sprokit_discover_python_tests(test test-test.py) 4 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_all.pipe: -------------------------------------------------------------------------------- 1 | cluster mycluster 2 | :# clusterdesc 3 | :# configdesc 4 | :mykey myvalue 5 | :# iport desc 6 | imap from iport 7 | to myproc.iport 8 | to myproc.iport2 9 | :# oport desc 10 | omap from myproc.oport 11 | to oport 12 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_config.pipe: -------------------------------------------------------------------------------- 1 | cluster mycluster 2 | :# clusterdesc 3 | :# configdesc 4 | :mykey myvalue 5 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_configuration_default.pipe: -------------------------------------------------------------------------------- 1 | cluster configuration_default 2 | :# Multiply a number by a constant factor. 3 | :# The factor to multiply by. 4 | imap from factor 5 | to multiply.factor1 6 | :# The product. 7 | omap from multiply.product 8 | to product 9 | 10 | process const 11 | :: const_number 12 | :value 20 13 | 14 | process multiply 15 | :: multiplication 16 | 17 | connect from const.number 18 | to multiply.factor2 19 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_configuration_provide.pipe: -------------------------------------------------------------------------------- 1 | cluster configuration_provide 2 | :# Multiply a number by a constant factor. 3 | :# The constant factor to multiply by. 4 | :factor 20 5 | :# The factor to multiply by. 6 | imap from factor 7 | to multiply.factor1 8 | :# The product. 9 | omap from multiply.product 10 | to product 11 | 12 | process const 13 | :: const_number 14 | :value[ro]{CONF} configuration_provide:factor 15 | 16 | process multiply 17 | :: multiplication 18 | 19 | connect from const.number 20 | to multiply.factor2 21 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_declare.pipe: -------------------------------------------------------------------------------- 1 | cluster mycluster 2 | :# clusterdesc 3 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_duplicate_input.pipe: -------------------------------------------------------------------------------- 1 | cluster mycluster 2 | :# clusterdesc 3 | :# iportdesc 4 | imap from iport 5 | to myproc.iport 6 | :# iportdesc 7 | imap from iport 8 | to myproc.iport2 9 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_duplicate_output.pipe: -------------------------------------------------------------------------------- 1 | cluster mycluster 2 | :# clusterdesc 3 | :# oportdesc 4 | omap from myproc.oport 5 | to oport 6 | :# oportdesc 7 | omap from myproc.oport2 8 | to oport 9 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_empty_name.pipe: -------------------------------------------------------------------------------- 1 | cluster multiplier_cluster_test 2 | :# Multiply a number by a constant factor. 3 | :# The constant factor to multiply by. 4 | :factor 20 5 | :# The factor to multiply by. 6 | imap from factor 7 | to multiply.factor1 8 | :# The product. 9 | omap from multiply.product 10 | to product 11 | 12 | process const 13 | :: const_number 14 | :value[ro]{CONF} multiplier_cluster_test:factor 15 | 16 | process multiply 17 | :: multiplication 18 | 19 | connect from const.number 20 | to multiply.factor2 21 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_input_map.pipe: -------------------------------------------------------------------------------- 1 | cluster mycluster 2 | :# clusterdesc 3 | :# iportdesc 4 | imap from iport 5 | to myproc.iport 6 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_input_map_with_slash.pipe: -------------------------------------------------------------------------------- 1 | cluster mycluster 2 | :# clusterdesc 3 | :# iportdesc 4 | imap from iport 5 | to myproc/slash.iport 6 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_input_multi_map.pipe: -------------------------------------------------------------------------------- 1 | cluster mycluster 2 | :# clusterdesc 3 | :# iportdesc 4 | imap from iport 5 | to myproc.iport 6 | to myproc.iport2 7 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_map_config.pipe: -------------------------------------------------------------------------------- 1 | cluster map_config 2 | :# Cluster for map_config testing. 3 | :# A tunable parameter. 4 | :tunable[tunable] unexpected 5 | :# The output. 6 | omap from expect.dummy 7 | to pass 8 | 9 | process expect 10 | :: expect 11 | :tunable[ro]{CONF} map_config:tunable 12 | :expect[ro] expected 13 | 14 | process sink_expect 15 | :: sink 16 | 17 | connect from expect.dummy 18 | to sink_expect.sink 19 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_map_config_modified.pipe: -------------------------------------------------------------------------------- 1 | cluster map_config_modified 2 | :# Cluster for map_config testing. 3 | :# A tunable parameter. 4 | :tunable[tunable] unexpected 5 | :# The output. 6 | omap from expect.dummy 7 | to pass 8 | 9 | process expect 10 | :: expect 11 | :tunable{CONF} map_config_modified:tunable 12 | :tunable[append] _full 13 | :expect[ro] expected_full 14 | 15 | process sink_expect 16 | :: sink 17 | 18 | connect from expect.dummy 19 | to sink_expect.sink 20 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_map_config_not_from_cluster.pipe: -------------------------------------------------------------------------------- 1 | cluster map_config_not_cluster 2 | :# Cluster for map_config testing. 3 | :# A tunable parameter. 4 | :tunable[tunable] unexpected 5 | :# The output. 6 | omap from expect.dummy 7 | to pass 8 | 9 | config dummy 10 | :value expected 11 | 12 | process expect 13 | :: expect 14 | :tunable[ro]{CONF} dummy:value 15 | :expect[ro] expected 16 | 17 | process sink_expect 18 | :: sink 19 | 20 | connect from expect.dummy 21 | to sink_expect.sink 22 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_map_config_not_read_only.pipe: -------------------------------------------------------------------------------- 1 | cluster map_config_not_ro 2 | :# Cluster for map_config testing. 3 | :# A tunable parameter. 4 | :tunable[tunable] expected 5 | :# The output. 6 | omap from expect.dummy 7 | to pass 8 | 9 | process expect 10 | :: expect 11 | :tunable{CONF} map_config_not_ro:tunable 12 | :expect[ro] expected 13 | 14 | process sink_expect 15 | :: sink 16 | 17 | connect from expect.dummy 18 | to sink_expect.sink 19 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_map_config_only_conf_provided.pipe: -------------------------------------------------------------------------------- 1 | cluster map_config_only_conf_provided 2 | :# Cluster for map_config testing. 3 | :# A tunable parameter. 4 | :tunable[tunable] unexpected 5 | :# The output. 6 | omap from expect.dummy 7 | to pass 8 | 9 | process expect 10 | :: expect 11 | :tunable[ro]{ENV} TEST_ENV 12 | :expect[ro] expected 13 | 14 | process sink_expect 15 | :: sink 16 | 17 | connect from expect.dummy 18 | to sink_expect.sink 19 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_map_config_only_provided.pipe: -------------------------------------------------------------------------------- 1 | cluster map_config_only_provided 2 | :# Cluster for map_config testing. 3 | :# A tunable parameter. 4 | :tunable[tunable] expected 5 | :# The output. 6 | omap from expect.dummy 7 | to pass 8 | 9 | process expect 10 | :: expect 11 | :tunable[ro] map_config_only_provided:tunable 12 | :expect[ro] map_config_only_provided:tunable 13 | 14 | process sink_expect 15 | :: sink 16 | 17 | connect from expect.dummy 18 | to sink_expect.sink 19 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_map_config_redirect.pipe: -------------------------------------------------------------------------------- 1 | cluster map_config_redirect 2 | :# Cluster for map_config testing. 3 | :# A tunable parameter. 4 | :tunable[tunable] unexpected 5 | :# The output. 6 | omap from expect.dummy 7 | to pass 8 | 9 | process expect 10 | :: expect 11 | :tunable[ro]{CONF} sink_expect:redirect 12 | :expect[ro] expected 13 | 14 | process sink_expect 15 | :: sink 16 | :redirect[ro]{CONF} map_config_redirect:tunable 17 | 18 | connect from expect.dummy 19 | to sink_expect.sink 20 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_map_config_to_non_process.pipe: -------------------------------------------------------------------------------- 1 | cluster map_config_non_process 2 | :# Cluster for map_config testing. 3 | :# A tunable parameter. 4 | :tunable[tunable] unexpected 5 | :# The output. 6 | omap from expect.dummy 7 | to pass 8 | 9 | config not_a_process 10 | :tunable[ro]{CONF} map_config_non_process:tunable 11 | 12 | process expect 13 | :: expect 14 | :tunable[ro] expected 15 | :expect[ro] expected 16 | 17 | process sink_expect 18 | :: sink 19 | 20 | connect from expect.dummy 21 | to sink_expect.sink 22 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_map_config_tunable.pipe: -------------------------------------------------------------------------------- 1 | cluster map_config_tunable 2 | :# Cluster for map_config testing. 3 | :# A tunable parameter. 4 | :tunable[tunable] unexpected 5 | :# The output. 6 | omap from expect.dummy 7 | to pass 8 | 9 | process expect 10 | :: expect 11 | :tunable[ro]{CONF} map_config_tunable:tunable 12 | :expect[ro] expected 13 | 14 | process sink_expect 15 | :: sink 16 | 17 | connect from expect.dummy 18 | to sink_expect.sink 19 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_mappings.pipe: -------------------------------------------------------------------------------- 1 | cluster mycluster 2 | :# clusterdesc 3 | :# iport desc 4 | imap from iport 5 | to myproc.iport 6 | to myproc.iport2 7 | :# oport desc 8 | omap from myproc.oport 9 | to oport 10 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_missing_config_description.pipe: -------------------------------------------------------------------------------- 1 | cluster mycluster 2 | :# clusterdesc 3 | :mykey myvalue 4 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_missing_input_description.pipe: -------------------------------------------------------------------------------- 1 | cluster mycluster 2 | :# clusterdesc 3 | imap from iport 4 | to proc.iport 5 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_missing_output_description.pipe: -------------------------------------------------------------------------------- 1 | cluster mycluster 2 | :# clusterdesc 3 | omap from myproc.oport 4 | to oport 5 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_missing_ports.pipe: -------------------------------------------------------------------------------- 1 | cluster mycluster 2 | :# clusterdesc 3 | :# configdesc 4 | :mykey myvalue 5 | 6 | process orphan 7 | :: orphan 8 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_missing_processes.pipe: -------------------------------------------------------------------------------- 1 | cluster mycluster 2 | :# clusterdesc 3 | :# configdesc 4 | :mykey myvalue 5 | :# iport desc 6 | imap from iport 7 | to myproc.iport2 8 | :# oport desc 9 | omap from myproc.oport 10 | to oport 11 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_missing_type.pipe: -------------------------------------------------------------------------------- 1 | cluster 2 | :# clusterdesc 3 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_missing_type_description.pipe: -------------------------------------------------------------------------------- 1 | cluster mycluster 2 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_multiple_clusters.pipe: -------------------------------------------------------------------------------- 1 | cluster mycluster 2 | :# clusterdesc 3 | :# oport desc 4 | omap from myproc.oport 5 | to oport 6 | 7 | cluster mycluster2 8 | :# clusterdesc 9 | :# oport desc 10 | omap from myproc.oport 11 | to oport 12 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_multiplier.pipe: -------------------------------------------------------------------------------- 1 | cluster multiplier_cluster_test 2 | :# Multiply a number by a constant factor. 3 | :# The constant factor to multiply by. 4 | :factor 20 5 | :# The factor to multiply by. 6 | imap from factor 7 | to multiply.factor1 8 | :# The product. 9 | omap from multiply.product 10 | to product 11 | 12 | process const 13 | :: const_number 14 | :value[ro]{CONF} multiplier_cluster_test:factor 15 | 16 | process multiply 17 | :: multiplication 18 | 19 | connect from const.number 20 | to multiply.factor2 21 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_not_first.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | 3 | cluster mycluster 4 | :# clusterdesc 5 | :# oport desc 6 | omap from myproc.oport 7 | to oport 8 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_output_map.pipe: -------------------------------------------------------------------------------- 1 | cluster mycluster 2 | :# clusterdesc 3 | :# oport desc 4 | omap from myproc.oport 5 | to oport 6 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_output_map_with_slash.pipe: -------------------------------------------------------------------------------- 1 | cluster mycluster 2 | :# clusterdesc 3 | :# oport desc 4 | omap from myproc/slash.oport 5 | to oport 6 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_override_mapped.pipe: -------------------------------------------------------------------------------- 1 | cluster map_config_override 2 | :# Cluster for map_config testing. 3 | :# A tunable parameter. 4 | :tunable[tunable] expected 5 | :# The output. 6 | omap from expect.dummy 7 | to pass 8 | 9 | process expect 10 | :: expect 11 | :tunable[ro]{CONF} map_config_override:tunable 12 | :expect[ro] expected 13 | 14 | process sink_expect 15 | :: sink 16 | 17 | connect from expect.dummy 18 | to sink_expect.sink 19 | -------------------------------------------------------------------------------- /tests/data/pipelines/cluster_with_slash.pipe: -------------------------------------------------------------------------------- 1 | cluster mycluster/with_slash 2 | :# clusterdesc 3 | -------------------------------------------------------------------------------- /tests/data/pipelines/comments.pipe: -------------------------------------------------------------------------------- 1 | # This is a comment 2 | # This is also a comment 3 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_append.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykey my 3 | :mykey[append] value 4 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_append_comma.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykey myvalue 3 | :mykey[append=comma] othervalue 4 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_append_comma_empty.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykey[append=comma] othervalue 3 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_append_flag_mismatch_ac.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykey myvalue 3 | :mykey[append,append=path] othervalue 4 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_append_flag_mismatch_all.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykey myvalue 3 | :mykey[append,append=comma,append=path] othervalue 4 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_append_flag_mismatch_ap.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykey myvalue 3 | :mykey[append,append=comma] othervalue 4 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_append_flag_mismatch_cp.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykey myvalue 3 | :mykey[append=comma,append=path] othervalue 4 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_append_path.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykey myvalue 3 | :mykey[append=path] othervalue 4 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_append_path_empty.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykey[append=path] othervalue 3 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_append_provided.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykeysource my 3 | :mykey{CONF} myblock:mykeysource 4 | :mykey[append] value 5 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_append_provided_ro.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykeysource my 3 | :mykey{CONF} myblock:mykeysource 4 | :mykey[ro,append] value 5 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_append_ro.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykey my 3 | :mykey[ro,append] value 4 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_append_space.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykey myvalue 3 | :mykey[append=space] othervalue 4 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_append_space_empty.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykey[append=space] othervalue 3 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_block.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykey myvalue 3 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_block_notalnum.pipe: -------------------------------------------------------------------------------- 1 | config my_block 2 | :my-key myvalue 3 | 4 | config my-block 5 | :my_key myothervalue 6 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_dotted_key.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :dotted.key value 3 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_dotted_nested_key.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :dotted:nested.key:subkey value 3 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_not_a_flag.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykey[nosuchflag] myvalue 3 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_overrides.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykey myvalue 3 | 4 | config myblock 5 | :mykey myothervalue 6 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_provider_conf.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykey myvalue 3 | 4 | config myotherblock 5 | :mykey{CONF} myblock:mykey 6 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_provider_conf_circular_dep.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykey{CONF} myotherblock:mykey 3 | 4 | config myotherblock 5 | :mykey{CONF} myblock:mykey 6 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_provider_conf_dep.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykey myvalue 3 | 4 | config myotherblock 5 | :mykey{CONF} mymidblock:mykey 6 | 7 | config mymidblock 8 | :mykey{CONF} myblock:mykey 9 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_provider_env.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :myenv{ENV} TEST_ENV 3 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_provider_read_only.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykey[ro]{ENV} PATH 3 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_provider_read_only_override.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykey[ro]{ENV} PATH 3 | 4 | config myblock 5 | :mykey myothervalue 6 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_provider_unprovided.pipe: -------------------------------------------------------------------------------- 1 | config myotherblock 2 | :mykey{UNKNOWN} myvalue 3 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_read_only.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykey[ro] myvalue 3 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_read_only_override.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykey[ro] myvalue 3 | 4 | config myblock 5 | :mykey myothervalue 6 | -------------------------------------------------------------------------------- /tests/data/pipelines/config_value_spaces.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | :mykey my value with spaces 3 | :mytabs my value with tabs 4 | -------------------------------------------------------------------------------- /tests/data/pipelines/connect_input_with_slash.pipe: -------------------------------------------------------------------------------- 1 | connect from process/with.slash 2 | to process_without.slash 3 | -------------------------------------------------------------------------------- /tests/data/pipelines/connect_output_with_slash.pipe: -------------------------------------------------------------------------------- 1 | connect from process_without.slash 2 | to process/with.slash 3 | -------------------------------------------------------------------------------- /tests/data/pipelines/connected_processes.pipe: -------------------------------------------------------------------------------- 1 | process source 2 | :: mytype 3 | 4 | process sink 5 | :: mytype 6 | 7 | connect from source.output 8 | to sink.input 9 | -------------------------------------------------------------------------------- /tests/data/pipelines/connected_processes_notalnum.pipe: -------------------------------------------------------------------------------- 1 | process source 2 | :: mytype 3 | 4 | process sink 5 | :: mytype 6 | 7 | connect from source.under_port 8 | to sink.dash-port 9 | 10 | connect from source.dash-port 11 | to sink.slash/port 12 | 13 | connect from source.slash/port 14 | to sink.under_port 15 | -------------------------------------------------------------------------------- /tests/data/pipelines/empty.pipe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kitware/sprokit/6b3f6cf87f625904e9061a447bd16f96800fef77/tests/data/pipelines/empty.pipe -------------------------------------------------------------------------------- /tests/data/pipelines/empty_config.pipe: -------------------------------------------------------------------------------- 1 | config myblock 2 | -------------------------------------------------------------------------------- /tests/data/pipelines/include.pipe: -------------------------------------------------------------------------------- 1 | !include config_block.pipe 2 | -------------------------------------------------------------------------------- /tests/data/pipelines/include_no_exist.pipe: -------------------------------------------------------------------------------- 1 | !include no_exist.pipe 2 | -------------------------------------------------------------------------------- /tests/data/pipelines/include_not_a_file.pipe: -------------------------------------------------------------------------------- 1 | !include not_a_file.pipe 2 | -------------------------------------------------------------------------------- /tests/data/pipelines/no_parse.pipe: -------------------------------------------------------------------------------- 1 | not_a_directive 2 | -------------------------------------------------------------------------------- /tests/data/pipelines/not_a_file.pipe/dummy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kitware/sprokit/6b3f6cf87f625904e9061a447bd16f96800fef77/tests/data/pipelines/not_a_file.pipe/dummy -------------------------------------------------------------------------------- /tests/data/pipelines/one_process.pipe: -------------------------------------------------------------------------------- 1 | process myprocess 2 | :: mytype 3 | -------------------------------------------------------------------------------- /tests/data/pipelines/parse_error.pipe: -------------------------------------------------------------------------------- 1 | group ... 2 | -------------------------------------------------------------------------------- /tests/data/pipelines/pipeline_multiplier.pipe: -------------------------------------------------------------------------------- 1 | config multiplier 2 | :start1 10 3 | :end1 20 4 | :start2 10 5 | :end2 30 6 | :output products.txt 7 | 8 | process gen_numbers1 9 | :: numbers 10 | :start[ro]{CONF} multiplier:start1 11 | :end[ro]{CONF} multiplier:end1 12 | 13 | process gen_numbers2 14 | :: numbers 15 | :start[ro]{CONF} multiplier:start2 16 | :end[ro]{CONF} multiplier:end2 17 | 18 | process multiply 19 | :: multiplication 20 | 21 | process print 22 | :: print_number 23 | :output[ro]{CONF} multiplier:output 24 | 25 | connect from gen_numbers1.number 26 | to multiply.factor1 27 | connect from gen_numbers2.number 28 | to multiply.factor2 29 | connect from multiply.product 30 | to print.number 31 | -------------------------------------------------------------------------------- /tests/data/pipelines/pipeline_setup_no_setup.pipe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kitware/sprokit/6b3f6cf87f625904e9061a447bd16f96800fef77/tests/data/pipelines/pipeline_setup_no_setup.pipe -------------------------------------------------------------------------------- /tests/data/pipelines/pipeline_setup_no_success.pipe: -------------------------------------------------------------------------------- 1 | process orphan1 2 | :: orphan 3 | 4 | process orphan2 5 | :: orphan 6 | -------------------------------------------------------------------------------- /tests/data/pipelines/process_with_slash.pipe: -------------------------------------------------------------------------------- 1 | process myprocess/with_slash 2 | :: orphan 3 | -------------------------------------------------------------------------------- /tests/data/pipelines/simple_pipeline.pipe: -------------------------------------------------------------------------------- 1 | process src1 2 | :: numbers 3 | 4 | process src2 5 | :: numbers 6 | 7 | process end 8 | :: multiplication 9 | 10 | process sink 11 | :: sink 12 | 13 | connect from src1.number 14 | to end.factor1 15 | 16 | connect from src2.number 17 | to end.factor2 18 | 19 | connect from end.product 20 | to sink.sink 21 | -------------------------------------------------------------------------------- /tests/data/pipelines/simple_pipeline_cluster.pipe: -------------------------------------------------------------------------------- 1 | process src 2 | :: numbers 3 | 4 | process multiply 5 | :: multiplier_cluster 6 | 7 | process sink 8 | :: sink 9 | 10 | connect from src.number 11 | to multiply.factor 12 | 13 | connect from multiply.product 14 | to sink.sink 15 | -------------------------------------------------------------------------------- /tests/data/pipelines/simple_pipeline_setup.pipe: -------------------------------------------------------------------------------- 1 | process src1 2 | :: numbers 3 | 4 | process src2 5 | :: numbers 6 | 7 | process end 8 | :: multiplication 9 | 10 | connect from src1.number 11 | to end.factor1 12 | 13 | connect from src2.number 14 | to end.factor2 15 | -------------------------------------------------------------------------------- /tests/data/valgrind/boost.supp: -------------------------------------------------------------------------------- 1 | { 2 | boost -- boost::call_once leak 3 | Memcheck:Leak 4 | fun:malloc 5 | fun:_ZN5boost6detail25get_once_per_thread_epochEv 6 | fun:_ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_ 7 | } 8 | 9 | { 10 | boost -- boost::python::objects::function_object leak 11 | Memcheck:Leak 12 | fun:_Znwm 13 | fun:_ZN5boost6python7objects15function_objectERKNS1_11py_functionERKSt4pairIPKNS0_6detail7keywordES9_E 14 | } 15 | 16 | { 17 | boost -- boost::python::make_instance_reduce_function leak 18 | Memcheck:Leak 19 | fun:_Znwm 20 | fun:_ZN5boost6python7objects20function_handle_implERKNS1_11py_functionE 21 | fun:_ZN5boost6python29make_instance_reduce_functionEv 22 | } 23 | 24 | { 25 | boost -- boost::python::make_instance_reduce_function 26 | Memcheck:Leak 27 | fun:_Znwm 28 | fun:_ZN5boost6python29make_instance_reduce_functionEv 29 | } 30 | -------------------------------------------------------------------------------- /tests/sprokit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories("${sprokit_source_dir}/src") 2 | include_directories("${sprokit_binary_dir}/src") 3 | 4 | function (sprokit_discover_tests group libraries file) 5 | file(STRINGS "${file}" test_lines) 6 | set(properties) 7 | 8 | sprokit_build_tooled_test("${group}" "${libraries}" "${file}") 9 | 10 | foreach (test_line IN LISTS test_lines) 11 | set(test_name) 12 | set(property) 13 | 14 | string(REGEX MATCH "^IMPLEMENT_TEST\\(([A-Za-z_]+)\\)$" 15 | match "${test_line}") 16 | if (match) 17 | set(test_name "${CMAKE_MATCH_1}") 18 | sprokit_add_tooled_test("${group}" "${test_name}" 19 | ${ARGN}) 20 | if (properties) 21 | set_tests_properties("test-${group}-${test_name}" 22 | PROPERTIES 23 | ${properties}) 24 | endif () 25 | set(properties) 26 | set(sprokit_test_environment) 27 | endif () 28 | string(REGEX MATCHALL "^TEST_PROPERTY\\(([A-Za-z_]+), (.*)\\)$" 29 | match "${test_line}") 30 | if (match) 31 | set(prop "${CMAKE_MATCH_1}") 32 | string(CONFIGURE "${CMAKE_MATCH_2}" prop_value 33 | @ONLY) 34 | if (prop STREQUAL "ENVIRONMENT") 35 | set(sprokit_test_environment 36 | "${prop_value}") 37 | else () 38 | set(property "${prop}" "${prop_value}") 39 | list(APPEND properties 40 | "${property}") 41 | endif () 42 | endif () 43 | endforeach () 44 | endfunction () 45 | 46 | add_subdirectory(test) 47 | 48 | add_subdirectory(pipeline) 49 | add_subdirectory(pipeline_util) 50 | -------------------------------------------------------------------------------- /tests/sprokit/pipeline/not_a_plugin.cxx: -------------------------------------------------------------------------------- 1 | /*ckwg +29 2 | * Copyright 2013 by Kitware, Inc. All Rights Reserved. Please refer to 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * * Neither name of Kitware, Inc. nor the names of any contributors may be used 16 | * to endorse or promote products derived from this software without specific 17 | * prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | 33 | extern "C" 34 | { 35 | 36 | SPROKIT_EXPORT void external_function(); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /tests/sprokit/pipeline_util/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_test_pipeline_util) 2 | 3 | set(test_libraries 4 | sprokit_pipeline_util 5 | sprokit_pipeline 6 | ${Boost_FILESYSTEM_LIBRARY} 7 | ${Boost_SYSTEM_LIBRARY}) 8 | 9 | set(sprokit_test_pipelines_directory 10 | "${sprokit_test_data_directory}/pipelines") 11 | 12 | ############################## 13 | # Pipeline loading tests 14 | ############################## 15 | sprokit_discover_tests(load_pipe test_libraries test_load_pipe.cxx 16 | "${sprokit_test_pipelines_directory}") 17 | 18 | ############################## 19 | # Baking tests 20 | ############################## 21 | sprokit_discover_tests(pipe_bakery test_libraries test_pipe_bakery.cxx 22 | "${sprokit_test_pipelines_directory}") 23 | 24 | ############################## 25 | # Export tests 26 | ############################## 27 | sprokit_discover_tests(export_dot test_libraries test_export_dot.cxx 28 | "${sprokit_test_pipelines_directory}") 29 | -------------------------------------------------------------------------------- /tests/sprokit/pipeline_util/include_test.pipe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kitware/sprokit/6b3f6cf87f625904e9061a447bd16f96800fef77/tests/sprokit/pipeline_util/include_test.pipe -------------------------------------------------------------------------------- /tests/sprokit/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sprokit_tests_test) 2 | 3 | set(test_libraries 4 | sprokit_pipeline) 5 | 6 | sprokit_discover_tests(test test_libraries test_test.cxx) 7 | 8 | set(test_libraries 9 | ${Boost_FILESYSTEM_LIBRARY} 10 | ${Boost_SYSTEM_LIBRARY} 11 | ${CMAKE_DL_LIBS}) 12 | 13 | sprokit_build_tooled_test(dlopen test_libraries test_dlopen.cxx) 14 | 15 | get_property(sprokit_libraries GLOBAL 16 | PROPERTY sprokit_libraries) 17 | foreach (library IN LISTS sprokit_libraries) 18 | sprokit_add_tooled_test(dlopen ${library} 19 | "$") 20 | endforeach () 21 | --------------------------------------------------------------------------------