Page MenuHomec4science

double_buffer.cpp
No OneTemporary

File Metadata

Created
Mon, Nov 11, 11:57

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);
}
void DoubleBuffer::resize (std::size_t nx, std::size_t ny) {
std::cout << "NX : " << nx << std::endl;
current().resize(nx,ny);
old().resize(nx,ny);
}

Event Timeline