Logo Coherent WaveBurst  
Reference Guide
Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SymmObjArray.hh
Go to the documentation of this file.
1 #ifndef SYMMOBJARRAY_HH
2 #define SYMMOBJARRAY_HH
3 
4 #include "stdio.h"
5 #include "TNamed.h"
6 
7 // guaranteed to work only with classes that implement the "persistent" interface (Read/Write)
8 
9 // a[-n], a[-n+1] a[-n+2] ... a[0] a[1] .... a[n]
10 
11 template <class T>
12 class SymmObjArray : public TNamed {
13 public:
14  explicit SymmObjArray(unsigned int n=0);
15  explicit SymmObjArray(const SymmObjArray&); //copy constructor
16  virtual ~SymmObjArray();
17  SymmObjArray& operator=(const SymmObjArray& other);
18  void Resize(unsigned int sz); // data is lost
19  void Write(FILE* f);
20  void Read(FILE* f);
21  T& operator[](int i){ return zero[i];}
22  unsigned int Last() {return Size/2;}
23 
24 protected:
25  void Resize0(unsigned int sz);
26  int Size;
27  T* rec; //!
28  T* zero; //!
29 
30  ClassDef(SymmObjArray,1)
31 };
32 
33 
34 #endif
tuple f
Definition: cwb_online.py:91
unsigned int Last()
Definition: SymmObjArray.hh:22
int n
Definition: cwb_net.C:10
void Read(FILE *f)
Definition: SymmObjArray.cc:55
i drho i
virtual ~SymmObjArray()
Definition: SymmObjArray.cc:31
void Resize(unsigned int sz)
Definition: SymmObjArray.cc:36
void Resize0(unsigned int sz)
Definition: SymmObjArray.cc:41
double T
Definition: testWDM_4.C:11
SymmObjArray(unsigned int n=0)
Definition: SymmObjArray.cc:9
SymmObjArray & operator=(const SymmObjArray &other)
Definition: SymmObjArray.cc:23
void Write(FILE *f)
Definition: SymmObjArray.cc:49
T & operator[](int i)
Definition: SymmObjArray.hh:21