├── .clang-format ├── .github └── workflows │ └── build_and_test.yml ├── .gitignore ├── .gitmodules ├── .vscode ├── _settings.json ├── launch.json └── tasks.json ├── CHANGES ├── LICENSE ├── README.md ├── docs ├── .nojekyll ├── 404.html ├── CNAME ├── Doxyfile ├── heartbeat.png ├── html │ ├── _auto_tick_thread_8h_source.html │ ├── _circuit_8h_source.html │ ├── _circuit_thread_8h_source.html │ ├── _common_8h_source.html │ ├── _component_8h_source.html │ ├── _d_s_patch_8h_source.html │ ├── _parallel_circuit_thread_8h_source.html │ ├── _plugin_8h_source.html │ ├── _signal_bus_8h_source.html │ ├── _wire_8h_source.html │ ├── annotated.html │ ├── bc_s.png │ ├── bc_sd.png │ ├── class_d_s_patch_1_1_circuit-members.html │ ├── class_d_s_patch_1_1_circuit.html │ ├── class_d_s_patch_1_1_component-members.html │ ├── class_d_s_patch_1_1_component.html │ ├── class_d_s_patch_1_1_plugin-members.html │ ├── class_d_s_patch_1_1_plugin.html │ ├── class_d_s_patch_1_1_signal_bus-members.html │ ├── class_d_s_patch_1_1_signal_bus.html │ ├── class_d_s_patch_1_1internal_1_1_auto_tick_thread-members.html │ ├── class_d_s_patch_1_1internal_1_1_auto_tick_thread.html │ ├── class_d_s_patch_1_1internal_1_1_circuit_thread-members.html │ ├── class_d_s_patch_1_1internal_1_1_circuit_thread.html │ ├── class_d_s_patch_1_1internal_1_1_parallel_circuit_thread-members.html │ ├── class_d_s_patch_1_1internal_1_1_parallel_circuit_thread.html │ ├── classes.html │ ├── clipboard.js │ ├── closed.png │ ├── cookie.js │ ├── dir_3756d50f4003bc63fa3fe49460f9c79d.html │ ├── dir_68267d1309a1af8e8297ef4c3efbcdba.html │ ├── dir_96ae4afe4ae1b3c2e5b248f6fc6b60cd.html │ ├── dir_d44c64559bbebec7f509842c48db8b23.html │ ├── doc.svg │ ├── docd.svg │ ├── doxygen.css │ ├── doxygen.svg │ ├── doxygen_crawl.html │ ├── dynsections.js │ ├── files.html │ ├── folderclosed.svg │ ├── folderclosedd.svg │ ├── folderopen.svg │ ├── folderopend.svg │ ├── heartbeat.png │ ├── index.html │ ├── jquery.js │ ├── menu.js │ ├── menudata.js │ ├── minus.svg │ ├── minusd.svg │ ├── nav_f.png │ ├── nav_fd.png │ ├── nav_g.png │ ├── nav_h.png │ ├── nav_hd.png │ ├── navtree.css │ ├── open.png │ ├── plus.svg │ ├── plusd.svg │ ├── resize.js │ ├── search │ │ ├── all_0.js │ │ ├── all_1.js │ │ ├── all_2.js │ │ ├── all_3.js │ │ ├── all_4.js │ │ ├── all_5.js │ │ ├── all_6.js │ │ ├── all_7.js │ │ ├── all_8.js │ │ ├── all_9.js │ │ ├── all_a.js │ │ ├── all_b.js │ │ ├── all_c.js │ │ ├── classes_0.js │ │ ├── classes_1.js │ │ ├── classes_2.js │ │ ├── classes_3.js │ │ ├── classes_4.js │ │ ├── close.svg │ │ ├── mag.svg │ │ ├── mag_d.svg │ │ ├── mag_sel.svg │ │ ├── mag_seld.svg │ │ ├── pages_0.js │ │ ├── pages_1.js │ │ ├── pages_2.js │ │ ├── pages_3.js │ │ ├── pages_4.js │ │ ├── pages_5.js │ │ ├── search.css │ │ ├── search.js │ │ └── searchdata.js │ ├── splitbar.png │ ├── splitbard.png │ ├── struct_d_s_patch_1_1internal_1_1_wire-members.html │ ├── struct_d_s_patch_1_1internal_1_1_wire.html │ ├── sync_off.png │ ├── sync_on.png │ ├── tab_a.png │ ├── tab_ad.png │ ├── tab_b.png │ ├── tab_bd.png │ ├── tab_h.png │ ├── tab_hd.png │ ├── tab_s.png │ ├── tab_sd.png │ └── tabs.css ├── index.html └── latex │ ├── Makefile │ ├── doxygen.sty │ ├── etoc_doxygen.sty │ ├── longtable_doxygen.sty │ ├── refman.tex │ └── tabu_doxygen.sty ├── include ├── DSPatch.h └── dspatch │ ├── Circuit.h │ ├── Component.h │ ├── Plugin.h │ └── SignalBus.h ├── meson.build ├── scripts ├── clang-format.bat └── clang-format.sh ├── tests ├── catch │ └── catch.hpp ├── components │ ├── Adder.h │ ├── BranchSyncProbe.h │ ├── ChangingCounter.h │ ├── ChangingProbe.h │ ├── CircuitCounter.h │ ├── CircuitProbe.h │ ├── Counter.h │ ├── FeedbackProbe.h │ ├── FeedbackTester.h │ ├── Incrementer.h │ ├── NoOutputProbe.h │ ├── NullInputProbe.h │ ├── ParallelProbe.h │ ├── PassThrough.h │ ├── SerialProbe.h │ ├── SlowCounter.h │ ├── SporadicCounter.h │ └── ThreadingProbe.h ├── main.cpp └── meson.build └── tutorial ├── components.h ├── main.cpp └── meson.build /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | DerivePointerAlignment: false 3 | AccessModifierOffset: -4 4 | AlignEscapedNewlinesLeft: true 5 | AlignTrailingComments: true 6 | AllowAllParametersOfDeclarationOnNextLine: true 7 | AllowShortFunctionsOnASingleLine: false 8 | AllowShortIfStatementsOnASingleLine: false 9 | AllowShortLoopsOnASingleLine: false 10 | AlwaysBreakBeforeMultilineStrings: true 11 | AlwaysBreakTemplateDeclarations: true 12 | BinPackParameters: false 13 | BreakBeforeBinaryOperators: false 14 | BreakBeforeBraces: Allman 15 | BreakBeforeTernaryOperators: false 16 | BreakConstructorInitializersBeforeComma: true 17 | ColumnLimit: 130 18 | ConstructorInitializerAllOnOneLineOrOnePerLine: false 19 | ConstructorInitializerIndentWidth: 4 20 | ContinuationIndentWidth: 4 21 | Cpp11BracedListStyle: true 22 | DerivePointerBinding: true 23 | ExperimentalAutoDetectBinPacking: false 24 | IndentCaseLabels: true 25 | IndentFunctionDeclarationAfterType: true 26 | IndentWidth: 4 27 | Language: Cpp 28 | MaxEmptyLinesToKeep: 1 29 | NamespaceIndentation: None 30 | ObjCSpaceBeforeProtocolList: false 31 | PenaltyBreakBeforeFirstCallParameter: 1 32 | PenaltyBreakComment: 60 33 | PenaltyBreakFirstLessLess: 120 34 | PenaltyBreakString: 1000 35 | PenaltyExcessCharacter: 1000000 36 | PenaltyReturnTypeOnItsOwnLine: 200 37 | PointerBindsToType: true 38 | SpaceBeforeAssignmentOperators: true 39 | SpaceBeforeParens: ControlStatements 40 | SpaceInEmptyParentheses: false 41 | SpacesBeforeTrailingComments: 2 42 | SpacesInAngles: false 43 | SpacesInCStyleCastParentheses: false 44 | SpacesInParentheses: true 45 | Standard: Cpp11 46 | TabWidth: 8 47 | UseTab: Never 48 | ... 49 | 50 | -------------------------------------------------------------------------------- /.github/workflows/build_and_test.yml: -------------------------------------------------------------------------------- 1 | name: Build & Test 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | schedule: 7 | - cron: "0 0 * * *" 8 | 9 | jobs: 10 | build_and_test: 11 | runs-on: ${{ matrix.os }} 12 | strategy: 13 | matrix: 14 | os: [macos-13, ubuntu-22.04, windows-2019] 15 | 16 | steps: 17 | - if: matrix.os == 'windows-2019' 18 | name: Install Cppcheck, OpenCppCoverage, and wkhtmltopdf (Windows) 19 | run: | 20 | choco install -y --ignore-package-exit-codes cppcheck opencppcoverage wkhtmltopdf 21 | echo "C:\Program Files\Cppcheck" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append 22 | echo "C:\Program Files\OpenCppCoverage" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append 23 | echo "C:\Program Files\wkhtmltopdf" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append 24 | 25 | - if: matrix.os == 'windows-2019' 26 | name: Configure MSVC (Windows) 27 | uses: ilammy/msvc-dev-cmd@v1 28 | 29 | - if: matrix.os == 'macos-13' 30 | name: Configure Xcode (MacOS) 31 | run: | 32 | sudo xcode-select -s /Applications/Xcode_14.1.app/Contents/Developer 33 | 34 | - name: Configure Python 35 | uses: actions/setup-python@v4 36 | with: 37 | python-version: '3.x' 38 | 39 | - name: Install Meson and Ninja 40 | run: | 41 | pip3 install --upgrade meson ninja 42 | 43 | - name: Checkout 44 | uses: actions/checkout@v3 45 | with: 46 | submodules: recursive 47 | 48 | - name: Build - Release 49 | run: | 50 | meson setup --buildtype=release builddir 51 | meson compile -C builddir 52 | 53 | - name: Test - Release 54 | run: | 55 | meson test -vC builddir 56 | 57 | # - if: matrix.os == 'windows-2019' 58 | # name: Build - Debug (Windows) 59 | # run: | 60 | # meson setup --buildtype=debug --wipe builddir 61 | # meson compile -C builddir 62 | 63 | # - if: matrix.os == 'windows-2019' 64 | # name: Test - Debug (Windows) 65 | # run: | 66 | # meson test -vC builddir 67 | # meson compile ./codecoverage -C builddir 68 | # $files = (Get-ChildItem -R .\builddir\coverage\*.html) 69 | # [array]::Reverse($files) 70 | # wkhtmltopdf --enable-local-file-access --disable-external-links --header-center [title] $files coverage.pdf 71 | 72 | # - if: matrix.os == 'windows-2019' 73 | # name: Upload Coverage Report (Windows) 74 | # uses: actions/upload-artifact@v3 75 | # with: 76 | # name: coverage 77 | # path: coverage.pdf 78 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build* 2 | .DS_Store 3 | .vscode/settings.json 4 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "include/fast_any"] 2 | path = include/fast_any 3 | url = https://github.com/cross-platform/fast_any.git 4 | -------------------------------------------------------------------------------- /.vscode/_settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "C_Cpp.default.cppStandard": "c++17", 3 | "lldb.showDisassembly": "never" 4 | } 5 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Tests", 6 | "preLaunchTask": "Build", 7 | "program": "${workspaceFolder}/builddir/tests/Tests", 8 | "cwd": "${workspaceFolder}", 9 | "request": "launch", 10 | "type": "cppvsdbg", 11 | "osx": { 12 | "type": "lldb" 13 | } 14 | }, 15 | { 16 | "name": "Tutorial", 17 | "preLaunchTask": "Build", 18 | "program": "${workspaceFolder}/builddir/tutorial/Tutorial", 19 | "cwd": "${workspaceFolder}", 20 | "request": "launch", 21 | "type": "cppvsdbg", 22 | "osx": { 23 | "type": "lldb" 24 | } 25 | } 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "windows": { 4 | "options": { 5 | "shell": { 6 | "executable": "cmd.exe", 7 | "args": [ 8 | "/c", 9 | "\"C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/Common7/Tools/VsDevCmd.bat\"", 10 | "-arch=amd64", 11 | "&&" 12 | ] 13 | } 14 | } 15 | }, 16 | "tasks": [ 17 | { 18 | "label": "Build", 19 | "type": "shell", 20 | "group": { 21 | "kind": "build", 22 | "isDefault": true 23 | }, 24 | "windows": { 25 | "command": [ 26 | "copy /y .vscode\\_settings.json .vscode\\settings.json &&", 27 | "meson setup builddir --buildtype=debug &&", 28 | "meson compile -C builddir" 29 | ], 30 | "problemMatcher": { 31 | "base": "$msCompile" 32 | } 33 | }, 34 | "osx": { 35 | "command": [ 36 | "cp .vscode/_settings.json .vscode/settings.json &&", 37 | "meson setup builddir --buildtype=debug &&", 38 | "meson compile -C builddir" 39 | ], 40 | "problemMatcher": { 41 | "base": "$gcc", 42 | "fileLocation": [ 43 | "relative", 44 | "${workspaceFolder}/builddir/" 45 | ] 46 | } 47 | } 48 | } 49 | ] 50 | } 51 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2025, Marcus Tomlinson 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 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. 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 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build & Test](https://github.com/cross-platform/dspatch/actions/workflows/build_and_test.yml/badge.svg)](https://github.com/cross-platform/dspatch/actions/workflows/build_and_test.yml) 2 | 3 | # DSPatch 4 | 5 | The Refreshingly Simple C++ Dataflow Framework 6 | 7 | Webite: https://flowbasedprogramming.com 8 | 9 | DSPatch, pronounced "dispatch", is a powerful C++ dataflow framework. DSPatch is not limited to any particular domain or data type, from reactive programming to stream processing, DSPatch's generic, object-oriented API allows you to create virtually any graph processing system imaginable. 10 | 11 | 12 | ## Checkout 13 | 14 | ``` 15 | git clone https://github.com/cross-platform/dspatch.git 16 | cd dspatch 17 | git submodule update --init --recursive --remote 18 | ``` 19 | 20 | ## Build 21 | 22 | DSPatch is a header-only library, to build it into your own projects, all you'll need are the files under `include`. 23 | 24 | To build the tests and tutorial projects: 25 | 26 | ``` 27 | meson setup builddir --buildtype=debug 28 | meson compile -C builddir 29 | ``` 30 | 31 | ### See also: 32 | 33 | DSPatchables (https://github.com/cross-platform/dspatchables): A DSPatch component repository. 34 | 35 | DSPatcher (https://github.com/cross-platform/dspatcher): A cross-platform graphical tool for building DSPatch circuits. 36 | -------------------------------------------------------------------------------- /docs/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/.nojekyll -------------------------------------------------------------------------------- /docs/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/CNAME: -------------------------------------------------------------------------------- 1 | flowbasedprogramming.com -------------------------------------------------------------------------------- /docs/heartbeat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/heartbeat.png -------------------------------------------------------------------------------- /docs/html/annotated.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | DSPatch: Class List 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | 28 | 32 | 33 | 34 |
29 |
DSPatch v.11.4.3 30 |
31 |
35 |
36 | 37 | 38 | 43 | 48 | 49 | 50 | 58 | 59 |
60 |
61 | 66 | 67 |
71 |
72 | 73 | 74 |
75 |
76 |
77 |
78 |
79 |
Loading...
80 |
Searching...
81 |
No Matches
82 |
83 |
84 |
85 |
86 | 87 |
88 |
Class List
89 |
90 |
91 |
Here are the classes, structs, unions and interfaces with brief descriptions:
92 |
[detail level 12]
93 | 94 | 95 | 96 | 97 | 98 |
 NDSPatch
 CCircuitWorkspace for adding and routing components
 CComponentAbstract base class for DSPatch components
 CPluginComponent plugin loader
 CSignalBusSignal container
