Line | |
---|
1 | #ifndef __GRID1D_H__ |
---|
2 | #define __GRID1D_H__ |
---|
3 | |
---|
4 | // |
---|
5 | // class for 1D grid |
---|
6 | // |
---|
7 | |
---|
8 | #include <vector> |
---|
9 | #include "rp_defs.h" |
---|
10 | |
---|
11 | class RpGrid1d { |
---|
12 | public: |
---|
13 | // constructors |
---|
14 | RpGrid1d(); |
---|
15 | RpGrid1d(int size); |
---|
16 | RpGrid1d(double* data, int size); // makes a copy of data |
---|
17 | RpGrid1d(const char* buf); // instantiate with byte stream |
---|
18 | |
---|
19 | //int type() { return _type; } |
---|
20 | //void type(int i) { _type = i; } |
---|
21 | |
---|
22 | // return number of points in grid |
---|
23 | int size() { return _points.size(); } |
---|
24 | |
---|
25 | // change the size of the grid after grid is constructed |
---|
26 | void resize(int size) { _points.resize(size); } |
---|
27 | |
---|
28 | // serialize data |
---|
29 | char * serialize(); |
---|
30 | int deserialize(const char* buf); |
---|
31 | |
---|
32 | // destructor |
---|
33 | virtual ~RpGrid1d() { }; |
---|
34 | |
---|
35 | // TODO |
---|
36 | //virtual int xmlPut() { }; |
---|
37 | //virtual int xmlGet() { }; |
---|
38 | |
---|
39 | private: |
---|
40 | int _type; // type of array elements: int, float, double, etc. |
---|
41 | vector<double> _points; // array of doubles |
---|
42 | }; |
---|
43 | |
---|
44 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.