Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

packdata.h

Go to the documentation of this file.
00001 
00002 #ifndef _PACKDATA_H_
00003 #define _PACKDATA_H_
00004 
00005 
00037 
00038 #include "blockpool.h"
00039 
00052 template <class T>
00053 class packdata {
00054 private:
00056   packdata( const packdata &rhs ) {}
00057 
00058 public:
00059   typedef enum { BadNodeKind,
00060                  OriginalData,
00061                  LowPass,
00062                  HighPass } transformKind;
00063 
00064 protected:
00068   transformKind kind;
00069 
00071   size_t N;
00072 
00074   T* data;
00075 
00077   packdata() {}
00078 
00079 public:
00086   packdata( T *vec, const size_t n, const transformKind k )
00087   {
00088     data = vec;
00089     N = n;
00090     kind = k;
00091   }
00092 
00094   virtual ~packdata() {}
00095 
00100   void *operator new( unsigned int num_bytes )
00101   {
00102     block_pool mem_pool;
00103 
00104     void *mem_addr = mem_pool.pool_alloc( num_bytes );
00105     return mem_addr;
00106   } // new
00107 
00108 
00110   void pr() const
00111   {
00112     for (int i = 0; i < N; i++) {
00113       printf("%7.4f ", data[i] );
00114     }
00115     printf("\n");
00116   } // pr
00117 
00118 
00120   const T* getData() { return data; }
00121 
00126   const transformKind getKind() { return kind; }
00127 
00129   size_t length() { return N; }
00130 }; // packdata 
00131 
00132 
00133 #endif

Generated at Sat Aug 10 13:23:34 2002 for Wavelet Packet Transform and Lossless Compression by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001