Ignore:
Timestamp:
Mar 2, 2006 9:07:05 AM (18 years ago)
Author:
cxsong
Message:

modified serialization/deserializaiton functions, added xmlString, print, capacity, etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mesh/grid1d.h

    r185 r254  
    1717        RpGrid1d(const char* buf); // instantiate with byte stream
    1818
     19        // add all points to grid
     20        RP_ERROR addAllPoints(double* val, int nitems);
     21
     22        // add one point to grid
    1923        void addPoint(double val);
    2024
     
    2226        int numPoints() { return m_data.size(); }
    2327
     28        // max num points that can be stored
     29        int capacity() { return m_data.capacity(); }
     30
    2431        // change the size of the grid after grid is constructed
    2532        void resize(int npoints) { m_data.resize(npoints); }
    2633
    2734        // serialize data
    28         char * serialize(RP_ENCODE_ALG eflag=RP_NO_ENCODING,
     35        // If no input parameters are provided, byte stream will be binary
     36        // without compression.
     37        //
     38        char * serialize(int& nbytes, RP_ENCODE_ALG eflag=RP_NO_ENCODING,
    2939                         RP_COMPRESSION cflag=RP_NO_COMPRESSION);
    30         int deserialize(const char* buf);
     40
     41        RP_ERROR serialize(char * buf, int nbytes,
     42                        RP_ENCODE_ALG eflag=RP_NO_ENCODING,
     43                        RP_COMPRESSION cflag=RP_NO_COMPRESSION);
     44
     45        RP_ERROR deserialize(const char* buf);
     46
     47        void xmlString(std::string& str);
     48        void print();
    3149
    3250        // destructor
Note: See TracChangeset for help on using the changeset viewer.