Class anira::v2::LegacyProcessor#
-
class LegacyProcessor : public anira::Processor#
Inheritance diagram for anira::v2::LegacyProcessor:
![digraph {
graph [bgcolor="#00000000"]
node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
edge [color="#1414CE"]
"2" [label="anira::Processor" tooltip="anira::Processor"]
"1" [label="anira::v2::LegacyProcessor" tooltip="anira::v2::LegacyProcessor" fillcolor="#BFBFBF"]
"1" -> "2" [dir=forward tooltip="public-inheritance"]
}](../../_images/graphviz-67e53a924293e11f6996396bc57176d3e70198aa.png)
Collaboration diagram for anira::v2::LegacyProcessor:
![digraph {
graph [bgcolor="#00000000"]
node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
edge [color="#1414CE"]
"2" [label="anira::Processor" tooltip="anira::Processor"]
"4" [label="anira::v2::InferenceConfig" tooltip="anira::v2::InferenceConfig"]
"1" [label="anira::v2::LegacyProcessor" tooltip="anira::v2::LegacyProcessor" fillcolor="#BFBFBF"]
"3" [label="anira::v2::PrePostProcessor" tooltip="anira::v2::PrePostProcessor"]
"5" [label="anira::v2::ProcessingSpec" tooltip="anira::v2::ProcessingSpec"]
"4" -> "5" [dir=forward tooltip="usage"]
"1" -> "2" [dir=forward tooltip="public-inheritance"]
"1" -> "3" [dir=forward tooltip="usage"]
"3" -> "4" [dir=forward tooltip="usage"]
}](../../_images/graphviz-e1120b35743e4db2f1d4d23d3110dd6633888d8f.png)
The anira::Processor that runs one 2.x PrePostProcessor: all four phases and reset, with the real-time promise of pre_process, post_process and reset (the 2.x processor ran pre_process and post_process on the audio thread already; the hooks promise nothing). What a 2.x host that moves to a 3.x Pipeline keeps its processor with:
pipeline.add_processor(std::make_shared<anira::v2::LegacyProcessor>(pp)). Per phase call it points the processor’s view vectors at the chunk’s rings and model tensors (per entry, so concurrent chunks never share them) and calls the virtual with the backend of the chunk’s plan (to_backend of ProcessorContext::engine()). The processor and its configuration outlive every handler that runs the processor.Public Functions
-
inline explicit LegacyProcessor(PrePostProcessor &processor) noexcept#
-
inline virtual uint32_t phases() const noexcept override#
The phases this processor fills: an OR of k_pre_process, k_post_process, k_before_inference, k_after_inference and k_reset (a Prepared that overrides reset names k_reset, else its reset is never called). Read once, when the processor is added to a Pipeline; 0 is a processor of prepare, unprepare and release alone.
-
inline virtual uint32_t realtime_phases() const noexcept override#
The processor’s real-time promise, per phase, written into anira_processor_desc::realtime_phases by Pipeline::add_processor: an OR of the k_* bits of phases() whose bodies allocate nothing, lock nothing and block on nothing; 0 (the default) promises nothing. Every filled phase the contract runs on the driving thread must carry its bit, else anira_handler_prepare refuses the processor with ANIRA_ERROR_CONFIG naming the phase: under a Hard contract k_pre_process, k_post_process and k_reset, so one of before_inference and after_inference alone needs no promise there. A promised phase that is not filled is no error; a processor whose bodies are all real-time returns phases(). Read once, when the processor is added to a Pipeline.
-
inline virtual std::unique_ptr<anira::Processor::Prepared> prepare(const anira::PrepareInfo &info) override#
The view vectors per entry, sized for the handler.
- Throws:
Error{ANIRA_ERROR_CONFIG} – when the processor’s configuration has another tensor count than the handler’s model.
-
class Prepared : public anira::Processor::Prepared#
Inheritance diagram for anira::v2::LegacyProcessor::Prepared:
![digraph {
graph [bgcolor="#00000000"]
node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
edge [color="#1414CE"]
"2" [label="anira::Processor::Prepared" tooltip="anira::Processor::Prepared"]
"1" [label="anira::v2::LegacyProcessor::Prepared" tooltip="anira::v2::LegacyProcessor::Prepared" fillcolor="#BFBFBF"]
"1" -> "2" [dir=forward tooltip="public-inheritance"]
}](../../_images/graphviz-ddb202ddd99ec1a47141327ffec9da8a10197b1f.png)
Collaboration diagram for anira::v2::LegacyProcessor::Prepared:
![digraph {
graph [bgcolor="#00000000"]
node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
edge [color="#1414CE"]
"2" [label="anira::Processor::Prepared" tooltip="anira::Processor::Prepared"]
"4" [label="anira::v2::InferenceConfig" tooltip="anira::v2::InferenceConfig"]
"1" [label="anira::v2::LegacyProcessor::Prepared" tooltip="anira::v2::LegacyProcessor::Prepared" fillcolor="#BFBFBF"]
"3" [label="anira::v2::PrePostProcessor" tooltip="anira::v2::PrePostProcessor"]
"5" [label="anira::v2::ProcessingSpec" tooltip="anira::v2::ProcessingSpec"]
"4" -> "5" [dir=forward tooltip="usage"]
"1" -> "2" [dir=forward tooltip="public-inheritance"]
"1" -> "3" [dir=forward tooltip="usage"]
"3" -> "4" [dir=forward tooltip="usage"]
}](../../_images/graphviz-232d4d7d3880dade65fe6a51fd7316306be97d08.png)
One handler’s views of the processor: per entry the four vectors the 2.x virtuals take, one element per slot of the side (State and Static positions included), re-pointed per call.
Public Functions
-
inline Prepared(PrePostProcessor &processor, std::vector<anira_role> input_roles, std::vector<anira_role> output_roles, uint32_t num_entries)#
-
inline virtual anira_status pre_process(anira::ProcessorContext &ctx) noexcept override#
ANIRA_PHASE_PRE_PROCESS, on the thread where the host end is produced (the driver thread under a Hard contract): takes the host end of every slot to its model tensor. The base class is the default fill (anira_processor_default_pre_process).
-
inline virtual anira_status post_process(anira::ProcessorContext &ctx) noexcept override#
ANIRA_PHASE_POST_PROCESS, on the thread where the host end is consumed: takes the model tensor of every output slot back to its host end. The base class is the default push (anira_processor_default_post_process).
-
inline virtual anira_status before_inference(anira::ProcessorContext &ctx) noexcept override#
ANIRA_PHASE_BEFORE_INFERENCE, on an inference thread behind the State feed and ahead of the edge into the backend’s domain. The base class does nothing.
-
inline virtual anira_status after_inference(anira::ProcessorContext &ctx) noexcept override#
ANIRA_PHASE_AFTER_INFERENCE, on an inference thread behind the edge out of the backend’s domain and ahead of the State capture. The base class does nothing.
-
inline Prepared(PrePostProcessor &processor, std::vector<anira_role> input_roles, std::vector<anira_role> output_roles, uint32_t num_entries)#
-
inline explicit LegacyProcessor(PrePostProcessor &processor) noexcept#