99 |
100 |
101 | 102 | 105 |
106 | 107 | 108 | -------------------------------------------------------------------------------- /docs/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/html/bc_s.png -------------------------------------------------------------------------------- /docs/html/bc_sd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/html/bc_sd.png -------------------------------------------------------------------------------- /docs/html/class_d_s_patch_1_1_plugin-members.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | DSPatch: Member List 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | 28 | 32 | 33 | 34 |
29 |
DSPatch v.11.4.3 30 |
31 |
35 |
36 | 37 | 38 | 43 | 48 | 49 | 50 | 58 | 59 | 64 | 65 |
69 |
70 | 71 | 72 |
73 |
74 |
75 |
76 |
77 |
Loading...
78 |
Searching...
79 |
No Matches
80 |
81 |
82 |
83 |
84 | 85 | 89 |
90 |
91 |
92 |
DSPatch::Plugin Member List
93 |
94 |
95 | 96 |

This is the complete list of members for DSPatch::Plugin, including all inherited members.

97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 |
Create() const (defined in DSPatch::Plugin)DSPatch::Plugininline
IsLoaded() const (defined in DSPatch::Plugin)DSPatch::Plugininline
operator=(const Plugin &)=delete (defined in DSPatch::Plugin)DSPatch::Plugin
Plugin(const Plugin &)=delete (defined in DSPatch::Plugin)DSPatch::Plugin
Plugin(const std::string &pluginPath) (defined in DSPatch::Plugin)DSPatch::Plugininlineexplicit
~Plugin() (defined in DSPatch::Plugin)DSPatch::Plugininline
105 | 106 | 109 |
110 | 111 | 112 | -------------------------------------------------------------------------------- /docs/html/class_d_s_patch_1_1internal_1_1_auto_tick_thread-members.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | DSPatch: Member List 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 24 | 28 | 29 | 30 |
25 |
DSPatch v.10.2.4 26 |
27 |
31 |
32 | 33 | 34 | 39 | 40 | 41 | 49 | 50 | 51 |
55 |
56 | 57 | 58 |
59 |
60 |
61 |
62 |
63 |
Loading...
64 |
Searching...
65 |
No Matches
66 |
67 |
68 |
69 |
70 | 71 | 75 |
76 |
77 |
DSPatch::internal::AutoTickThread Member List
78 |
79 |
80 | 81 |

This is the complete list of members for DSPatch::internal::AutoTickThread, including all inherited members.

82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 |
AutoTickThread()=default (defined in DSPatch::internal::AutoTickThread)DSPatch::internal::AutoTickThreadinline
NONCOPYABLE(AutoTickThread) (defined in DSPatch::internal::AutoTickThread)DSPatch::internal::AutoTickThread
Pause() (defined in DSPatch::internal::AutoTickThread)DSPatch::internal::AutoTickThreadinline
Resume() (defined in DSPatch::internal::AutoTickThread)DSPatch::internal::AutoTickThreadinline
Start(DSPatch::Circuit *circuit) (defined in DSPatch::internal::AutoTickThread)DSPatch::internal::AutoTickThreadinline
Stop() (defined in DSPatch::internal::AutoTickThread)DSPatch::internal::AutoTickThreadinline
~AutoTickThread() (defined in DSPatch::internal::AutoTickThread)DSPatch::internal::AutoTickThreadinline
91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /docs/html/class_d_s_patch_1_1internal_1_1_circuit_thread-members.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | DSPatch: Member List 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 24 | 28 | 29 | 30 |
25 |
DSPatch v.10.2.4 26 |
27 |
31 |
32 | 33 | 34 | 39 | 40 | 41 | 49 | 50 | 51 |
55 |
56 | 57 | 58 |
59 |
60 |
61 |
62 |
63 |
Loading...
64 |
Searching...
65 |
No Matches
66 |
67 |
68 |
69 |
70 | 71 | 75 |
76 |
77 |
DSPatch::internal::CircuitThread Member List
78 |
79 |
80 | 81 |

This is the complete list of members for DSPatch::internal::CircuitThread, including all inherited members.

82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 |
CircuitThread()=default (defined in DSPatch::internal::CircuitThread)DSPatch::internal::CircuitThreadinline
CircuitThread(CircuitThread &&) (defined in DSPatch::internal::CircuitThread)DSPatch::internal::CircuitThreadinline
NONCOPYABLE(CircuitThread) (defined in DSPatch::internal::CircuitThread)DSPatch::internal::CircuitThread
Resume() (defined in DSPatch::internal::CircuitThread)DSPatch::internal::CircuitThreadinline
Start(std::vector< DSPatch::Component * > *components, int bufferNo) (defined in DSPatch::internal::CircuitThread)DSPatch::internal::CircuitThreadinline
Stop() (defined in DSPatch::internal::CircuitThread)DSPatch::internal::CircuitThreadinline
Sync() (defined in DSPatch::internal::CircuitThread)DSPatch::internal::CircuitThreadinline
SyncAndResume() (defined in DSPatch::internal::CircuitThread)DSPatch::internal::CircuitThreadinline
~CircuitThread() (defined in DSPatch::internal::CircuitThread)DSPatch::internal::CircuitThreadinline
93 | 94 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /docs/html/class_d_s_patch_1_1internal_1_1_parallel_circuit_thread-members.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | DSPatch: Member List 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 24 | 28 | 29 | 30 |
25 |
DSPatch v.10.2.4 26 |
27 |
31 |
32 | 33 | 34 | 39 | 40 | 41 | 49 | 50 | 51 |
55 |
56 | 57 | 58 |
59 |
60 |
61 |
62 |
63 |
Loading...
64 |
Searching...
65 |
No Matches
66 |
67 |
68 |
69 |
70 | 71 | 75 |
76 |
77 |
DSPatch::internal::ParallelCircuitThread Member List
78 |
79 |
80 | 81 |

This is the complete list of members for DSPatch::internal::ParallelCircuitThread, including all inherited members.

82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 |
NONCOPYABLE(ParallelCircuitThread) (defined in DSPatch::internal::ParallelCircuitThread)DSPatch::internal::ParallelCircuitThread
ParallelCircuitThread()=default (defined in DSPatch::internal::ParallelCircuitThread)DSPatch::internal::ParallelCircuitThreadinline
ParallelCircuitThread(ParallelCircuitThread &&) (defined in DSPatch::internal::ParallelCircuitThread)DSPatch::internal::ParallelCircuitThreadinline
Resume() (defined in DSPatch::internal::ParallelCircuitThread)DSPatch::internal::ParallelCircuitThreadinline
Start(std::vector< DSPatch::Component * > *components, int bufferNo, int threadNo, int threadCount) (defined in DSPatch::internal::ParallelCircuitThread)DSPatch::internal::ParallelCircuitThreadinline
Stop() (defined in DSPatch::internal::ParallelCircuitThread)DSPatch::internal::ParallelCircuitThreadinline
Sync() (defined in DSPatch::internal::ParallelCircuitThread)DSPatch::internal::ParallelCircuitThreadinline
~ParallelCircuitThread() (defined in DSPatch::internal::ParallelCircuitThread)DSPatch::internal::ParallelCircuitThreadinline
92 | 93 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /docs/html/classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | DSPatch: Class Index 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | 28 | 32 | 33 | 34 |
29 |
DSPatch v.11.4.3 30 |
31 |
35 |
36 | 37 | 38 | 43 | 48 | 49 | 50 | 58 | 59 |
60 |
61 | 66 | 67 |
71 |
72 | 73 | 74 |
75 |
76 |
77 |
78 |
79 |
Loading...
80 |
Searching...
81 |
No Matches
82 |
83 |
84 |
85 |
86 | 87 |
88 |
Class Index
89 |
90 |
91 |
C | P | S
92 |
93 |
94 |
C
95 |
Circuit (DSPatch)
Component (DSPatch)
96 |
97 |
P
98 |
Plugin (DSPatch)
99 |
100 |
S
101 |
SignalBus (DSPatch)
102 |
103 |
104 | 105 | 108 |
109 | 110 | 111 | -------------------------------------------------------------------------------- /docs/html/clipboard.js: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | The code below is based on the Doxygen Awesome project, see 4 | https://github.com/jothepro/doxygen-awesome-css 5 | 6 | MIT License 7 | 8 | Copyright (c) 2021 - 2022 jothepro 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | */ 29 | 30 | let clipboard_title = "Copy to clipboard" 31 | let clipboard_icon = `` 32 | let clipboard_successIcon = `` 33 | let clipboard_successDuration = 1000 34 | 35 | $(function() { 36 | if(navigator.clipboard) { 37 | const fragments = document.getElementsByClassName("fragment") 38 | for(const fragment of fragments) { 39 | const clipboard_div = document.createElement("div") 40 | clipboard_div.classList.add("clipboard") 41 | clipboard_div.innerHTML = clipboard_icon 42 | clipboard_div.title = clipboard_title 43 | $(clipboard_div).click(function() { 44 | const content = this.parentNode.cloneNode(true) 45 | // filter out line number and folded fragments from file listings 46 | content.querySelectorAll(".lineno, .ttc, .foldclosed").forEach((node) => { node.remove() }) 47 | let text = content.textContent 48 | // remove trailing newlines and trailing spaces from empty lines 49 | text = text.replace(/^\s*\n/gm,'\n').replace(/\n*$/,'') 50 | navigator.clipboard.writeText(text); 51 | this.classList.add("success") 52 | this.innerHTML = clipboard_successIcon 53 | window.setTimeout(() => { // switch back to normal icon after timeout 54 | this.classList.remove("success") 55 | this.innerHTML = clipboard_icon 56 | }, clipboard_successDuration); 57 | }) 58 | fragment.insertBefore(clipboard_div, fragment.firstChild) 59 | } 60 | } 61 | }) 62 | -------------------------------------------------------------------------------- /docs/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/html/closed.png -------------------------------------------------------------------------------- /docs/html/cookie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | Cookie helper functions 3 | Copyright (c) 2023 Dimitri van Heesch 4 | Released under MIT license. 5 | */ 6 | let Cookie = { 7 | cookie_namespace: 'doxygen_', 8 | 9 | readSetting(cookie,defVal) { 10 | if (window.chrome) { 11 | const val = localStorage.getItem(this.cookie_namespace+cookie) || 12 | sessionStorage.getItem(this.cookie_namespace+cookie); 13 | if (val) return val; 14 | } else { 15 | let myCookie = this.cookie_namespace+cookie+"="; 16 | if (document.cookie) { 17 | const index = document.cookie.indexOf(myCookie); 18 | if (index != -1) { 19 | const valStart = index + myCookie.length; 20 | let valEnd = document.cookie.indexOf(";", valStart); 21 | if (valEnd == -1) { 22 | valEnd = document.cookie.length; 23 | } 24 | return document.cookie.substring(valStart, valEnd); 25 | } 26 | } 27 | } 28 | return defVal; 29 | }, 30 | 31 | writeSetting(cookie,val,days=10*365) { // default days='forever', 0=session cookie, -1=delete 32 | if (window.chrome) { 33 | if (days==0) { 34 | sessionStorage.setItem(this.cookie_namespace+cookie,val); 35 | } else { 36 | localStorage.setItem(this.cookie_namespace+cookie,val); 37 | } 38 | } else { 39 | let date = new Date(); 40 | date.setTime(date.getTime()+(days*24*60*60*1000)); 41 | const expiration = days!=0 ? "expires="+date.toGMTString()+";" : ""; 42 | document.cookie = this.cookie_namespace + cookie + "=" + 43 | val + "; SameSite=Lax;" + expiration + "path=/"; 44 | } 45 | }, 46 | 47 | eraseSetting(cookie) { 48 | if (window.chrome) { 49 | if (localStorage.getItem(this.cookie_namespace+cookie)) { 50 | localStorage.removeItem(this.cookie_namespace+cookie); 51 | } else if (sessionStorage.getItem(this.cookie_namespace+cookie)) { 52 | sessionStorage.removeItem(this.cookie_namespace+cookie); 53 | } 54 | } else { 55 | this.writeSetting(cookie,'',-1); 56 | } 57 | }, 58 | } 59 | -------------------------------------------------------------------------------- /docs/html/dir_3756d50f4003bc63fa3fe49460f9c79d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | DSPatch: internal Directory Reference 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 24 | 28 | 29 | 30 |
25 |
DSPatch v.10.2.4 26 |
27 |
31 |
32 | 33 | 34 | 39 | 40 | 41 | 49 | 50 | 51 |
55 |
56 | 57 | 58 |
59 |
60 |
61 |
62 |
63 |
Loading...
64 |
Searching...
65 |
No Matches
66 |
67 |
68 |
69 |
70 | 71 | 75 |
76 |
77 |
internal Directory Reference
78 |
79 |
80 | 81 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 |

