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

◆ validate_fields()

bool MayaFlux::Buffers::VolumeFieldProcessor::validate_fields ( )
private

Check every named field exists and that read-write fields carry two slots.

Returns
True if the cached volume satisfies the binding table.

Definition at line 67 of file VolumeFieldProcessor.cpp.

68{
69 for (const auto& entry : m_bindings) {
70 if (!m_volume->has_field(entry.field)) {
72 "VolumeFieldProcessor: volume has no field '{}' for binding '{}'",
73 entry.field, entry.name);
74 return false;
75 }
76 }
77
78 for (const auto& entry : m_bindings) {
79 if (entry.access != FieldAccess::WRITE) {
80 continue;
81 }
82
83 const bool also_read = std::ranges::any_of(m_bindings, [&](const FieldBinding& other) {
84 return other.access == FieldAccess::READ && other.field == entry.field;
85 });
86
87 if (!also_read) {
88 continue;
89 }
90
91 if (m_volume->read_handle(entry.field) == m_volume->write_handle(entry.field)) {
93 "VolumeFieldProcessor: field '{}' is bound for both read and write "
94 "but is not double-buffered",
95 entry.field);
96 return false;
97 }
98 }
99
100 return true;
101}
#define MF_ERROR(comp, ctx,...)
std::shared_ptr< VolumeGridBuffer > m_volume
The attached volume, null until on_attach validates it.
@ READ
Resolves to VolumeGridBuffer::read_handle.
@ WRITE
Resolves to VolumeGridBuffer::write_handle.
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.

References MayaFlux::Buffers::VolumeFieldProcessor::FieldBinding::access, MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, MayaFlux::Buffers::VolumeFieldProcessor::FieldBinding::field, m_bindings, m_volume, MF_ERROR, READ, and WRITE.

Referenced by on_attach().

+ Here is the caller graph for this function: