Page MenuHomec4science

double_buffer.cc
No OneTemporary

File Metadata

Created
Sat, Nov 9, 03:19

double_buffer.cc

/* -------------------------------------------------------------------------- */
#include "double_buffer.hh"
#include "grid.hh"
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
DoubleBuffer::DoubleBuffer(int m, int 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