MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ validate_token()

void MayaFlux::Buffers::validate_token ( ProcessingToken  token)
inline

Validates that a processing token has a valid, non-conflicting configuration.

Parameters
tokenProcessing token to validate
Exceptions
std::invalid_argumentif the token contains mutually exclusive flags

This function ensures that processing tokens contain only compatible flag combinations. It validates three key mutual exclusions that are fundamental to the processing model:

Rate Mutual Exclusion: SAMPLE_RATE and FRAME_RATE cannot be combined as they represent fundamentally different temporal processing models that cannot be executed simultaneously within the same processing context.

Device Mutual Exclusion: CPU_PROCESS and GPU_PROCESS cannot be combined as they represent different execution environments that require different resource allocation and execution strategies.

Concurrency Mutual Exclusion: SEQUENTIAL and PARALLEL cannot be combined as they represent incompatible execution patterns that would create undefined behavior in processing chains.

This validation is essential for maintaining system stability and ensuring that processing tokens represent achievable execution configurations.

Definition at line 94 of file BufferUtils.hpp.

95{
96 if ((token & SAMPLE_RATE) && (token & FRAME_RATE)) {
97 throw std::invalid_argument("SAMPLE_RATE and FRAME_RATE are mutually exclusive.");
98 }
99
100 if ((token & CPU_PROCESS) && (token & GPU_PPOCESS)) {
101 throw std::invalid_argument("CPU_PROCESS and GPU_PROCESS are mutually exclusive.");
102 }
103
104 if ((token & SEQUENTIAL) && (token & PARALLEL)) {
105 throw std::invalid_argument("SEQUENTIAL and PARALLEL are mutually exclusive.");
106 }
107}
static MayaFlux::Nodes::ProcessingToken token
Definition Timers.cpp:8

References CPU_PROCESS, FRAME_RATE, GPU_PPOCESS, PARALLEL, SAMPLE_RATE, SEQUENTIAL, and token.

Referenced by MayaFlux::is_domain_valid(), and MayaFlux::Buffers::BufferProcessor::set_processing_token().

+ Here is the caller graph for this function: