diff --git a/CHANGES b/CHANGES index 5bb4578b..4262d681 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +v.10.1.0 (31 December 2023) + - Greatly improved circuit performace with component auto-ordering. + - Added Circuit::Optimize() to manually order components pre-tick. + v.10.0.2 (29 December 2023) - Optimized Tick() by avoiding unnecessary wire copying. - Declared all non-abstract classes "final". diff --git a/CMakeLists.txt b/CMakeLists.txt index b359aeee..150afbf1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,8 +8,8 @@ set(CMAKE_CXX_EXTENSIONS OFF) # Set version information. set(DSPATCH_MAJOR 10) -set(DSPATCH_MINOR 0) -set(DSPATCH_MICRO 2) +set(DSPATCH_MINOR 1) +set(DSPATCH_MICRO 0) if(MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W4") diff --git a/docs/Doxyfile b/docs/Doxyfile index c34e2b6a..fa8a830e 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -32,7 +32,7 @@ PROJECT_NAME = DSPatch # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = v.10.0.2 +PROJECT_NUMBER = v.10.1.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer diff --git a/docs/html/_auto_tick_thread_8h_source.html b/docs/html/_auto_tick_thread_8h_source.html index 0b40efae..8de16e0a 100644 --- a/docs/html/_auto_tick_thread_8h_source.html +++ b/docs/html/_auto_tick_thread_8h_source.html @@ -22,7 +22,7 @@ Logo -
DSPatch v.10.0.2 +
DSPatch v.10.1.0
diff --git a/docs/html/_circuit_8h_source.html b/docs/html/_circuit_8h_source.html index e4ddc954..5e24c231 100644 --- a/docs/html/_circuit_8h_source.html +++ b/docs/html/_circuit_8h_source.html @@ -22,7 +22,7 @@ Logo -
DSPatch v.10.0.2 +
DSPatch v.10.1.0
diff --git a/docs/html/_circuit_thread_8h_source.html b/docs/html/_circuit_thread_8h_source.html index 9281a87d..ade045db 100644 --- a/docs/html/_circuit_thread_8h_source.html +++ b/docs/html/_circuit_thread_8h_source.html @@ -22,7 +22,7 @@ Logo -
DSPatch v.10.0.2 +
DSPatch v.10.1.0
@@ -262,29 +262,25 @@
202 {
203 component->Tick( _threadNo );
204 }
-
205 for ( auto component : *_components )
-
206 {
-
207 component->Reset( _threadNo );
-
208 }
-
209 }
-
210 }
-
211 }
-
212
-
213 _stopped = true;
-
214 }
-
215
-
216 std::thread _thread;
-
217 std::vector<DSPatch::Component*>* _components = nullptr;
-
218 int _threadNo = 0;
-
219 bool _stop = false;
-
220 bool _stopped = true;
-
221 bool _gotSync = true;
-
222 std::mutex _syncMutex;
-
223 std::condition_variable _resumeCondt, _syncCondt;
-
224};
-
225
-
226} // namespace internal
-
227} // namespace DSPatch
+
205 }
+
206 }
+
207 }
+
208
+
209 _stopped = true;
+
210 }
+
211
+
212 std::thread _thread;
+
213 std::vector<DSPatch::Component*>* _components = nullptr;
+
214 int _threadNo = 0;
+
215 bool _stop = false;
+
216 bool _stopped = true;
+
217 bool _gotSync = true;
+
218 std::mutex _syncMutex;
+
219 std::condition_variable _resumeCondt, _syncCondt;
+
220};
+
221
+
222} // namespace internal
+
223} // namespace DSPatch
Thread class for asynchronously ticking circuit components.
diff --git a/docs/html/_common_8h_source.html b/docs/html/_common_8h_source.html index 792d26fa..a1629131 100644 --- a/docs/html/_common_8h_source.html +++ b/docs/html/_common_8h_source.html @@ -22,7 +22,7 @@ Logo -
DSPatch v.10.0.2 +
DSPatch v.10.1.0
diff --git a/docs/html/_component_8h_source.html b/docs/html/_component_8h_source.html index 2cdfa9b9..3d2a07c4 100644 --- a/docs/html/_component_8h_source.html +++ b/docs/html/_component_8h_source.html @@ -22,7 +22,7 @@ Logo -
DSPatch v.10.0.2 +
DSPatch v.10.1.0
@@ -117,56 +117,61 @@
38
39namespace internal
40{
-
41class Component;
-
42} // namespace internal
-
43
-
45
-
72class DLLEXPORT Component
-
73{
-
74public:
-
75 NONCOPYABLE( Component );
-
76
-
77 using SPtr = std::shared_ptr<Component>;
-
78
-
79 enum class ProcessOrder
-
80 {
-
81 InOrder,
-
82 OutOfOrder
-
83 };
+
41class Circuit;
+
42class Component;
+
43} // namespace internal
+
44
+
46
+
69class DLLEXPORT Component
+
70{
+
71public:
+
72 NONCOPYABLE( Component );
+
73
+
74 using SPtr = std::shared_ptr<Component>;
+
75
+
76 enum class ProcessOrder
+
77 {
+
78 InOrder,
+
79 OutOfOrder
+
80 };
+
81
+
82 Component( ProcessOrder processOrder = ProcessOrder::InOrder );
+
83 virtual ~Component();
84
-
85 Component( ProcessOrder processOrder = ProcessOrder::InOrder );
-
86 virtual ~Component();
-
87
-
88 bool ConnectInput( const Component::SPtr& fromComponent, int fromOutput, int toInput );
-
89
-
90 void DisconnectInput( int inputNo );
-
91 void DisconnectInput( const Component::SPtr& fromComponent );
-
92 void DisconnectAllInputs();
+
85 bool ConnectInput( const Component::SPtr& fromComponent, int fromOutput, int toInput );
+
86
+
87 void DisconnectInput( int inputNo );
+
88 void DisconnectInput( const Component::SPtr& fromComponent );
+
89 void DisconnectAllInputs();
+
90
+
91 int GetInputCount() const;
+
92 int GetOutputCount() const;
93
-
94 int GetInputCount() const;
-
95 int GetOutputCount() const;
+
94 std::string GetInputName( int inputNo ) const;
+
95 std::string GetOutputName( int outputNo ) const;
96
-
97 std::string GetInputName( int inputNo ) const;
-
98 std::string GetOutputName( int outputNo ) const;
+
97 void SetBufferCount( int bufferCount, int startBuffer = 0 );
+
98 int GetBufferCount() const;
99
-
100 void SetBufferCount( int bufferCount, int startBuffer = 0 );
-
101 int GetBufferCount() const;
-
102
-
103 void Tick( int bufferNo = 0 );
-
104 void Reset( int bufferNo = 0 );
-
105
-
106protected:
-
107 virtual void Process_( SignalBus&, SignalBus& ) = 0;
-
108
-
109 void SetInputCount_( int inputCount, const std::vector<std::string>& inputNames = {} );
-
110 void SetOutputCount_( int outputCount, const std::vector<std::string>& outputNames = {} );
-
111
-
112private:
-
113 internal::Component* p;
-
114};
-
115
-
116} // namespace DSPatch
-
Abstract base class for DSPatch components.
Definition Component.h:73
+
100 void Tick( int bufferNo = 0 );
+
101
+
102protected:
+
103 virtual void Process_( SignalBus&, SignalBus& ) = 0;
+
104
+
105 void SetInputCount_( int inputCount, const std::vector<std::string>& inputNames = {} );
+
106 void SetOutputCount_( int outputCount, const std::vector<std::string>& outputNames = {} );
+
107
+
108private:
+
109 friend class internal::Circuit;
+
110
+
111 void _Scan( std::vector<DSPatch::Component*>& components );
+
112 void _EndScan();
+
113
+
114 internal::Component* p;
+
115};
+
116
+
117} // namespace DSPatch
+
Abstract base class for DSPatch components.
Definition Component.h:70
Signal container.
Definition SignalBus.h:57
diff --git a/docs/html/_d_s_patch_8h_source.html b/docs/html/_d_s_patch_8h_source.html index 65902b89..aa3f48a2 100644 --- a/docs/html/_d_s_patch_8h_source.html +++ b/docs/html/_d_s_patch_8h_source.html @@ -22,7 +22,7 @@ Logo -
DSPatch v.10.0.2 +
DSPatch v.10.1.0
diff --git a/docs/html/_plugin_8h_source.html b/docs/html/_plugin_8h_source.html index 14226b97..535c7be8 100644 --- a/docs/html/_plugin_8h_source.html +++ b/docs/html/_plugin_8h_source.html @@ -22,7 +22,7 @@ Logo -
DSPatch v.10.0.2 +
DSPatch v.10.1.0
diff --git a/docs/html/_signal_bus_8h_source.html b/docs/html/_signal_bus_8h_source.html index 6ec401f8..2c286791 100644 --- a/docs/html/_signal_bus_8h_source.html +++ b/docs/html/_signal_bus_8h_source.html @@ -22,7 +22,7 @@ Logo -
DSPatch v.10.0.2 +
DSPatch v.10.1.0
diff --git a/docs/html/_wire_8h_source.html b/docs/html/_wire_8h_source.html index b3e20c8e..7ceb6511 100644 --- a/docs/html/_wire_8h_source.html +++ b/docs/html/_wire_8h_source.html @@ -22,7 +22,7 @@ Logo -
DSPatch v.10.0.2 +
DSPatch v.10.1.0
@@ -122,7 +122,7 @@
51
52} // namespace internal
53} // namespace DSPatch
-
Abstract base class for DSPatch components.
Definition Component.h:73
+
Abstract base class for DSPatch components.
Definition Component.h:70
Connection between two components.
Definition Wire.h:46
diff --git a/docs/html/annotated.html b/docs/html/annotated.html index 4dde952e..2eec960c 100644 --- a/docs/html/annotated.html +++ b/docs/html/annotated.html @@ -22,7 +22,7 @@ Logo -
DSPatch v.10.0.2 +
DSPatch v.10.1.0
diff --git a/docs/html/class_d_s_patch_1_1_circuit-members.html b/docs/html/class_d_s_patch_1_1_circuit-members.html index 2abbb72f..bf974fcc 100644 --- a/docs/html/class_d_s_patch_1_1_circuit-members.html +++ b/docs/html/class_d_s_patch_1_1_circuit-members.html @@ -22,7 +22,7 @@ Logo -
DSPatch v.10.0.2 +
DSPatch v.10.1.0
diff --git a/docs/html/class_d_s_patch_1_1_circuit.html b/docs/html/class_d_s_patch_1_1_circuit.html index e369d570..6a834484 100644 --- a/docs/html/class_d_s_patch_1_1_circuit.html +++ b/docs/html/class_d_s_patch_1_1_circuit.html @@ -22,7 +22,7 @@ Logo -
DSPatch v.10.0.2 +
DSPatch v.10.1.0
@@ -142,7 +142,7 @@

