Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102605429
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
Sat, Feb 22, 11:01
Size
644 B
Mime Type
text/x-c++
Expires
Mon, Feb 24, 11:01 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24351028
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);
void resize(int m, int n);
Grid & current();
Grid & old();
const Grid & current() const;
const Grid & old() const;
void swap();
private:
std::unique_ptr<Grid> m_current;
std::unique_ptr<Grid> m_old;
};
#endif /* DOUBLE_BUFFER */
Event Timeline
Log In to Comment