Overture  Version 25
Macros | Functions
DataBaseBuffer.C File Reference
#include "OvertureDefine.h"
#include "DataBaseBuffer.h"
#include "ParallelUtility.h"
Include dependency graph for DataBaseBuffer.C:

Macros

#define PUT(pt, type, atype)   int DataBaseBuffer:: putToBuffer( const int & size, const atype *data ) { if( pt+size+1 > type ## BufferSize ) { if( size > type ## BufferSizeIncrement ) type ## BufferSizeIncrement= size; if( type ## BufferSize > type ## BufferSizeIncrement ) type ## BufferSizeIncrement= type ## BufferSize; type ## BufferSize+= type ## BufferSizeIncrement; type ## Buffer.resize(type ## BufferSize); /* printf("DataBaseBuffer::Increase " #type " buffer size to %i \n",type ## BufferSize); */ } type *buffer = type ## Buffer.getDataPointer(); for( int i=0; i<size; i++ ) { buffer[pt++]=data[i]; /* type temp = data[i]*2; */ /* make umr show up? */} buffer[pt++]=type ## MagicNumber; return 0; }
 
#define GET(pt, type, atype)   int DataBaseBuffer:: getFromBuffer( const int & size, atype *data ) { type *buffer = type ## Buffer.getDataPointer(); for( int i=0; i<size; i++ ) data[i]=buffer[pt++]; type magic = buffer[pt++]; if( magic!=type ## MagicNumber ) { printF("DataBaseBuffer::getFromBuffer:ERROR magic number does not match, this is fatal \n" "The data base is being read in streaming mode, the data base is not being read \n" "in exactly the same order that it was written. \n" "If you are reading an overlapping grid you may have to regenerate the grid. \n" "This file was created with %s (current version is %s)\n",(const char*)OvertureVersion,OVERTURE_VERSION);throw "error"; } return 0; }
 

Functions

aStringsPrintF (aString &s, const char *format,...)
 

Macro Definition Documentation

#define GET (   pt,
  type,
  atype 
)    int DataBaseBuffer:: getFromBuffer( const int & size, atype *data ) { type *buffer = type ## Buffer.getDataPointer(); for( int i=0; i<size; i++ ) data[i]=buffer[pt++]; type magic = buffer[pt++]; if( magic!=type ## MagicNumber ) { printF("DataBaseBuffer::getFromBuffer:ERROR magic number does not match, this is fatal \n" "The data base is being read in streaming mode, the data base is not being read \n" "in exactly the same order that it was written. \n" "If you are reading an overlapping grid you may have to regenerate the grid. \n" "This file was created with %s (current version is %s)\n",(const char*)OvertureVersion,OVERTURE_VERSION);throw "error"; } return 0; }
#define PUT (   pt,
  type,
  atype 
)    int DataBaseBuffer:: putToBuffer( const int & size, const atype *data ) { if( pt+size+1 > type ## BufferSize ) { if( size > type ## BufferSizeIncrement ) type ## BufferSizeIncrement= size; if( type ## BufferSize > type ## BufferSizeIncrement ) type ## BufferSizeIncrement= type ## BufferSize; type ## BufferSize+= type ## BufferSizeIncrement; type ## Buffer.resize(type ## BufferSize); /* printf("DataBaseBuffer::Increase " #type " buffer size to %i \n",type ## BufferSize); */ } type *buffer = type ## Buffer.getDataPointer(); for( int i=0; i<size; i++ ) { buffer[pt++]=data[i]; /* type temp = data[i]*2; */ /* make umr show up? */} buffer[pt++]=type ## MagicNumber; return 0; }

Function Documentation

aString& sPrintF ( aString s,
const char *  format,
  ... 
)