Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

gobjbuffer.hpp

Go to the documentation of this file.
00001 //************************************************************************************//
00002 // Module       : gobjbuffer.hpp
00003 // Date         : 7/9/01 (DLR)
00004 // Copyright    : 2001-2006 Copyright University Corporation for Atmospheric
00005 //                Research
00006 // Description  : Encapsulates the methods and data associated with
00007 //                a buffer template object holding GASpAR objects
00008 // Derived From : none.
00009 // Modifications:
00010 //************************************************************************************//
00011 #if !defined(GOBJBUFFER_HPP)
00012 #define GOBJBUFFER_HPP
00013 
00014 #include "gtypes.h"
00015 #include <iostream.h>
00016 #include <stdlib.h>
00017 #include "gllbasis.hpp"
00018 #include "glbasis.hpp"
00019 
00020 
00021 #if !defined(CHBuffer)
00022 #  define CHBuffer  GObjBuffer<CHandle>
00023 #endif
00024 
00025 
00026 template<class TBUFF> class GObjBuffer
00027 {
00028 
00029 
00030 private:
00031 
00032 // Private methods:
00033         void              DeleteDynamic();
00034 
00035 // Private data:
00036         GINT               n;
00037         TBUFF             *data;
00038 
00039 
00040 public:
00041                            GObjBuffer();
00042                            GObjBuffer(GINT  size);
00043                            GObjBuffer(const GObjBuffer &);
00044 //virtual                 ~GObjBuffer();
00045                           ~GObjBuffer();
00046 
00047 
00048 #if 0
00049          void              operator=(GObjBuffer<TBUFF> &);
00050          void              operator=(TBUFF *m);
00051 #endif
00052 inline    TBUFF            &operator()(const GINT  i) { 
00053 #if defined(GARRAY_BOUNDS)
00054                             if ( i >= n || i < 0 ) {
00055                               cout << "GObjBuffer<T>::(): access error: index=" << i << "; max=" <<  n << endl;
00056                               exit(1);
00057                              }
00058 #endif
00059                             return data[i]; }
00060 inline    TBUFF            &operator[](const GINT  i) const {
00061 #if defined(GARRAY_BOUNDS)
00062                             if ( i >= n || i < 0 ) {
00063                               cout << "GObjBuffer<T>::[]: access error: index=" << i << "; max=" <<  n << endl;
00064                               exit(1);
00065                              }
00066 #endif
00067                             return data[i]; } 
00068 #if 0
00069          friend ostream&   operator<<(ostream &, const GObjBuffer<TBUFF> &);
00070 #endif
00071                    
00072          GINT              dim() const;
00073          TBUFF            *Data();
00074          GBOOL             Resize(GINT  order);
00075 
00076 };
00077 #if defined(_LINUX) || defined(_AIX)
00078 template class GObjBuffer<CHandle>;
00079 ostream &operator <<(ostream&, const GObjBuffer<CHandle>&);
00080 #endif
00081 #endif

Generated on Wed Dec 21 16:00:48 2005 for Geophysics & Astrophysics Spectral Element Adaptive Refinement (GASpAR) 2D Code by  doxygen 1.4.4