working version. needs small amount of placing tweaking to put
[charm.git] / examples / charm++ / pupDisk / someData.h
1 class someData 
2 {
3  public:
4  someData(int _howBig):howBig(_howBig){data=new int[howBig];}
5   someData(){data=NULL; howBig=0;}
6   void pup(PUP::er &p)
7     {
8       // remember to pup your superclass if there is one
9       p|howBig;
10       if(p.isUnpacking())
11         data=new int[howBig];
12       PUParray(p,data,howBig);
13     }
14
15   inline someData &operator=(const someData &indata) {
16     if(data && howBig>0) delete [] data;
17     howBig=indata.howBig;
18     data=new int[howBig];
19     for(int i=0; i<howBig; ++i) data[i]=indata.data[i];
20     return *this;
21   }
22
23   
24   ~someData(){if (data); delete [] data;}
25   int howBig;
26   int *data;
27 };