#include <audio/core/process.h>
Public Types | |
enum | Mode { Sequential, Parallel } |
Public Member Functions | |
ParentProcess (NodeManager &nodeManager, ThreadPool &threadPool, AsyncObserver &observer) | |
ParentProcess (ParentProcess &parent) | |
void | addChild (Process &child) |
void | removeChild (Process &child) |
void | processParallel () |
void | processSequential () |
void | process () override |
void | setMode (Mode mode) |
Mode | getMode () const |
![]() | |
Process (NodeManager &nodeManager) | |
Process (ParentProcess &parent) | |
Process (const Process &)=delete | |
Process & | operator= (const Process &)=delete |
virtual | ~Process () |
void | update () |
NodeManager & | getNodeManager () const |
int | getBufferSize () const |
float | getSampleRate () const |
DiscreteTimeValue | getSampleTime () const |
Additional Inherited Members | |
![]() | |
virtual void | sampleRateChanged (float sampleRate) |
virtual void | bufferSizeChanged (int bufferSize) |
bool | isRegisteredWithNodeManager () const |
Parent process that triggers the processing of a number of child processes that it refers to. The ParentProcess can be either in sequential or parallel mode. In case it is set to parallel mode all child processes are started simultaneously on different threads. In sequential case all child processes are processed one after the other on the calling thread.
|
strong |
ParentProcess | ( | NodeManager & | nodeManager, |
ThreadPool & | threadPool, | ||
AsyncObserver & | observer | ||
) |
Constructor
nodeManager | the node manager the process runs on |
threadPool | the threadpool used for parallelization when the ParentProcess is set to parallel mode. |
observer | AsyncObserver object used to help the child processes signal the caller when they are done in the case of parallel processing mode. |
ParentProcess | ( | ParentProcess & | parent | ) |
Constructor that takes the parent process of this process as argument in order to use its ThreadPool, AsyncObserver end NodeManager.
void addChild | ( | Process & | child | ) |
Add a reference to a child process whose processing will be triggered by this parent process.
Mode getMode | ( | ) | const |
|
overridevirtual |
void processParallel | ( | ) |
Directly triggers parallel processing of all child processes. Child processes will be processed simultaneously on different threads in the ThreadPool.
void processSequential | ( | ) |
Directly triggers sequential (or serial) processing of all child processes.
void removeChild | ( | Process & | child | ) |
Removes the reference of a child process so it will no longer be processed by this parent process.
void setMode | ( | Mode | mode | ) |
Specifies wether the child processes will be processed in parallel or sequential mode. In case of parallel processing the child processes are triggered simultaneously on different threads in the ThreadPool. In case of sequential processing they are processed one by one on the caller thread.