Department of Scientific Computing   
Institute for Numerical Simulation   
University of Bonn   
Documentation
Download
Programming References
Bug Reports / Suggestions
FAQ
Authors
Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

Buffer.cc

00001 /*********************/
00002 /*                   */
00003 /*   doubleBuffer::  */
00004 /*                   */
00005 /*********************/
00006 
00007 #include "Buffer.hpp"
00008 
00009 //doubleBuffer::doubleBuffer () { b=NULL; locked=false; }
00010 doubleBuffer::~doubleBuffer() { free(b); locked=false; }
00011 doubleBuffer::doubleBuffer(int J) { 
00012   b=NULL  ;
00013   Init(J) ;
00014 }
00015 
00016 void doubleBuffer::Init(int J) {
00017   b=(double *)calloc((1<<J)+1 , sizeof(double)) ;
00018   locked=false ;
00019 }
00020 
00021 double *doubleBuffer::lock() {
00022   if (locked) return NULL ;
00023   locked=true ;
00024   return b    ;
00025 }
00026 
00027 void doubleBuffer::unlock() {
00028   assert(locked) ;
00029   locked=false   ;
00030 }
00031 

Generated at Mon Aug 19 10:02:31 2002 for AWFD by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001