Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F65448661
double_buffer.hh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jun 3, 21:21
Size
604 B
Mime Type
text/x-c++
Expires
Wed, Jun 5, 21:21 (2 d)
Engine
blob
Format
Raw Data
Handle
18073648
Attached To
R7871 phys-743-exercises
double_buffer.hh
View Options
#ifndef DOUBLE_BUFFER
#define DOUBLE_BUFFER
/* -------------------------------------------------------------------------- */
#include <memory>
/* -------------------------------------------------------------------------- */
#include "grid.hh"
/* -------------------------------------------------------------------------- */
class
DoubleBuffer
{
public
:
DoubleBuffer
(
int
m
=
0
,
int
n
=
0
);
Grid
&
current
();
Grid
&
old
();
// resize the grid
void
resize
(
int
m
,
int
n
);
void
swap
();
private
:
std
::
unique_ptr
<
Grid
>
m_current
;
std
::
unique_ptr
<
Grid
>
m_old
;
};
#endif
/* DOUBLE_BUFFER */
Event Timeline
Log In to Comment