Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91474293
double_buffer.cpp
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, Nov 11, 11:57
Size
539 B
Mime Type
text/x-c
Expires
Wed, Nov 13, 11:57 (2 d)
Engine
blob
Format
Raw Data
Handle
22268208
Attached To
rTSUNAMIPROJECT PHPC-TSUNAMI-PROJECT
double_buffer.cpp
View Options
//
// Created by Arnaud Pannatier on 06.05.18.
//
#include "double_buffer.h"
#include "grid.h"
DoubleBuffer
::
DoubleBuffer
(
std
::
size_t
m
,
std
::
size_t
n
)
:
m_current
(
new
Grid
(
m
,
n
)),
m_old
(
new
Grid
(
m
,
n
))
{}
Grid
&
DoubleBuffer
::
current
()
{
return
*
m_current
;
}
Grid
&
DoubleBuffer
::
old
()
{
return
*
m_old
;
}
void
DoubleBuffer
::
swap
()
{
m_current
.
swap
(
m_old
);
}
void
DoubleBuffer
::
resize
(
std
::
size_t
nx
,
std
::
size_t
ny
)
{
std
::
cout
<<
"NX : "
<<
nx
<<
std
::
endl
;
current
().
resize
(
nx
,
ny
);
old
().
resize
(
nx
,
ny
);
}
Event Timeline
Log In to Comment