Page MenuHomec4science

double_buffer.cpp
No OneTemporary

File Metadata

Created
Thu, Nov 7, 22:07

double_buffer.cpp

//
// Created by Arnaud Pannatier on 06.05.18.
//
#include "double_buffer.h"
#include "grid.h"
DoubleBuffer::DoubleBuffer(std::size_t m, std::size_t n)
: m_current(new Grid(m, n)), m_old(new Grid(m, n)) {}
Grid & DoubleBuffer::current() { return *m_current; }
Grid & DoubleBuffer::old() { return *m_old; }
void DoubleBuffer::swap() {
m_current.swap(m_old);
}

Event Timeline