Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F60079953
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, Apr 27, 08:20
Size
644 B
Mime Type
text/x-c++
Expires
Mon, Apr 29, 08:20 (2 d)
Engine
blob
Format
Raw Data
Handle
17243459
Attached To
rSCINTROPARALLEL Poisson code for introduction to parallelism
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