gridfun.hh

Go to the documentation of this file.
00001 #ifndef __GRIDPP_FUN__
00002 #define __GRIDPP_FUN__
00003 
00006 #include "contentpackage.hh"
00007 #include "rarray.h"
00008 
00009 namespace RVL {
00010 
00011   template<>
00012   size_t getDataSize<RARR>(RARR const & a) {
00013     size_t n; 
00014     ra_a_datasize((RARR *)(&a), &n);
00015     return n;
00016   }
00017 
00018   template<>
00019   ireal * newData<ireal,RARR>(RARR & md) {
00020     int err=0;
00021     if ((err=ra_allocate(&md))) {
00022       RVLException e;
00023       e<<"Error: newData<ireal,RARR> ContentPackage aux fcn\n";
00024       e<<"from ra_allocate, err="<<err<<"\n";
00025       throw e;
00026     }
00027     return md._s0;
00028   }
00029 
00030   template<>
00031   void deleteData<ireal,RARR>(ireal ** d,RARR ** md) {
00032     //    delete *md; *md=NULL; *d=NULL;
00033     ra_destroy(*md); delete *md; *md=NULL; *d=NULL;
00034   }
00035 
00036   template<>
00037   ostream & writeMeta<RARR>(RARR const & md, ostream & s) {
00038     s<<"RARR\n";
00039     return s;
00040   }
00041 
00042 }
00043 
00044 #endif
00045 

Generated on 5 Jan 2017 for IWAVEGRID by  doxygen 1.4.7