From acdba1d0ba0de53df326956352ff09bea2b80c6a Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 9 Sep 2018 12:08:26 +0200 Subject: Split into compilation units --- src/data_cell_buffer.h | 82 +++++++++++++++++++++++++------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) (limited to 'src/data_cell_buffer.h') diff --git a/src/data_cell_buffer.h b/src/data_cell_buffer.h index 06c2644..033fb24 100644 --- a/src/data_cell_buffer.h +++ b/src/data_cell_buffer.h @@ -5,46 +5,46 @@ #include "data_cell.h" class DataCellBuffer { - private: - const std::size_t dim_x_; - const std::size_t dim_y_; - - std::unique_ptr curr_; - std::unique_ptr prev_; - - public: - DataCellBuffer(std::size_t dimX, std::size_t dimY): - dim_x_(dimX), - dim_y_(dimY), - curr_(new DataCell[dimX*dimY]), - prev_(new DataCell[dimX*dimY]) { } - - std::size_t dimX() const { - return dim_x_; - } - - std::size_t dimY() const { - return dim_y_; - } - - void swap() { - curr_.swap(prev_); - } - - inline DataCell& curr(std::size_t x, std::size_t y) { - return curr_[y*dim_x_ + x]; - } - - inline DataCell& curr(Vector pos) { - return curr(pos[0], pos[1]); - } - - inline DataCell& prev(std::size_t x, std::size_t y) { - return prev_[y*dim_x_ + x]; - } - - inline DataCell& prev(Vector pos) { - return prev(pos[0], pos[1]); - } +private: + const std::size_t dim_x_; + const std::size_t dim_y_; + + std::unique_ptr curr_; + std::unique_ptr prev_; + +public: + DataCellBuffer(std::size_t dimX, std::size_t dimY): + dim_x_(dimX), + dim_y_(dimY), + curr_(new DataCell[dimX*dimY]), + prev_(new DataCell[dimX*dimY]) { } + + std::size_t dimX() const { + return dim_x_; + } + + std::size_t dimY() const { + return dim_y_; + } + + void swap() { + curr_.swap(prev_); + } + + inline DataCell& curr(std::size_t x, std::size_t y) { + return curr_[y*dim_x_ + x]; + } + + inline DataCell& curr(Vector pos) { + return curr(pos[0], pos[1]); + } + + inline DataCell& prev(std::size_t x, std::size_t y) { + return prev_[y*dim_x_ + x]; + } + + inline DataCell& prev(Vector pos) { + return prev(pos[0], pos[1]); + } }; -- cgit v1.2.3