Components can be added to a Circuit via the AddComponent() method, and routed to and from other components via the ConnectOutToIn() method.

NOTE: Each component input can only accept a single "wire" at a time. When a wire is connected to an input that already has a connected wire, that wire is replaced with the new one. One output, on the other hand, can be distributed to multiple inputs.

To boost performance in stream processing circuits, multi-buffering can be enabled via the SetBufferCount() method. A circuit's buffer count can be adjusted at runtime.

-

The Circuit Tick() method runs through its internal array of components and calls each component's Tick() and Reset() methods once. A circuit's Tick() method can be called in a loop from the main application thread, or alternatively, by calling StartAutoTick(), a separate thread will spawn, automatically calling Tick() continuously until PauseAutoTick() or StopAutoTick() is called.

+

The Circuit Tick() method runs through its internal array of components and calls each component's Tick() method. A circuit's Tick() method can be called in a loop from the main application thread, or alternatively, by calling StartAutoTick(), a separate thread will spawn, automatically calling Tick() continuously until PauseAutoTick() or StopAutoTick() is called.

Definition at line 60 of file Circuit.h.


The documentation for this class was generated from the following file:
    diff --git a/docs/html/class_d_s_patch_1_1_component-members.html b/docs/html/class_d_s_patch_1_1_component-members.html index a4cb4822..b52b73b3 100644 --- a/docs/html/class_d_s_patch_1_1_component-members.html +++ b/docs/html/class_d_s_patch_1_1_component-members.html @@ -22,7 +22,7 @@ Logo -
    DSPatch v.10.0.2 +
    DSPatch v.10.1.0
    @@ -93,13 +93,12 @@ NONCOPYABLE(Component) (defined in DSPatch::Component)DSPatch::Component Process_(SignalBus &, SignalBus &)=0 (defined in DSPatch::Component)DSPatch::Componentprotectedpure virtual ProcessOrder enum name (defined in DSPatch::Component)DSPatch::Component - Reset(int bufferNo=0) (defined in DSPatch::Component)DSPatch::Component - SetBufferCount(int bufferCount, int startBuffer=0) (defined in DSPatch::Component)DSPatch::Component - SetInputCount_(int inputCount, const std::vector< std::string > &inputNames={}) (defined in DSPatch::Component)DSPatch::Componentprotected - SetOutputCount_(int outputCount, const std::vector< std::string > &outputNames={}) (defined in DSPatch::Component)DSPatch::Componentprotected - SPtr typedef (defined in DSPatch::Component)DSPatch::Component - Tick(int bufferNo=0) (defined in DSPatch::Component)DSPatch::Component - ~Component() (defined in DSPatch::Component)DSPatch::Componentvirtual + SetBufferCount(int bufferCount, int startBuffer=0) (defined in DSPatch::Component)DSPatch::Component + SetInputCount_(int inputCount, const std::vector< std::string > &inputNames={}) (defined in DSPatch::Component)DSPatch::Componentprotected + SetOutputCount_(int outputCount, const std::vector< std::string > &outputNames={}) (defined in DSPatch::Component)DSPatch::Componentprotected + SPtr typedef (defined in DSPatch::Component)DSPatch::Component + Tick(int bufferNo=0) (defined in DSPatch::Component)DSPatch::Component + ~Component() (defined in DSPatch::Component)DSPatch::Componentvirtual