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

◆ validate_token()

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

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 60 of file BufferUtils.cpp.

61{
62 if ((token & SAMPLE_RATE) && (token & FRAME_RATE)) {
63 error<std::invalid_argument>(
64 Journal::Component::Buffers,
65 Journal::Context::BufferProcessing,
66 std::source_location::current(),
67 "SAMPLE_RATE and FRAME_RATE are mutually exclusive.");
68 }
69
70 if ((token & CPU_PROCESS) && (token & GPU_PPOCESS)) {
71 error<std::invalid_argument>(Journal::Component::Buffers,
72 Journal::Context::BufferProcessing,
73 std::source_location::current(),
74 "CPU_PROCESS and GPU_PROCESS are mutually exclusive.");
75 }
76
77 if ((token & SEQUENTIAL) && (token & PARALLEL)) {
78 error<std::invalid_argument>(Journal::Component::Buffers,
79 Journal::Context::BufferProcessing,
80 std::source_location::current(),
81 "SEQUENTIAL and PARALLEL are mutually exclusive.");
82 }
83}
static MayaFlux::Nodes::ProcessingToken token
Definition Timers.cpp:8

References MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, 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: