Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91672552
double_buffer.h
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
Wed, Nov 13, 08:01
Size
872 B
Mime Type
text/x-c++
Expires
Fri, Nov 15, 08:01 (2 d)
Engine
blob
Format
Raw Data
Handle
22300371
Attached To
rTSUNAMIPROJECT PHPC-TSUNAMI-PROJECT
double_buffer.h
View Options
//
// Created by Arnaud Pannatier on 06.05.18.
// Based on the code of :
// - Nicolas Richart <nicolas.richart@epfl.ch>
// - Vincent Keller <vincent.keller@epfl.ch>
// - Vittoria Rezzonico <vittoria.rezzonico@epfl.ch>
// See the files AUTHORS and COPYRIGHT for the concerning informations
//
#ifndef PHPCTSUNAMIPROJECT_DOUBLE_BUFFER_H
#define PHPCTSUNAMIPROJECT_DOUBLE_BUFFER_H
#include <memory>
#include "grid.h"
class
DoubleBuffer
{
public:
// Constructor
DoubleBuffer
()
=
default
;
DoubleBuffer
(
int
m
,
int
n
);
// return the current value
Grid
&
current
();
// return the old value
Grid
&
old
();
void
swap
();
private:
// Keep a pointer to the actual place in memory, assure that we don't duplicate the memory
std
::
unique_ptr
<
Grid
>
m_current
;
std
::
unique_ptr
<
Grid
>
m_old
;
};
#endif
//PHPCTSUNAMIPROJECT_DOUBLE_BUFFER_H
Event Timeline
Log In to Comment