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

◆ swap_field()

void MayaFlux::Buffers::VolumeGridBuffer::swap_field ( const std::string &  name)

Exchange read and write slots for the named field.

Parameters
nameField name. No effect on single-slot fields.

Called by whichever stage last wrote the field, after its dispatch, so the next stage reading it observes the new values. A stage that writes a field it also reads must swap; a stage writing a scratch field consumed immediately after need not.

Definition at line 443 of file VolumeGridBuffer.cpp.

444{
445 auto it = m_fields.find(name);
446 if (it == m_fields.end()) {
448 "VolumeGridBuffer::swap_field: no field named '{}'", name);
449 return;
450 }
451
452 if (it->second.slot_a == it->second.slot_b) {
453 return;
454 }
455
456 it->second.read_is_a = !it->second.read_is_a;
457}
#define MF_ERROR(comp, ctx,...)
std::unordered_map< std::string, Field > m_fields
@ BufferManagement
Buffer Management (Buffers::BufferManager, creating buffers)
@ Buffers
Buffers, Managers, processors and processing chains.

References MayaFlux::Journal::BufferManagement, MayaFlux::Journal::Buffers, m_fields, and MF_ERROR.