82 | Files

 AutoTickThread.h
 
 CircuitThread.h
 
 ParallelCircuitThread.h
 
 Wire.h
 
92 |
93 | 94 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /docs/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | DSPatch: src Directory Reference 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 24 | 28 | 29 | 30 |
25 |
DSPatch v.10.2.4 26 |
27 |
31 |
32 | 33 | 34 | 39 | 40 | 41 | 49 | 50 | 51 |
55 |
56 | 57 | 58 |
59 |
60 |
61 |
62 |
63 |
Loading...
64 |
Searching...
65 |
No Matches
66 |
67 |
68 |
69 |
70 | 71 | 75 |
76 |
77 |
src Directory Reference
78 |
79 |
80 | 81 | 83 | 84 | 85 |

82 | Directories

 internal
 
86 |
87 | 88 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /docs/html/dir_96ae4afe4ae1b3c2e5b248f6fc6b60cd.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | DSPatch: dspatch Directory Reference 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | 28 | 32 | 33 | 34 |
29 |
DSPatch v.11.4.3 30 |
31 |
35 |
36 | 37 | 38 | 43 | 48 | 49 | 50 | 58 | 59 | 64 | 65 |
69 |
70 | 71 | 72 |
73 |
74 |
75 |
76 |
77 |
Loading...
78 |
Searching...
79 |
No Matches
80 |
81 |
82 |
83 |
84 | 85 | 89 |
90 |
91 |
92 |
dspatch Directory Reference
93 |
94 |
95 | 96 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 |

97 | Files

 Circuit.h
 
 Component.h
 
 Plugin.h
 
 SignalBus.h
 
107 |
108 | 109 | 112 |
113 | 114 | 115 | -------------------------------------------------------------------------------- /docs/html/dir_d44c64559bbebec7f509842c48db8b23.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | DSPatch: include Directory Reference 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | 28 | 32 | 33 | 34 |
29 |
DSPatch v.11.4.3 30 |
31 |
35 |
36 | 37 | 38 | 43 | 48 | 49 | 50 | 58 | 59 | 64 | 65 |
69 |
70 | 71 | 72 |
73 |
74 |
75 |
76 |
77 |
Loading...
78 |
Searching...
79 |
No Matches
80 |
81 |
82 |
83 |
84 | 85 | 89 |
90 |
91 |
92 |
include Directory Reference
93 |
94 |
95 | 96 | 98 | 99 | 100 |

97 | Directories

 dspatch
 
101 | 103 | 104 | 105 |

102 | Files

 DSPatch.h
 
106 |
107 | 108 | 111 |
112 | 113 | 114 | -------------------------------------------------------------------------------- /docs/html/doc.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/html/docd.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/html/doxygen_crawl.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Validator / crawler helper 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /docs/html/files.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | DSPatch: File List 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | 28 | 32 | 33 | 34 |
29 |
DSPatch v.11.4.3 30 |
31 |
35 |
36 | 37 | 38 | 43 | 48 | 49 | 50 | 58 | 59 |
60 |
61 | 66 | 67 |
71 |
72 | 73 | 74 |
75 |
76 |
77 |
78 |
79 |
Loading...
80 |
Searching...
81 |
No Matches
82 |
83 |
84 |
85 |
86 | 87 |
88 |
File List
89 |
90 |
91 |
Here is a list of all documented files with brief descriptions:
92 |
[detail level 123]
93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 |
  include
  dspatch
 Circuit.h
 Component.h
 Plugin.h
 SignalBus.h
 DSPatch.h
101 |
102 |
103 | 104 |
107 |
108 | 109 | 110 | -------------------------------------------------------------------------------- /docs/html/folderclosed.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/html/folderclosedd.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/html/folderopen.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | 11 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/html/folderopend.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/html/heartbeat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/html/heartbeat.png -------------------------------------------------------------------------------- /docs/html/menu.js: -------------------------------------------------------------------------------- 1 | /* 2 | @licstart The following is the entire license notice for the JavaScript code in this file. 3 | 4 | The MIT License (MIT) 5 | 6 | Copyright (C) 1997-2020 by Dimitri van Heesch 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 9 | and associated documentation files (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 11 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all copies or 15 | substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 18 | BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 20 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | @licend The above is the entire license notice for the JavaScript code in this file 24 | */ 25 | function initMenu(relPath,searchEnabled,serverSide,searchPage,search,treeview) { 26 | function makeTree(data,relPath) { 27 | let result=''; 28 | if ('children' in data) { 29 | result+=''; 43 | } 44 | return result; 45 | } 46 | let searchBoxHtml; 47 | if (searchEnabled) { 48 | if (serverSide) { 49 | searchBoxHtml='
'+ 50 | '
'+ 51 | '
 '+ 53 | ''+ 56 | '
'+ 57 | '
'+ 58 | '
'+ 59 | '
'; 60 | } else { 61 | searchBoxHtml='
'+ 62 | ''+ 63 | ' '+ 65 | ''+ 69 | ''+ 70 | ''+ 72 | ''+ 74 | ''+ 75 | '
'; 76 | } 77 | } 78 | 79 | $('#main-nav').before('
'+ 80 | ''+ 83 | ''+ 84 | '
'); 85 | $('#main-nav').append(makeTree(menudata,relPath)); 86 | $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); 87 | if (searchBoxHtml) { 88 | $('#main-menu').append('
  • '); 89 | } 90 | const $mainMenuState = $('#main-menu-state'); 91 | let prevWidth = 0; 92 | if ($mainMenuState.length) { 93 | const initResizableIfExists = function() { 94 | if (typeof initResizable==='function') initResizable(treeview); 95 | } 96 | // animate mobile menu 97 | $mainMenuState.change(function() { 98 | const $menu = $('#main-menu'); 99 | let options = { duration: 250, step: initResizableIfExists }; 100 | if (this.checked) { 101 | options['complete'] = () => $menu.css('display', 'block'); 102 | $menu.hide().slideDown(options); 103 | } else { 104 | options['complete'] = () => $menu.css('display', 'none'); 105 | $menu.show().slideUp(options); 106 | } 107 | }); 108 | // set default menu visibility 109 | const resetState = function() { 110 | const $menu = $('#main-menu'); 111 | const newWidth = $(window).outerWidth(); 112 | if (newWidth!=prevWidth) { 113 | if ($(window).outerWidth()<768) { 114 | $mainMenuState.prop('checked',false); $menu.hide(); 115 | $('#searchBoxPos1').html(searchBoxHtml); 116 | $('#searchBoxPos2').hide(); 117 | } else { 118 | $menu.show(); 119 | $('#searchBoxPos1').empty(); 120 | $('#searchBoxPos2').html(searchBoxHtml); 121 | $('#searchBoxPos2').show(); 122 | } 123 | if (typeof searchBox!=='undefined') { 124 | searchBox.CloseResultsWindow(); 125 | } 126 | prevWidth = newWidth; 127 | } 128 | } 129 | $(window).ready(function() { resetState(); initResizableIfExists(); }); 130 | $(window).resize(resetState); 131 | } 132 | $('#main-menu').smartmenus(); 133 | } 134 | /* @license-end */ 135 | -------------------------------------------------------------------------------- /docs/html/menudata.js: -------------------------------------------------------------------------------- 1 | /* 2 | @licstart The following is the entire license notice for the JavaScript code in this file. 3 | 4 | The MIT License (MIT) 5 | 6 | Copyright (C) 1997-2020 by Dimitri van Heesch 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 9 | and associated documentation files (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 11 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all copies or 15 | substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 18 | BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 20 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | @licend The above is the entire license notice for the JavaScript code in this file 24 | */ 25 | var menudata={children:[ 26 | {text:"Main Page",url:"index.html"}, 27 | {text:"Classes",url:"annotated.html",children:[ 28 | {text:"Class List",url:"annotated.html"}]}, 29 | {text:"Files",url:"files.html",children:[ 30 | {text:"File List",url:"files.html"}]}]} 31 | -------------------------------------------------------------------------------- /docs/html/minus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /docs/html/minusd.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /docs/html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/html/nav_f.png -------------------------------------------------------------------------------- /docs/html/nav_fd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/html/nav_fd.png -------------------------------------------------------------------------------- /docs/html/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/html/nav_g.png -------------------------------------------------------------------------------- /docs/html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/html/nav_h.png -------------------------------------------------------------------------------- /docs/html/nav_hd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/html/nav_hd.png -------------------------------------------------------------------------------- /docs/html/navtree.css: -------------------------------------------------------------------------------- 1 | #nav-tree .children_ul { 2 | margin:0; 3 | padding:4px; 4 | } 5 | 6 | #nav-tree ul { 7 | list-style:none outside none; 8 | margin:0px; 9 | padding:0px; 10 | } 11 | 12 | #nav-tree li { 13 | white-space:nowrap; 14 | margin:0px; 15 | padding:0px; 16 | } 17 | 18 | #nav-tree .plus { 19 | margin:0px; 20 | } 21 | 22 | #nav-tree .selected { 23 | background-image: url('tab_a.png'); 24 | background-repeat:repeat-x; 25 | color: var(--nav-text-active-color); 26 | text-shadow: var(--nav-text-active-shadow); 27 | } 28 | 29 | #nav-tree .selected .arrow { 30 | color: var(--nav-arrow-selected-color); 31 | text-shadow: none; 32 | } 33 | 34 | #nav-tree img { 35 | margin:0px; 36 | padding:0px; 37 | border:0px; 38 | vertical-align: middle; 39 | } 40 | 41 | #nav-tree a { 42 | text-decoration:none; 43 | padding:0px; 44 | margin:0px; 45 | } 46 | 47 | #nav-tree .label { 48 | margin:0px; 49 | padding:0px; 50 | font: 12px var(--font-family-nav); 51 | } 52 | 53 | #nav-tree .label a { 54 | padding:2px; 55 | } 56 | 57 | #nav-tree .selected a { 58 | text-decoration:none; 59 | color:var(--nav-text-active-color); 60 | } 61 | 62 | #nav-tree .children_ul { 63 | margin:0px; 64 | padding:0px; 65 | } 66 | 67 | #nav-tree .item { 68 | margin:0px; 69 | padding:0px; 70 | } 71 | 72 | #nav-tree { 73 | padding: 0px 0px; 74 | font-size:14px; 75 | overflow:auto; 76 | } 77 | 78 | #doc-content { 79 | overflow:auto; 80 | display:block; 81 | padding:0px; 82 | margin:0px; 83 | -webkit-overflow-scrolling : touch; /* iOS 5+ */ 84 | } 85 | 86 | #side-nav { 87 | padding:0 6px 0 0; 88 | margin: 0px; 89 | display:block; 90 | position: absolute; 91 | left: 0px; 92 | width: $width; 93 | overflow : hidden; 94 | } 95 | 96 | .ui-resizable .ui-resizable-handle { 97 | display:block; 98 | } 99 | 100 | .ui-resizable-e { 101 | background-image:var(--nav-splitbar-image); 102 | background-size:100%; 103 | background-repeat:repeat-y; 104 | background-attachment: scroll; 105 | cursor:ew-resize; 106 | height:100%; 107 | right:0; 108 | top:0; 109 | width:6px; 110 | } 111 | 112 | .ui-resizable-handle { 113 | display:none; 114 | font-size:0.1px; 115 | position:absolute; 116 | z-index:1; 117 | } 118 | 119 | #nav-tree-contents { 120 | margin: 6px 0px 0px 0px; 121 | } 122 | 123 | #nav-tree { 124 | background-repeat:repeat-x; 125 | background-color: var(--nav-background-color); 126 | -webkit-overflow-scrolling : touch; /* iOS 5+ */ 127 | } 128 | 129 | #nav-sync { 130 | position:absolute; 131 | top:5px; 132 | right:24px; 133 | z-index:0; 134 | } 135 | 136 | #nav-sync img { 137 | opacity:0.3; 138 | } 139 | 140 | #nav-sync img:hover { 141 | opacity:0.9; 142 | } 143 | 144 | @media print 145 | { 146 | #nav-tree { display: none; } 147 | div.ui-resizable-handle { display: none; position: relative; } 148 | } 149 | 150 | -------------------------------------------------------------------------------- /docs/html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/html/open.png -------------------------------------------------------------------------------- /docs/html/plus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/html/plusd.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/html/resize.js: -------------------------------------------------------------------------------- 1 | /* 2 | @licstart The following is the entire license notice for the JavaScript code in this file. 3 | 4 | The MIT License (MIT) 5 | 6 | Copyright (C) 1997-2020 by Dimitri van Heesch 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 9 | and associated documentation files (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 11 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all copies or 15 | substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 18 | BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 20 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | @licend The above is the entire license notice for the JavaScript code in this file 24 | */ 25 | 26 | function initResizable(treeview) { 27 | let sidenav,navtree,content,header,footer,barWidth=6; 28 | const RESIZE_COOKIE_NAME = ''+'width'; 29 | 30 | function resizeWidth() { 31 | const sidenavWidth = $(sidenav).outerWidth(); 32 | content.css({marginLeft:parseInt(sidenavWidth)+"px"}); 33 | if (typeof page_layout!=='undefined' && page_layout==1) { 34 | footer.css({marginLeft:parseInt(sidenavWidth)+"px"}); 35 | } 36 | Cookie.writeSetting(RESIZE_COOKIE_NAME,sidenavWidth-barWidth); 37 | } 38 | 39 | function restoreWidth(navWidth) { 40 | content.css({marginLeft:parseInt(navWidth)+barWidth+"px"}); 41 | if (typeof page_layout!=='undefined' && page_layout==1) { 42 | footer.css({marginLeft:parseInt(navWidth)+barWidth+"px"}); 43 | } 44 | sidenav.css({width:navWidth + "px"}); 45 | } 46 | 47 | function resizeHeight(treeview) { 48 | const headerHeight = header.outerHeight(); 49 | const windowHeight = $(window).height(); 50 | let contentHeight; 51 | if (treeview) 52 | { 53 | const footerHeight = footer.outerHeight(); 54 | let navtreeHeight,sideNavHeight; 55 | if (typeof page_layout==='undefined' || page_layout==0) { /* DISABLE_INDEX=NO */ 56 | contentHeight = windowHeight - headerHeight - footerHeight; 57 | navtreeHeight = contentHeight; 58 | sideNavHeight = contentHeight; 59 | } else if (page_layout==1) { /* DISABLE_INDEX=YES */ 60 | contentHeight = windowHeight - footerHeight; 61 | navtreeHeight = windowHeight - headerHeight; 62 | sideNavHeight = windowHeight; 63 | } 64 | navtree.css({height:navtreeHeight + "px"}); 65 | sidenav.css({height:sideNavHeight + "px"}); 66 | } 67 | else 68 | { 69 | contentHeight = windowHeight - headerHeight; 70 | } 71 | content.css({height:contentHeight + "px"}); 72 | if (location.hash.slice(1)) { 73 | (document.getElementById(location.hash.slice(1))||document.body).scrollIntoView(); 74 | } 75 | } 76 | 77 | function collapseExpand() { 78 | let newWidth; 79 | if (sidenav.width()>0) { 80 | newWidth=0; 81 | } else { 82 | const width = Cookie.readSetting(RESIZE_COOKIE_NAME,250); 83 | newWidth = (width>250 && width<$(window).width()) ? width : 250; 84 | } 85 | restoreWidth(newWidth); 86 | const sidenavWidth = $(sidenav).outerWidth(); 87 | Cookie.writeSetting(RESIZE_COOKIE_NAME,sidenavWidth-barWidth); 88 | } 89 | 90 | header = $("#top"); 91 | content = $("#doc-content"); 92 | footer = $("#nav-path"); 93 | sidenav = $("#side-nav"); 94 | if (!treeview) { 95 | // title = $("#titlearea"); 96 | // titleH = $(title).height(); 97 | // let animating = false; 98 | // content.on("scroll", function() { 99 | // slideOpts = { duration: 200, 100 | // step: function() { 101 | // contentHeight = $(window).height() - header.outerHeight(); 102 | // content.css({ height : contentHeight + "px" }); 103 | // }, 104 | // done: function() { animating=false; } 105 | // }; 106 | // if (content.scrollTop()>titleH && title.css('display')!='none' && !animating) { 107 | // title.slideUp(slideOpts); 108 | // animating=true; 109 | // } else if (content.scrollTop()<=titleH && title.css('display')=='none' && !animating) { 110 | // title.slideDown(slideOpts); 111 | // animating=true; 112 | // } 113 | // }); 114 | } else { 115 | navtree = $("#nav-tree"); 116 | $(".side-nav-resizable").resizable({resize: function(e, ui) { resizeWidth(); } }); 117 | $(sidenav).resizable({ minWidth: 0 }); 118 | } 119 | $(window).resize(function() { resizeHeight(treeview); }); 120 | if (treeview) 121 | { 122 | const device = navigator.userAgent.toLowerCase(); 123 | const touch_device = device.match(/(iphone|ipod|ipad|android)/); 124 | if (touch_device) { /* wider split bar for touch only devices */ 125 | $(sidenav).css({ paddingRight:'20px' }); 126 | $('.ui-resizable-e').css({ width:'20px' }); 127 | $('#nav-sync').css({ right:'34px' }); 128 | barWidth=20; 129 | } 130 | const width = Cookie.readSetting(RESIZE_COOKIE_NAME,250); 131 | if (width) { restoreWidth(width); } else { resizeWidth(); } 132 | } 133 | resizeHeight(treeview); 134 | const url = location.href; 135 | const i=url.indexOf("#"); 136 | if (i>=0) window.location.hash=url.substr(i); 137 | const _preventDefault = function(evt) { evt.preventDefault(); }; 138 | if (treeview) 139 | { 140 | $("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault); 141 | $(".ui-resizable-handle").dblclick(collapseExpand); 142 | // workaround for firefox 143 | $("body").css({overflow: "hidden"}); 144 | } 145 | $(window).on('load',function() { resizeHeight(treeview); }); 146 | } 147 | /* @license-end */ 148 | -------------------------------------------------------------------------------- /docs/html/search/all_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['1_20creating_20a_20component_0',['1. Creating a component',['../index.html#create_component',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/all_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['2_20building_20a_20circuit_0',['2. Building a circuit',['../index.html#use_component',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/all_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['a_20circuit_0',['2. Building a circuit',['../index.html#use_component',1,'']]], 4 | ['a_20component_1',['1. Creating a component',['../index.html#create_component',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/html/search/all_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['building_20a_20circuit_0',['2. Building a circuit',['../index.html#use_component',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/all_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['c_20dataflow_20framework_0',['The Refreshingly Simple C++ Dataflow Framework',['../index.html',1,'']]], 4 | ['circuit_1',['Circuit',['../class_d_s_patch_1_1_circuit.html',1,'DSPatch']]], 5 | ['circuit_2',['2. Building a circuit',['../index.html#use_component',1,'']]], 6 | ['component_3',['Component',['../class_d_s_patch_1_1_component.html',1,'DSPatch']]], 7 | ['component_4',['1. Creating a component',['../index.html#create_component',1,'']]], 8 | ['creating_20a_20component_5',['1. Creating a component',['../index.html#create_component',1,'']]] 9 | ]; 10 | -------------------------------------------------------------------------------- /docs/html/search/all_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['dataflow_20framework_0',['The Refreshingly Simple C++ Dataflow Framework',['../index.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/all_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['features_0',['Features',['../index.html#features_sec',1,'']]], 4 | ['framework_1',['The Refreshingly Simple C++ Dataflow Framework',['../index.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/html/search/all_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['getting_20started_0',['Getting Started',['../index.html#start_sec',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/all_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['introduction_0',['Introduction',['../index.html#intro_sec',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/all_9.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['plugin_0',['Plugin',['../class_d_s_patch_1_1_plugin.html',1,'DSPatch']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/all_a.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['refreshingly_20simple_20c_20dataflow_20framework_0',['The Refreshingly Simple C++ Dataflow Framework',['../index.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/all_b.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['signalbus_0',['SignalBus',['../class_d_s_patch_1_1_signal_bus.html',1,'DSPatch']]], 4 | ['simple_20c_20dataflow_20framework_1',['The Refreshingly Simple C++ Dataflow Framework',['../index.html',1,'']]], 5 | ['started_2',['Getting Started',['../index.html#start_sec',1,'']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/html/search/all_c.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['the_20refreshingly_20simple_20c_20dataflow_20framework_0',['The Refreshingly Simple C++ Dataflow Framework',['../index.html',1,'']]], 4 | ['tutorials_1',['Tutorials',['../index.html#tutorial_sec',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/html/search/classes_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['circuit_0',['Circuit',['../class_d_s_patch_1_1_circuit.html',1,'DSPatch']]], 4 | ['component_1',['Component',['../class_d_s_patch_1_1_component.html',1,'DSPatch']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/html/search/classes_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['plugin_0',['Plugin',['../class_d_s_patch_1_1_plugin.html',1,'DSPatch']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/classes_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['signalbus_0',['SignalBus',['../class_d_s_patch_1_1_signal_bus.html',1,'DSPatch']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/classes_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['signalbus_0',['SignalBus',['../class_d_s_patch_1_1_signal_bus.html',1,'DSPatch']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/classes_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['wire_0',['Wire',['../struct_d_s_patch_1_1internal_1_1_wire.html',1,'DSPatch::internal']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/close.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 12 | 14 | 18 | 19 | -------------------------------------------------------------------------------- /docs/html/search/mag.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 12 | 14 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /docs/html/search/mag_d.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 12 | 14 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /docs/html/search/mag_sel.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 13 | 15 | 21 | 26 | 31 | 32 | -------------------------------------------------------------------------------- /docs/html/search/mag_seld.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 13 | 15 | 21 | 26 | 31 | 32 | -------------------------------------------------------------------------------- /docs/html/search/pages_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['c_20dataflow_20framework_0',['The Refreshingly Simple C++ Dataflow Framework',['../index.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/pages_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['dataflow_20framework_0',['The Refreshingly Simple C++ Dataflow Framework',['../index.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/pages_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['framework_0',['The Refreshingly Simple C++ Dataflow Framework',['../index.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/pages_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['refreshingly_20simple_20c_20dataflow_20framework_0',['The Refreshingly Simple C++ Dataflow Framework',['../index.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/pages_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['simple_20c_20dataflow_20framework_0',['The Refreshingly Simple C++ Dataflow Framework',['../index.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/pages_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['the_20refreshingly_20simple_20c_20dataflow_20framework_0',['The Refreshingly Simple C++ Dataflow Framework',['../index.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/search.css: -------------------------------------------------------------------------------- 1 | /*---------------- Search Box positioning */ 2 | 3 | #main-menu > li:last-child { 4 | /* This
  • object is the parent of the search bar */ 5 | display: flex; 6 | justify-content: center; 7 | align-items: center; 8 | height: 36px; 9 | margin-right: 1em; 10 | } 11 | 12 | /*---------------- Search box styling */ 13 | 14 | .SRPage * { 15 | font-weight: normal; 16 | line-height: normal; 17 | } 18 | 19 | dark-mode-toggle { 20 | margin-left: 5px; 21 | display: flex; 22 | float: right; 23 | } 24 | 25 | #MSearchBox { 26 | display: inline-block; 27 | white-space : nowrap; 28 | background: var(--search-background-color); 29 | border-radius: 0.65em; 30 | box-shadow: var(--search-box-shadow); 31 | z-index: 102; 32 | } 33 | 34 | #MSearchBox .left { 35 | display: inline-block; 36 | vertical-align: middle; 37 | height: 1.4em; 38 | } 39 | 40 | #MSearchSelect { 41 | display: inline-block; 42 | vertical-align: middle; 43 | width: 20px; 44 | height: 19px; 45 | background-image: var(--search-magnification-select-image); 46 | margin: 0 0 0 0.3em; 47 | padding: 0; 48 | } 49 | 50 | #MSearchSelectExt { 51 | display: inline-block; 52 | vertical-align: middle; 53 | width: 10px; 54 | height: 19px; 55 | background-image: var(--search-magnification-image); 56 | margin: 0 0 0 0.5em; 57 | padding: 0; 58 | } 59 | 60 | 61 | #MSearchField { 62 | display: inline-block; 63 | vertical-align: middle; 64 | width: 7.5em; 65 | height: 19px; 66 | margin: 0 0.15em; 67 | padding: 0; 68 | line-height: 1em; 69 | border:none; 70 | color: var(--search-foreground-color); 71 | outline: none; 72 | font-family: var(--font-family-search); 73 | -webkit-border-radius: 0px; 74 | border-radius: 0px; 75 | background: none; 76 | } 77 | 78 | @media(hover: none) { 79 | /* to avoid zooming on iOS */ 80 | #MSearchField { 81 | font-size: 16px; 82 | } 83 | } 84 | 85 | #MSearchBox .right { 86 | display: inline-block; 87 | vertical-align: middle; 88 | width: 1.4em; 89 | height: 1.4em; 90 | } 91 | 92 | #MSearchClose { 93 | display: none; 94 | font-size: inherit; 95 | background : none; 96 | border: none; 97 | margin: 0; 98 | padding: 0; 99 | outline: none; 100 | 101 | } 102 | 103 | #MSearchCloseImg { 104 | padding: 0.3em; 105 | margin: 0; 106 | } 107 | 108 | .MSearchBoxActive #MSearchField { 109 | color: var(--search-active-color); 110 | } 111 | 112 | 113 | 114 | /*---------------- Search filter selection */ 115 | 116 | #MSearchSelectWindow { 117 | display: none; 118 | position: absolute; 119 | left: 0; top: 0; 120 | border: 1px solid var(--search-filter-border-color); 121 | background-color: var(--search-filter-background-color); 122 | z-index: 10001; 123 | padding-top: 4px; 124 | padding-bottom: 4px; 125 | -moz-border-radius: 4px; 126 | -webkit-border-top-left-radius: 4px; 127 | -webkit-border-top-right-radius: 4px; 128 | -webkit-border-bottom-left-radius: 4px; 129 | -webkit-border-bottom-right-radius: 4px; 130 | -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); 131 | } 132 | 133 | .SelectItem { 134 | font: 8pt var(--font-family-search); 135 | padding-left: 2px; 136 | padding-right: 12px; 137 | border: 0px; 138 | } 139 | 140 | span.SelectionMark { 141 | margin-right: 4px; 142 | font-family: var(--font-family-monospace); 143 | outline-style: none; 144 | text-decoration: none; 145 | } 146 | 147 | a.SelectItem { 148 | display: block; 149 | outline-style: none; 150 | color: var(--search-filter-foreground-color); 151 | text-decoration: none; 152 | padding-left: 6px; 153 | padding-right: 12px; 154 | } 155 | 156 | a.SelectItem:focus, 157 | a.SelectItem:active { 158 | color: var(--search-filter-foreground-color); 159 | outline-style: none; 160 | text-decoration: none; 161 | } 162 | 163 | a.SelectItem:hover { 164 | color: var(--search-filter-highlight-text-color); 165 | background-color: var(--search-filter-highlight-bg-color); 166 | outline-style: none; 167 | text-decoration: none; 168 | cursor: pointer; 169 | display: block; 170 | } 171 | 172 | /*---------------- Search results window */ 173 | 174 | iframe#MSearchResults { 175 | /*width: 60ex;*/ 176 | height: 15em; 177 | } 178 | 179 | #MSearchResultsWindow { 180 | display: none; 181 | position: absolute; 182 | left: 0; top: 0; 183 | border: 1px solid var(--search-results-border-color); 184 | background-color: var(--search-results-background-color); 185 | z-index:10000; 186 | width: 300px; 187 | height: 400px; 188 | overflow: auto; 189 | } 190 | 191 | /* ----------------------------------- */ 192 | 193 | 194 | #SRIndex { 195 | clear:both; 196 | } 197 | 198 | .SREntry { 199 | font-size: 10pt; 200 | padding-left: 1ex; 201 | } 202 | 203 | .SRPage .SREntry { 204 | font-size: 8pt; 205 | padding: 1px 5px; 206 | } 207 | 208 | div.SRPage { 209 | margin: 5px 2px; 210 | background-color: var(--search-results-background-color); 211 | } 212 | 213 | .SRChildren { 214 | padding-left: 3ex; padding-bottom: .5em 215 | } 216 | 217 | .SRPage .SRChildren { 218 | display: none; 219 | } 220 | 221 | .SRSymbol { 222 | font-weight: bold; 223 | color: var(--search-results-foreground-color); 224 | font-family: var(--font-family-search); 225 | text-decoration: none; 226 | outline: none; 227 | } 228 | 229 | a.SRScope { 230 | display: block; 231 | color: var(--search-results-foreground-color); 232 | font-family: var(--font-family-search); 233 | font-size: 8pt; 234 | text-decoration: none; 235 | outline: none; 236 | } 237 | 238 | a.SRSymbol:focus, a.SRSymbol:active, 239 | a.SRScope:focus, a.SRScope:active { 240 | text-decoration: underline; 241 | } 242 | 243 | span.SRScope { 244 | padding-left: 4px; 245 | font-family: var(--font-family-search); 246 | } 247 | 248 | .SRPage .SRStatus { 249 | padding: 2px 5px; 250 | font-size: 8pt; 251 | font-style: italic; 252 | font-family: var(--font-family-search); 253 | } 254 | 255 | .SRResult { 256 | display: none; 257 | } 258 | 259 | div.searchresults { 260 | margin-left: 10px; 261 | margin-right: 10px; 262 | } 263 | 264 | /*---------------- External search page results */ 265 | 266 | .pages b { 267 | color: white; 268 | padding: 5px 5px 3px 5px; 269 | background-image: var(--nav-gradient-active-image-parent); 270 | background-repeat: repeat-x; 271 | text-shadow: 0 1px 1px #000000; 272 | } 273 | 274 | .pages { 275 | line-height: 17px; 276 | margin-left: 4px; 277 | text-decoration: none; 278 | } 279 | 280 | .hl { 281 | font-weight: bold; 282 | } 283 | 284 | #searchresults { 285 | margin-bottom: 20px; 286 | } 287 | 288 | .searchpages { 289 | margin-top: 10px; 290 | } 291 | 292 | -------------------------------------------------------------------------------- /docs/html/search/searchdata.js: -------------------------------------------------------------------------------- 1 | var indexSectionsWithContent = 2 | { 3 | 0: "12abcdfgiprst", 4 | 1: "cps", 5 | 2: "cdfrst" 6 | }; 7 | 8 | var indexSectionNames = 9 | { 10 | 0: "all", 11 | 1: "classes", 12 | 2: "pages" 13 | }; 14 | 15 | var indexSectionLabels = 16 | { 17 | 0: "All", 18 | 1: "Classes", 19 | 2: "Pages" 20 | }; 21 | 22 | -------------------------------------------------------------------------------- /docs/html/splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/html/splitbar.png -------------------------------------------------------------------------------- /docs/html/splitbard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/html/splitbard.png -------------------------------------------------------------------------------- /docs/html/struct_d_s_patch_1_1internal_1_1_wire-members.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | DSPatch: Member List 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
    19 |
    20 | 21 | 22 | 23 | 24 | 28 | 29 | 30 |
    25 |
    DSPatch v.10.2.4 26 |
    27 |
    31 |
    32 | 33 | 34 | 39 | 40 | 41 | 49 | 50 | 51 |
    55 |
    56 | 57 | 58 |
    59 |
    60 |
    61 |
    62 |
    63 |
    Loading...
    64 |
    Searching...
    65 |
    No Matches
    66 |
    67 |
    68 |
    69 |
    70 | 71 | 75 |
    76 |
    77 |
    DSPatch::internal::Wire Member List
    78 |
    79 |
    80 | 81 |

    This is the complete list of members for DSPatch::internal::Wire, including all inherited members.

    82 | 83 | 84 | 85 | 86 |
    fromComponent (defined in DSPatch::internal::Wire)DSPatch::internal::Wire
    fromOutput (defined in DSPatch::internal::Wire)DSPatch::internal::Wire
    toInput (defined in DSPatch::internal::Wire)DSPatch::internal::Wire
    87 | 88 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /docs/html/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/html/sync_off.png -------------------------------------------------------------------------------- /docs/html/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/html/sync_on.png -------------------------------------------------------------------------------- /docs/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/html/tab_a.png -------------------------------------------------------------------------------- /docs/html/tab_ad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/html/tab_ad.png -------------------------------------------------------------------------------- /docs/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/html/tab_b.png -------------------------------------------------------------------------------- /docs/html/tab_bd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/html/tab_bd.png -------------------------------------------------------------------------------- /docs/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/html/tab_h.png -------------------------------------------------------------------------------- /docs/html/tab_hd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/html/tab_hd.png -------------------------------------------------------------------------------- /docs/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/html/tab_s.png -------------------------------------------------------------------------------- /docs/html/tab_sd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cross-platform/dspatch/29022646fbae45196197a0f871d5c8d2d288e77a/docs/html/tab_sd.png -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/latex/Makefile: -------------------------------------------------------------------------------- 1 | LATEX_CMD?=pdflatex 2 | MKIDX_CMD?=makeindex 3 | BIBTEX_CMD?=bibtex 4 | LATEX_COUNT?=8 5 | MANUAL_FILE?=refman 6 | 7 | all: $(MANUAL_FILE).pdf 8 | 9 | pdf: $(MANUAL_FILE).pdf 10 | 11 | $(MANUAL_FILE).pdf: clean $(MANUAL_FILE).tex 12 | $(LATEX_CMD) $(MANUAL_FILE) || \ 13 | if [ $$? != 0 ] ; then \ 14 | \echo "Please consult $(MANUAL_FILE).log to see the error messages" ; \ 15 | false; \ 16 | fi 17 | $(MKIDX_CMD) $(MANUAL_FILE).idx 18 | $(LATEX_CMD) $(MANUAL_FILE) || \ 19 | if [ $$? != 0 ] ; then \ 20 | \echo "Please consult $(MANUAL_FILE).log to see the error messages" ; \ 21 | false; \ 22 | fi 23 | latex_count=$(LATEX_COUNT) ; \ 24 | while grep -E -s 'Rerun (LaTeX|to get cross-references right|to get bibliographical references right)' $(MANUAL_FILE).log && [ $$latex_count -gt 0 ] ;\ 25 | do \ 26 | echo "Rerunning latex...." ;\ 27 | $(LATEX_CMD) $(MANUAL_FILE) || \ 28 | if [ $$? != 0 ] ; then \ 29 | \echo "Please consult $(MANUAL_FILE).log to see the error messages" ; \ 30 | false; \ 31 | fi; \ 32 | latex_count=`expr $$latex_count - 1` ;\ 33 | done 34 | $(MKIDX_CMD) $(MANUAL_FILE).idx 35 | $(LATEX_CMD) $(MANUAL_FILE) || \ 36 | if [ $$? != 0 ] ; then \ 37 | \echo "Please consult $(MANUAL_FILE).log to see the error messages" ; \ 38 | false; \ 39 | fi 40 | 41 | clean: 42 | rm -f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl $(MANUAL_FILE).pdf 43 | -------------------------------------------------------------------------------- /include/dspatch/Plugin.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | DSPatch - The Refreshingly Simple C++ Dataflow Framework 3 | Copyright (c) 2025, Marcus Tomlinson 4 | 5 | BSD 2-Clause License 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ******************************************************************************/ 28 | 29 | #pragma once 30 | 31 | #include "Component.h" 32 | 33 | #ifdef _WIN32 34 | #define WIN32_LEAN_AND_MEAN 35 | #include 36 | #undef WIN32_LEAN_AND_MEAN 37 | #define DLLEXPORT __declspec( dllexport ) 38 | #else 39 | #include 40 | #define DLLEXPORT 41 | #endif 42 | 43 | #include 44 | 45 | #define EXPORT_PLUGIN( classname, ... ) \ 46 | extern "C" \ 47 | { \ 48 | DLLEXPORT DSPatch::Component* Create() \ 49 | { \ 50 | return new classname( __VA_ARGS__ ); \ 51 | } \ 52 | } 53 | 54 | namespace DSPatch 55 | { 56 | 57 | /// Component plugin loader 58 | 59 | /** 60 | A component, packaged into a shared library (.so / .dylib / .dll) and exported via the EXPORT_PLUGIN macro, can be dynamically 61 | loaded into a host application using the Plugin class. Each Plugin object represents one Component class. (Example component plugins) 63 | 64 | A Plugin should be constructed with the absolute path of the plugin (shared library) to be loaded. Once instantiated you should 65 | check that the plugin was successfully loaded by calling IsLoaded(). Thereafter, the contained component type can be instantiated 66 | (mutiple times) via the Create() method. 67 | */ 68 | 69 | class Plugin final 70 | { 71 | public: 72 | Plugin( const Plugin& ) = delete; 73 | Plugin& operator=( const Plugin& ) = delete; 74 | 75 | explicit Plugin( const std::string& pluginPath ); 76 | ~Plugin(); 77 | 78 | bool IsLoaded() const; 79 | 80 | Component::SPtr Create() const; 81 | 82 | private: 83 | typedef DSPatch::Component* ( *Create_t )(); 84 | 85 | void* _handle = nullptr; 86 | Create_t _create = nullptr; 87 | }; 88 | 89 | inline Plugin::Plugin( const std::string& pluginPath ) 90 | { 91 | // open library 92 | #ifdef _WIN32 93 | _handle = LoadLibrary( pluginPath.c_str() ); 94 | #else 95 | _handle = dlopen( pluginPath.c_str(), RTLD_NOW ); 96 | #endif 97 | 98 | if ( _handle ) 99 | { 100 | // load symbols 101 | #ifdef _WIN32 102 | _create = (Create_t)GetProcAddress( (HMODULE)_handle, "Create" ); 103 | #else 104 | _create = (Create_t)dlsym( _handle, "Create" ); 105 | #endif 106 | 107 | if ( !_create ) 108 | { 109 | #ifdef _WIN32 110 | FreeLibrary( (HMODULE)_handle ); 111 | #else 112 | dlclose( _handle ); 113 | #endif 114 | 115 | _handle = nullptr; 116 | } 117 | } 118 | } 119 | 120 | inline Plugin::~Plugin() 121 | { 122 | // close library 123 | if ( _handle ) 124 | { 125 | #ifdef _WIN32 126 | FreeLibrary( (HMODULE)_handle ); 127 | #else 128 | dlclose( _handle ); 129 | #endif 130 | } 131 | } 132 | 133 | // cppcheck-suppress unusedFunction 134 | inline bool Plugin::IsLoaded() const 135 | { 136 | return _handle; 137 | } 138 | 139 | // cppcheck-suppress unusedFunction 140 | inline Component::SPtr Plugin::Create() const 141 | { 142 | if ( _handle ) 143 | { 144 | return Component::SPtr( _create() ); 145 | } 146 | return nullptr; 147 | } 148 | 149 | } // namespace DSPatch 150 | -------------------------------------------------------------------------------- /include/dspatch/SignalBus.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | DSPatch - The Refreshingly Simple C++ Dataflow Framework 3 | Copyright (c) 2025, Marcus Tomlinson 4 | 5 | BSD 2-Clause License 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ******************************************************************************/ 28 | 29 | #pragma once 30 | 31 | #include "../fast_any/any.h" 32 | 33 | #include 34 | 35 | namespace DSPatch 36 | { 37 | 38 | /// Signal container 39 | 40 | /** 41 | Components process and transfer data between each other in the form of "signals" via interconnected wires. SignalBuses are signal 42 | containers. Via the Process_() method, a Component receives signals into its "inputs" SignalBus and provides signals to its 43 | "outputs" SignalBus. The SignalBus class provides public getters and setters for manipulating its internal signal values, 44 | abstracting the need to retrieve and interface with them directly. 45 | 46 | Signals can be dynamically typed at runtime, this means a signal has the ability to change its data type at any point during 47 | program execution. This is designed such that a SignalBus can hold any number of different typed variables, as well as to allow 48 | for a variable to dynamically change its type when needed - this can be useful for inputs that accept a number of different data 49 | types (E.g. Varying sample size in an audio buffer: array of byte / int / float). 50 | */ 51 | 52 | class SignalBus final 53 | { 54 | public: 55 | SignalBus( const SignalBus& ) = delete; 56 | SignalBus& operator=( const SignalBus& ) = delete; 57 | 58 | SignalBus(); 59 | SignalBus( SignalBus&& ); 60 | ~SignalBus(); 61 | 62 | void SetSignalCount( int signalCount ); 63 | int GetSignalCount() const; 64 | 65 | fast_any::any* GetSignal( int signalIndex ); 66 | 67 | bool HasValue( int signalIndex ) const; 68 | 69 | template 70 | ValueType* GetValue( int signalIndex ) const; 71 | 72 | template 73 | void SetValue( int signalIndex, const ValueType& newValue ); 74 | 75 | template 76 | void MoveValue( int signalIndex, ValueType&& newValue ); 77 | 78 | void SetSignal( int toSignalIndex, const fast_any::any& fromSignal ); 79 | void MoveSignal( int toSignalIndex, fast_any::any& fromSignal ); 80 | 81 | void ClearValue( int signalIndex ); 82 | void ClearAllValues(); 83 | 84 | fast_any::type_info GetType( int signalIndex ) const; 85 | 86 | private: 87 | std::vector _signals; 88 | }; 89 | 90 | inline SignalBus::SignalBus() = default; 91 | 92 | inline SignalBus::SignalBus( SignalBus&& rhs ) 93 | : _signals( std::move( rhs._signals ) ) 94 | { 95 | } 96 | 97 | inline SignalBus::~SignalBus() = default; 98 | 99 | inline void SignalBus::SetSignalCount( int signalCount ) 100 | { 101 | _signals.resize( signalCount ); 102 | } 103 | 104 | inline int SignalBus::GetSignalCount() const 105 | { 106 | return (int)_signals.size(); 107 | } 108 | 109 | inline fast_any::any* SignalBus::GetSignal( int signalIndex ) 110 | { 111 | // You might be thinking: Why the raw pointer return here? 112 | 113 | // This is for usability and performance reasons. Usability, because a pointer allows the user 114 | // to manipulate the contained value externally. Performance, because returning a smart pointer 115 | // means having to store the value as a smart pointer too - this adds yet another level of 116 | // indirection to the value, as well as some reference counting overhead. These Get() and Set() 117 | // methods are VERY frequently called, so doing as little as possible with the data here is best. 118 | 119 | return &_signals[signalIndex]; 120 | } 121 | 122 | inline bool SignalBus::HasValue( int signalIndex ) const 123 | { 124 | return _signals[signalIndex].has_value(); 125 | } 126 | 127 | template 128 | inline ValueType* SignalBus::GetValue( int signalIndex ) const 129 | { 130 | // You might be thinking: Why the raw pointer return here? 131 | 132 | // See: GetSignal(). 133 | 134 | return _signals[signalIndex].as(); 135 | } 136 | 137 | template 138 | inline void SignalBus::SetValue( int signalIndex, const ValueType& newValue ) 139 | { 140 | _signals[signalIndex].emplace( newValue ); 141 | } 142 | 143 | template 144 | inline void SignalBus::MoveValue( int signalIndex, ValueType&& newValue ) 145 | { 146 | _signals[signalIndex].emplace( std::forward( newValue ) ); 147 | } 148 | 149 | inline void SignalBus::SetSignal( int toSignalIndex, const fast_any::any& fromSignal ) 150 | { 151 | _signals[toSignalIndex].emplace( fromSignal ); 152 | } 153 | 154 | inline void SignalBus::MoveSignal( int toSignalIndex, fast_any::any& fromSignal ) 155 | { 156 | // You might be thinking: Why swap and not move here? 157 | 158 | // This is a really nifty little optimisation actually. When we move a signal value from an 159 | // output to an input (or vice-versa within a component) we move its type_info along with it. 160 | // If you look at any::emplace(), you'll see that type_info is really useful in determining 161 | // whether we need to delete and copy (re)construct our contained value, or can simply copy 162 | // assign. To avoid the former as much as possible, a swap is done between source and target 163 | // signals such that, between these two points, just two value holders need to be constructed, 164 | // and shared back and forth from then on. 165 | 166 | _signals[toSignalIndex].swap( fromSignal ); 167 | } 168 | 169 | inline void SignalBus::ClearValue( int signalIndex ) 170 | { 171 | _signals[signalIndex].reset(); 172 | } 173 | 174 | inline void SignalBus::ClearAllValues() 175 | { 176 | for ( auto& signal : _signals ) 177 | { 178 | signal.reset(); 179 | } 180 | } 181 | 182 | inline fast_any::type_info SignalBus::GetType( int signalIndex ) const 183 | { 184 | return _signals[signalIndex].type(); 185 | } 186 | 187 | } // namespace DSPatch 188 | -------------------------------------------------------------------------------- /meson.build: -------------------------------------------------------------------------------- 1 | project('DSPatch', 'cpp', 2 | default_options: [ 3 | 'cpp_std=c++17', 4 | 'warning_level=3', 5 | 'werror=true' 6 | ] 7 | ) 8 | 9 | if host_machine.system() == 'darwin' 10 | env = environment() 11 | env.set('MACOSX_DEPLOYMENT_TARGET', '10.13') 12 | 13 | add_project_arguments(['-mmacosx-version-min=10.13', '-arch', 'arm64', '-arch', 'x86_64'], language: 'cpp') 14 | add_project_link_arguments(['-mmacosx-version-min=10.13', '-arch', 'arm64', '-arch', 'x86_64'], language: 'cpp') 15 | endif 16 | 17 | # Add code coverage 18 | 19 | opencppcoverage = find_program('opencppcoverage', required: false) 20 | 21 | opencppcoverage_args = [ 22 | '--sources', meson.project_name(), 23 | '--excluded_sources', 'tests', 24 | '--excluded_sources', 'tutorial' 25 | ] 26 | 27 | if opencppcoverage.found() 28 | run_target('codecoverage', 29 | command: [ 30 | opencppcoverage, 31 | '--input_coverage', 'Tests.cov', 32 | '--export_type', 'html:coverage' 33 | ] 34 | ) 35 | endif 36 | 37 | # Add formatting 38 | 39 | format_first = [] 40 | if find_program('clang-format', required: false).found() 41 | if host_machine.system() == 'windows' 42 | format_command = meson.current_source_dir() + '/scripts/clang-format.bat' 43 | else 44 | format_command = ['bash', meson.current_source_dir() + '/scripts/clang-format.sh'] 45 | endif 46 | 47 | format_first = custom_target( 48 | output: 'formatting', 49 | command: format_command, 50 | build_always: true 51 | ) 52 | endif 53 | 54 | # Add static code analysis 55 | 56 | if find_program('cppcheck', required: false).found() 57 | if host_machine.system() == 'windows' 58 | extra_cppcheck_args = ['-D_WIN32'] 59 | else 60 | extra_cppcheck_args = [] 61 | endif 62 | 63 | custom_target( 64 | input: format_first, 65 | output: 'static code analysis', 66 | command: [ 67 | 'cppcheck', 68 | 69 | '--error-exitcode=1', 70 | '--enable=all', 71 | '--check-level=exhaustive', 72 | '--inconclusive', 73 | '--inline-suppr', 74 | '--force', 75 | '--quiet', 76 | '--suppress=missingIncludeSystem', 77 | '--suppress=*:' + meson.current_source_dir() + '/include/fast_any/any.h', 78 | 79 | '-i', meson.current_source_dir() + '/build', 80 | '-I', meson.current_source_dir() + '/include', 81 | 82 | extra_cppcheck_args, 83 | 84 | meson.current_source_dir() 85 | ], 86 | build_always: true 87 | ) 88 | endif 89 | 90 | # Configure DSPatch 91 | 92 | dspatch_dep = declare_dependency( 93 | include_directories: include_directories('include'), 94 | dependencies: dependency('threads') 95 | ) 96 | 97 | # Add subdirectories 98 | 99 | subdir('tests') 100 | subdir('tutorial') 101 | -------------------------------------------------------------------------------- /scripts/clang-format.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | cd %~dp0.. 4 | 5 | call :processDir 6 | goto :finish 7 | 8 | :processDir 9 | for %%f in ("*.cpp", "*.h") do ( 10 | clang-format --style=file --verbose -i %%f 11 | ) 12 | 13 | for /D %%d in (*) do ( 14 | cd %%d 15 | if not %%d==build if not %%d==builddir call :processDir 16 | cd .. 17 | ) 18 | 19 | exit /b 20 | 21 | :finish 22 | -------------------------------------------------------------------------------- /scripts/clang-format.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" 4 | cd "$DIR/.." 5 | 6 | find . -iname *.h -o -iname *.cpp | grep -v build | grep -v builddir | xargs clang-format --style=file --verbose -i 7 | -------------------------------------------------------------------------------- /tests/components/Adder.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | DSPatch - The Refreshingly Simple C++ Dataflow Framework 3 | Copyright (c) 2025, Marcus Tomlinson 4 | 5 | BSD 2-Clause License 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ******************************************************************************/ 28 | 29 | #pragma once 30 | 31 | namespace DSPatch 32 | { 33 | 34 | class Adder final : public Component 35 | { 36 | public: 37 | Adder() 38 | : Component( ProcessOrder::OutOfOrder ) 39 | { 40 | SetInputCount_( 2 ); 41 | SetOutputCount_( 1 ); 42 | } 43 | 44 | protected: 45 | void Process_( SignalBus& inputs, SignalBus& outputs ) override 46 | { 47 | auto in0 = inputs.GetValue( 0 ); 48 | auto in1 = inputs.GetValue( 1 ); 49 | 50 | outputs.SetValue( 0, ( in0 ? *in0 : 0 ) + ( in1 ? *in1 : 0 ) ); 51 | } 52 | }; 53 | 54 | } // namespace DSPatch 55 | -------------------------------------------------------------------------------- /tests/components/BranchSyncProbe.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | DSPatch - The Refreshingly Simple C++ Dataflow Framework 3 | Copyright (c) 2025, Marcus Tomlinson 4 | 5 | BSD 2-Clause License 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ******************************************************************************/ 28 | 29 | #pragma once 30 | 31 | namespace DSPatch 32 | { 33 | 34 | class BranchSyncProbe final : public Component 35 | { 36 | public: 37 | BranchSyncProbe( int p1, int p2, int p3 ) 38 | : _p1( p1 ) 39 | , _p2( p2 ) 40 | , _p3( p3 ) 41 | , _count( 0 ) 42 | { 43 | SetInputCount_( 3 ); 44 | } 45 | 46 | protected: 47 | void Process_( SignalBus& inputs, SignalBus& ) override 48 | { 49 | auto in0 = inputs.GetValue( 0 ); 50 | REQUIRE( in0 ); 51 | 52 | auto in1 = inputs.GetValue( 1 ); 53 | REQUIRE( in1 ); 54 | 55 | auto in2 = inputs.GetValue( 2 ); 56 | REQUIRE( in2 ); 57 | 58 | REQUIRE( *in0 == _p1 + _count ); 59 | REQUIRE( *in1 == _p2 + _count ); 60 | REQUIRE( *in2 == _p3 + _count++ ); 61 | } 62 | 63 | private: 64 | int _p1; 65 | int _p2; 66 | int _p3; 67 | int _count; 68 | }; 69 | 70 | } // namespace DSPatch 71 | -------------------------------------------------------------------------------- /tests/components/ChangingCounter.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | DSPatch - The Refreshingly Simple C++ Dataflow Framework 3 | Copyright (c) 2025, Marcus Tomlinson 4 | 5 | BSD 2-Clause License 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ******************************************************************************/ 28 | 29 | #pragma once 30 | 31 | namespace DSPatch 32 | { 33 | 34 | class ChangingCounter final : public Component 35 | { 36 | public: 37 | ChangingCounter() 38 | : _count( 0 ) 39 | { 40 | srand( (unsigned int)time( nullptr ) ); 41 | 42 | SetOutputCount_( 1 ); 43 | } 44 | 45 | protected: 46 | void Process_( SignalBus&, SignalBus& outputs ) override 47 | { 48 | if ( rand() % 2 == 1 ) 49 | { 50 | int choice = rand() % 4; 51 | 52 | switch ( choice ) 53 | { 54 | case 0: 55 | outputs.SetValue( 0, _count++ ); 56 | break; 57 | case 1: 58 | outputs.SetValue( 0, (float)_count++ ); 59 | break; 60 | case 2: 61 | outputs.SetValue( 0, std::to_string( _count++ ) ); 62 | break; 63 | case 3: 64 | outputs.SetValue( 0, std::vector{ _count, _count + 1, _count + 2 } ); 65 | _count += 3; 66 | break; 67 | } 68 | } 69 | else 70 | { 71 | outputs.ClearValue( 0 ); 72 | } 73 | } 74 | 75 | private: 76 | int _count; 77 | }; 78 | 79 | } // namespace DSPatch 80 | -------------------------------------------------------------------------------- /tests/components/ChangingProbe.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | DSPatch - The Refreshingly Simple C++ Dataflow Framework 3 | Copyright (c) 2025, Marcus Tomlinson 4 | 5 | BSD 2-Clause License 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ******************************************************************************/ 28 | 29 | #pragma once 30 | 31 | namespace DSPatch 32 | { 33 | 34 | class ChangingProbe final : public Component 35 | { 36 | public: 37 | ChangingProbe() 38 | : _count( 0 ) 39 | { 40 | SetInputCount_( 1 ); 41 | } 42 | 43 | protected: 44 | void Process_( SignalBus& inputs, SignalBus& ) override 45 | { 46 | if ( const auto* integer = inputs.GetValue( 0 ) ) 47 | { 48 | REQUIRE( *integer == _count++ ); 49 | } 50 | else if ( const auto* floating = inputs.GetValue( 0 ) ) 51 | { 52 | REQUIRE( *floating == (float)_count++ ); 53 | } 54 | else if ( const auto* string = inputs.GetValue( 0 ) ) 55 | { 56 | REQUIRE( *string == std::to_string( _count++ ) ); 57 | } 58 | else if ( const auto* vector = inputs.GetValue>( 0 ) ) 59 | { 60 | REQUIRE( ( *vector )[0] == _count++ ); 61 | REQUIRE( ( *vector )[1] == _count++ ); 62 | REQUIRE( ( *vector )[2] == _count++ ); 63 | } 64 | } 65 | 66 | private: 67 | int _count; 68 | }; 69 | 70 | } // namespace DSPatch 71 | -------------------------------------------------------------------------------- /tests/components/CircuitCounter.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | DSPatch - The Refreshingly Simple C++ Dataflow Framework 3 | Copyright (c) 2025, Marcus Tomlinson 4 | 5 | BSD 2-Clause License 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ******************************************************************************/ 28 | 29 | #pragma once 30 | 31 | namespace DSPatch 32 | { 33 | 34 | class CircuitCounter final : public Component 35 | { 36 | public: 37 | CircuitCounter() 38 | : _count( 0 ) 39 | { 40 | SetInputCount_( 1 ); 41 | SetOutputCount_( 1 ); 42 | } 43 | 44 | protected: 45 | void Process_( SignalBus& inputs, SignalBus& outputs ) override 46 | { 47 | auto in = inputs.GetValue( 0 ); 48 | if ( in ) 49 | { 50 | // Count only when the circuit is closed 51 | ++_count; 52 | } 53 | 54 | outputs.SetValue( 0, _count ); 55 | } 56 | 57 | private: 58 | int _count; 59 | }; 60 | 61 | } // namespace DSPatch 62 | -------------------------------------------------------------------------------- /tests/components/CircuitProbe.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | DSPatch - The Refreshingly Simple C++ Dataflow Framework 3 | Copyright (c) 2025, Marcus Tomlinson 4 | 5 | BSD 2-Clause License 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ******************************************************************************/ 28 | 29 | #pragma once 30 | 31 | namespace DSPatch 32 | { 33 | 34 | class CircuitProbe final : public Component 35 | { 36 | public: 37 | CircuitProbe() 38 | : _count( 0 ) 39 | { 40 | SetInputCount_( 1 ); 41 | SetOutputCount_( 1 ); 42 | } 43 | 44 | protected: 45 | void Process_( SignalBus& inputs, SignalBus& outputs ) override 46 | { 47 | const auto* in = inputs.GetValue( 0 ); 48 | if ( in ) 49 | { 50 | REQUIRE( *in == _count++ ); 51 | 52 | // inform the counter that the circuit is closed 53 | outputs.SetValue( 0, true ); 54 | } 55 | else 56 | { 57 | outputs.ClearValue( 0 ); 58 | } 59 | } 60 | 61 | private: 62 | int _count; 63 | }; 64 | 65 | } // namespace DSPatch 66 | -------------------------------------------------------------------------------- /tests/components/Counter.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | DSPatch - The Refreshingly Simple C++ Dataflow Framework 3 | Copyright (c) 2025, Marcus Tomlinson 4 | 5 | BSD 2-Clause License 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ******************************************************************************/ 28 | 29 | #pragma once 30 | 31 | namespace DSPatch 32 | { 33 | 34 | class Counter final : public Component 35 | { 36 | public: 37 | explicit Counter( int increment = 1 ) 38 | : _count( 0 ) 39 | , _increment( increment ) 40 | { 41 | SetOutputCount_( 1 ); 42 | } 43 | 44 | int Count() const 45 | { 46 | return _count; 47 | } 48 | 49 | protected: 50 | void Process_( SignalBus&, SignalBus& outputs ) override 51 | { 52 | outputs.SetValue( 0, _count ); 53 | _count += _increment; 54 | } 55 | 56 | private: 57 | int _count; 58 | const int _increment; 59 | }; 60 | 61 | } // namespace DSPatch 62 | -------------------------------------------------------------------------------- /tests/components/FeedbackProbe.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | DSPatch - The Refreshingly Simple C++ Dataflow Framework 3 | Copyright (c) 2025, Marcus Tomlinson 4 | 5 | BSD 2-Clause License 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ******************************************************************************/ 28 | 29 | #pragma once 30 | 31 | namespace DSPatch 32 | { 33 | 34 | class FeedbackProbe final : public Component 35 | { 36 | public: 37 | FeedbackProbe() 38 | : _adder_in( 0 ) 39 | , _adder_out( 0 ) 40 | { 41 | SetInputCount_( 1 ); 42 | } 43 | 44 | protected: 45 | void Process_( SignalBus& inputs, SignalBus& ) override 46 | { 47 | auto in = inputs.GetValue( 0 ); 48 | REQUIRE( in ); 49 | 50 | // The Adder component adds a counter input to its previous output 51 | _adder_out = _adder_in + _adder_out; 52 | 53 | REQUIRE( *in == _adder_out ); 54 | 55 | ++_adder_in; 56 | } 57 | 58 | private: 59 | int _adder_in; 60 | int _adder_out; 61 | }; 62 | 63 | } // namespace DSPatch 64 | -------------------------------------------------------------------------------- /tests/components/FeedbackTester.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | DSPatch - The Refreshingly Simple C++ Dataflow Framework 3 | Copyright (c) 2025, Marcus Tomlinson 4 | 5 | BSD 2-Clause License 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ******************************************************************************/ 28 | 29 | #pragma once 30 | 31 | namespace DSPatch 32 | { 33 | 34 | class FeedbackTester final : public Component 35 | { 36 | public: 37 | explicit FeedbackTester( int bufferCount ) 38 | : _bufferCount( bufferCount ) 39 | { 40 | SetInputCount_( 10 ); 41 | SetOutputCount_( 1 ); 42 | } 43 | 44 | void SetValidInputs( int count ) 45 | { 46 | _inputs = count; 47 | } 48 | 49 | protected: 50 | void Process_( SignalBus& inputs, SignalBus& outputs ) override 51 | { 52 | for ( int i = 0; i < _inputs; ++i ) 53 | { 54 | auto in = inputs.GetValue( i ); 55 | if ( _counter >= _bufferCount ) 56 | { 57 | REQUIRE( in ); 58 | REQUIRE( *in == _counter - ( _bufferCount - 1 ) ); 59 | } 60 | } 61 | 62 | outputs.SetValue( 0, ++_counter ); 63 | } 64 | 65 | private: 66 | const int _bufferCount = 0; 67 | int _inputs = 0; 68 | int _counter = 0; 69 | }; 70 | 71 | } // namespace DSPatch 72 | -------------------------------------------------------------------------------- /tests/components/Incrementer.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | DSPatch - The Refreshingly Simple C++ Dataflow Framework 3 | Copyright (c) 2025, Marcus Tomlinson 4 | 5 | BSD 2-Clause License 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ******************************************************************************/ 28 | 29 | #pragma once 30 | 31 | #include 32 | 33 | namespace DSPatch 34 | { 35 | 36 | class Incrementer final : public Component 37 | { 38 | public: 39 | explicit Incrementer( int increment = 1 ) 40 | : Component( ProcessOrder::OutOfOrder ) 41 | , _increment( increment ) 42 | { 43 | SetInputCount_( 1 ); 44 | SetOutputCount_( 1 ); 45 | } 46 | 47 | protected: 48 | void Process_( SignalBus& inputs, SignalBus& outputs ) override 49 | { 50 | auto in = inputs.GetValue( 0 ); 51 | if ( in ) 52 | { 53 | *in += _increment; 54 | outputs.MoveValue( 0, std::move( *in ) ); // pass the adjusted signal through (no copy) 55 | } 56 | // else set no output 57 | } 58 | 59 | private: 60 | const int _increment; 61 | }; 62 | 63 | } // namespace DSPatch 64 | -------------------------------------------------------------------------------- /tests/components/NoOutputProbe.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | DSPatch - The Refreshingly Simple C++ Dataflow Framework 3 | Copyright (c) 2025, Marcus Tomlinson 4 | 5 | BSD 2-Clause License 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ******************************************************************************/ 28 | 29 | #pragma once 30 | 31 | namespace DSPatch 32 | { 33 | 34 | class NoOutputProbe final : public Component 35 | { 36 | public: 37 | NoOutputProbe() 38 | : _count( 0 ) 39 | { 40 | SetInputCount_( 1 ); 41 | } 42 | 43 | protected: 44 | void Process_( SignalBus& inputs, SignalBus& ) override 45 | { 46 | const auto* in = inputs.GetValue( 0 ); 47 | 48 | if ( in ) 49 | { 50 | REQUIRE( *in == _count++ ); 51 | } 52 | } 53 | 54 | private: 55 | int _count; 56 | }; 57 | 58 | } // namespace DSPatch 59 | -------------------------------------------------------------------------------- /tests/components/NullInputProbe.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | DSPatch - The Refreshingly Simple C++ Dataflow Framework 3 | Copyright (c) 2025, Marcus Tomlinson 4 | 5 | BSD 2-Clause License 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ******************************************************************************/ 28 | 29 | #pragma once 30 | 31 | namespace DSPatch 32 | { 33 | 34 | class NullInputProbe final : public Component 35 | { 36 | public: 37 | NullInputProbe() 38 | : Component( ProcessOrder::OutOfOrder ) 39 | { 40 | SetInputCount_( 2 ); 41 | } 42 | 43 | protected: 44 | void Process_( SignalBus& inputs, SignalBus& ) override 45 | { 46 | const auto* in0 = inputs.GetValue( 0 ); 47 | REQUIRE( !in0 ); 48 | 49 | const auto* in1 = inputs.GetValue( 1 ); 50 | REQUIRE( !in1 ); 51 | } 52 | }; 53 | 54 | } // namespace DSPatch 55 | -------------------------------------------------------------------------------- /tests/components/ParallelProbe.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | DSPatch - The Refreshingly Simple C++ Dataflow Framework 3 | Copyright (c) 2025, Marcus Tomlinson 4 | 5 | BSD 2-Clause License 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ******************************************************************************/ 28 | 29 | #pragma once 30 | 31 | namespace DSPatch 32 | { 33 | 34 | class ParallelProbe final : public Component 35 | { 36 | public: 37 | ParallelProbe() 38 | : _count( 0 ) 39 | { 40 | SetInputCount_( 5 ); 41 | } 42 | 43 | protected: 44 | void Process_( SignalBus& inputs, SignalBus& ) override 45 | { 46 | auto in0 = inputs.GetValue( 0 ); 47 | REQUIRE( in0 ); 48 | auto in1 = inputs.GetValue( 1 ); 49 | REQUIRE( in1 ); 50 | auto in2 = inputs.GetValue( 2 ); 51 | REQUIRE( in2 ); 52 | auto in3 = inputs.GetValue( 3 ); 53 | REQUIRE( in3 ); 54 | auto in4 = inputs.GetValue( 4 ); 55 | REQUIRE( in4 ); 56 | 57 | REQUIRE( *in0 == _count + 1 ); 58 | REQUIRE( *in1 == _count + 2 ); 59 | REQUIRE( *in2 == _count + 3 ); 60 | REQUIRE( *in3 == _count + 4 ); 61 | REQUIRE( *in4 == _count + 5 ); 62 | 63 | ++_count; 64 | } 65 | 66 | private: 67 | int _count; 68 | }; 69 | 70 | } // namespace DSPatch 71 | -------------------------------------------------------------------------------- /tests/components/PassThrough.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | DSPatch - The Refreshingly Simple C++ Dataflow Framework 3 | Copyright (c) 2025, Marcus Tomlinson 4 | 5 | BSD 2-Clause License 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ******************************************************************************/ 28 | 29 | #pragma once 30 | 31 | namespace DSPatch 32 | { 33 | 34 | class PassThrough final : public Component 35 | { 36 | public: 37 | PassThrough() 38 | : Component( ProcessOrder::OutOfOrder ) 39 | { 40 | SetInputCount_( 1 ); 41 | SetOutputCount_( 1 ); 42 | } 43 | 44 | protected: 45 | void Process_( SignalBus& inputs, SignalBus& outputs ) override 46 | { 47 | outputs.MoveSignal( 0, *inputs.GetSignal( 0 ) ); // pass the signal through (no copy) 48 | } 49 | }; 50 | 51 | } // namespace DSPatch 52 | -------------------------------------------------------------------------------- /tests/components/SerialProbe.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | DSPatch - The Refreshingly Simple C++ Dataflow Framework 3 | Copyright (c) 2025, Marcus Tomlinson 4 | 5 | BSD 2-Clause License 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ******************************************************************************/ 28 | 29 | #pragma once 30 | 31 | namespace DSPatch 32 | { 33 | 34 | class SerialProbe final : public Component 35 | { 36 | public: 37 | SerialProbe() 38 | : _count( 0 ) 39 | { 40 | SetInputCount_( 1 ); 41 | } 42 | 43 | protected: 44 | void Process_( SignalBus& inputs, SignalBus& ) override 45 | { 46 | auto in = inputs.GetValue( 0 ); 47 | REQUIRE( in ); 48 | 49 | REQUIRE( *in == _count + 1 + 2 + 3 + 4 + 5 ); 50 | 51 | ++_count; 52 | } 53 | 54 | private: 55 | int _count; 56 | }; 57 | 58 | } // namespace DSPatch 59 | -------------------------------------------------------------------------------- /tests/components/SlowCounter.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | DSPatch - The Refreshingly Simple C++ Dataflow Framework 3 | Copyright (c) 2025, Marcus Tomlinson 4 | 5 | BSD 2-Clause License 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ******************************************************************************/ 28 | 29 | #pragma once 30 | 31 | #include 32 | 33 | namespace DSPatch 34 | { 35 | 36 | class SlowCounter final : public Component 37 | { 38 | public: 39 | SlowCounter() 40 | : _count( 0 ) 41 | { 42 | SetOutputCount_( 1 ); 43 | } 44 | 45 | void ResetCount() 46 | { 47 | _count = 0; 48 | } 49 | 50 | void Process_( SignalBus&, SignalBus& outputs ) override 51 | { 52 | _start = std::chrono::high_resolution_clock::now(); 53 | 54 | outputs.SetValue( 0, _count++ ); 55 | 56 | if ( _waitMs <= 0 ) 57 | { 58 | _waitMs += 1000.0; 59 | } 60 | else 61 | { 62 | do 63 | { 64 | std::this_thread::yield(); 65 | _elapsedMs = std::chrono::high_resolution_clock::now() - _start; 66 | } while ( _elapsedMs.count() < _waitMs ); 67 | 68 | _waitMs = 1000.0 - ( _elapsedMs.count() - _waitMs ); 69 | } 70 | } 71 | 72 | private: 73 | std::chrono::high_resolution_clock::time_point _start; 74 | std::chrono::duration _elapsedMs; 75 | int _count; 76 | double _waitMs = 1000.0; 77 | }; 78 | 79 | } // namespace DSPatch 80 | -------------------------------------------------------------------------------- /tests/components/SporadicCounter.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | DSPatch - The Refreshingly Simple C++ Dataflow Framework 3 | Copyright (c) 2025, Marcus Tomlinson 4 | 5 | BSD 2-Clause License 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ******************************************************************************/ 28 | 29 | #pragma once 30 | 31 | namespace DSPatch 32 | { 33 | 34 | class SporadicCounter final : public Component 35 | { 36 | public: 37 | explicit SporadicCounter( int increment = 1 ) 38 | : _count( 0 ) 39 | , _increment( increment ) 40 | { 41 | srand( (unsigned int)time( nullptr ) ); 42 | 43 | SetOutputCount_( 1 ); 44 | } 45 | 46 | protected: 47 | void Process_( SignalBus&, SignalBus& outputs ) override 48 | { 49 | if ( rand() % 2 == 1 ) 50 | { 51 | outputs.SetValue( 0, _count ); 52 | _count += _increment; 53 | } 54 | else 55 | { 56 | outputs.ClearValue( 0 ); 57 | } 58 | } 59 | 60 | private: 61 | int _count; 62 | const int _increment; 63 | }; 64 | 65 | } // namespace DSPatch 66 | -------------------------------------------------------------------------------- /tests/components/ThreadingProbe.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | DSPatch - The Refreshingly Simple C++ Dataflow Framework 3 | Copyright (c) 2025, Marcus Tomlinson 4 | 5 | BSD 2-Clause License 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ******************************************************************************/ 28 | 29 | #pragma once 30 | 31 | namespace DSPatch 32 | { 33 | 34 | class ThreadingProbe final : public Component 35 | { 36 | public: 37 | explicit ThreadingProbe( int inputCount = 4 ) 38 | : _inputCount( inputCount ) 39 | , _count( 0 ) 40 | { 41 | SetInputCount_( _inputCount ); 42 | } 43 | 44 | protected: 45 | void Process_( SignalBus& inputs, SignalBus& ) override 46 | { 47 | for ( int i = 0; i < _inputCount; ++i ) 48 | { 49 | REQUIRE( *inputs.GetValue( i ) == _count ); 50 | } 51 | 52 | ++_count; 53 | } 54 | 55 | private: 56 | const int _inputCount; 57 | int _count; 58 | }; 59 | 60 | } // namespace DSPatch -------------------------------------------------------------------------------- /tests/meson.build: -------------------------------------------------------------------------------- 1 | # Configure tests 2 | 3 | dspatch_tests_src = [ 4 | 'main.cpp' 5 | ] 6 | 7 | dspatch_tests_inc = include_directories('.') 8 | 9 | dspatch_tests = executable( 10 | 'Tests', 11 | format_first, 12 | dspatch_tests_src, 13 | include_directories: dspatch_tests_inc, 14 | dependencies: dspatch_dep 15 | ) 16 | 17 | # Add code coverage 18 | 19 | if opencppcoverage.found() 20 | test('Tests', opencppcoverage, 21 | args: [ 22 | opencppcoverage_args, 23 | '--export_type', 'binary:Tests.cov', 24 | dspatch_tests 25 | ], timeout: 120 26 | ) 27 | else 28 | test('Tests', dspatch_tests, timeout: 120) 29 | endif 30 | -------------------------------------------------------------------------------- /tutorial/components.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | DSPatch - The Refreshingly Simple C++ Dataflow Framework 3 | Copyright (c) 2025, Marcus Tomlinson 4 | 5 | BSD 2-Clause License 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ******************************************************************************/ 28 | 29 | #pragma once 30 | 31 | #include 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | // AndBool: 38 | // AndBool has 2 inputs and 1 output. 39 | // This component performs a logic AND on 2 boolean input values and outputs the result. 40 | 41 | // 1. Derive AndBool class from Component 42 | // ====================================== 43 | class AndBool final : public DSPatch::Component 44 | { 45 | public: 46 | // 2. Configure component IO buses 47 | // =============================== 48 | AndBool() 49 | // the order in which buffers are Process_()'ed is not important 50 | : Component( ProcessOrder::OutOfOrder ) 51 | { 52 | // add 2 inputs 53 | SetInputCount_( 2 ); 54 | 55 | // add 1 output 56 | SetOutputCount_( 1 ); 57 | } 58 | 59 | protected: 60 | // 3. Implement virtual Process_() method 61 | // ====================================== 62 | void Process_( DSPatch::SignalBus& inputs, DSPatch::SignalBus& outputs ) override 63 | { 64 | // create some local pointers to hold our input values 65 | auto bool1 = inputs.GetValue( 0 ); 66 | auto bool2 = inputs.GetValue( 1 ); 67 | 68 | // check first that our component has received valid inputs 69 | if ( bool1 && bool2 ) 70 | { 71 | // set the output as the result of bool1 AND bool2 72 | outputs.SetValue( 0, *bool1 && *bool2 ); 73 | } 74 | } 75 | }; 76 | 77 | // GenBool: 78 | // GenBool has 1 output. 79 | // This component generates a random boolean value then outputs the result. 80 | 81 | class GenBool final : public DSPatch::Component 82 | { 83 | public: 84 | GenBool() 85 | // the order in which buffers are Process_()'ed is not important 86 | : Component( ProcessOrder::OutOfOrder ) 87 | { 88 | // add 1 output 89 | SetOutputCount_( 1 ); 90 | 91 | // seed randomizer 92 | srand( static_cast( time( nullptr ) ) ); 93 | } 94 | 95 | protected: 96 | void Process_( DSPatch::SignalBus&, DSPatch::SignalBus& outputs ) override 97 | { 98 | // set output as randomized true / false 99 | outputs.SetValue( 0, rand() % 2 == 0 ); 100 | } 101 | }; 102 | 103 | // PrintBool: 104 | // PrintBool has 1 input. 105 | // This component receives a boolean value and outputs it to the console. 106 | 107 | class PrintBool final : public DSPatch::Component 108 | { 109 | public: 110 | PrintBool() 111 | // here, the order in which buffers are Process_()'ed is important 112 | : Component( ProcessOrder::InOrder ) 113 | { 114 | // add 1 input 115 | SetInputCount_( 1 ); 116 | } 117 | 118 | protected: 119 | void Process_( DSPatch::SignalBus& inputs, DSPatch::SignalBus& ) override 120 | { 121 | // create a local stack variable to hold input value 122 | auto inputBool = inputs.GetValue( 0 ); 123 | 124 | // get boolean value from inputs bus 125 | if ( inputBool ) 126 | { 127 | // print "true" / "false" depending on boolean value received 128 | if ( *inputBool ) 129 | { 130 | std::cout << "true" << '\n'; 131 | } 132 | else 133 | { 134 | std::cout << "false" << '\n'; 135 | } 136 | } 137 | } 138 | }; 139 | -------------------------------------------------------------------------------- /tutorial/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | DSPatch - The Refreshingly Simple C++ Dataflow Framework 3 | Copyright (c) 2025, Marcus Tomlinson 4 | 5 | BSD 2-Clause License 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ******************************************************************************/ 28 | 29 | #include "components.h" 30 | 31 | #include 32 | 33 | // The code below results in the following wiring configuration: 34 | // __________ _________ 35 | // | | | | 36 | // | genBool1 |-0 ===> 0-| | ___________ 37 | // |__________| | | | | 38 | // __________ | andBool |-0 ===> 0-| printBool | 39 | // | | | | |___________| 40 | // | genBool2 |-0 ===> 1-| | 41 | // |__________| |_________| 42 | 43 | int main() 44 | { 45 | // 1. Create a circuit where we can route our components 46 | // ===================================================== 47 | auto circuit = std::make_shared(); 48 | 49 | // 2. Create instances of the components needed for our circuit 50 | // ============================================================ 51 | auto genBool1 = std::make_shared(); 52 | auto genBool2 = std::make_shared(); 53 | auto andBool = std::make_shared(); 54 | auto printBool = std::make_shared(); 55 | 56 | // 3. Add component instances to circuit 57 | // ===================================== 58 | circuit->AddComponent( genBool1 ); 59 | circuit->AddComponent( genBool2 ); 60 | circuit->AddComponent( andBool ); 61 | circuit->AddComponent( printBool ); 62 | 63 | // 4. Wire up the components inside the circuit 64 | // ============================================ 65 | circuit->ConnectOutToIn( genBool1, 0, andBool, 0 ); 66 | circuit->ConnectOutToIn( genBool2, 0, andBool, 1 ); 67 | circuit->ConnectOutToIn( andBool, 0, printBool, 0 ); 68 | 69 | // 5. Tick the circuit 70 | // =================== 71 | 72 | // Circuit tick method 1: Manual 73 | for ( int i = 0; i < 10; ++i ) 74 | { 75 | circuit->Tick(); 76 | } 77 | 78 | // Circuit tick method 2: Automatic 79 | std::cout << "Press any key to begin circuit auto-tick."; 80 | getchar(); 81 | circuit->StartAutoTick(); 82 | 83 | // Increase circuit buffer count for higher performance 84 | getchar(); 85 | circuit->SetBufferCount( 4 ); 86 | 87 | // Press any key to quit 88 | getchar(); 89 | return 0; 90 | } 91 | -------------------------------------------------------------------------------- /tutorial/meson.build: -------------------------------------------------------------------------------- 1 | dspatch_tutorial_src = [ 2 | 'main.cpp' 3 | ] 4 | 5 | dspatch_tutorial_inc = include_directories('.') 6 | 7 | dspatch_tutorial = executable( 8 | 'Tutorial', 9 | format_first, 10 | dspatch_tutorial_src, 11 | include_directories: dspatch_tutorial_inc, 12 | dependencies: dspatch_dep 13 | ) 14 | --------------------------------------------------------------------------------