Changeset 19217


Ignore:
Timestamp:
03/20/15 17:29:29 (10 years ago)
Author:
Eric.Larour
Message:

CHG: pushing Marshall routines into low level objects

Location:
issm/trunk-jpl/src/c/classes/Params
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Params/DataSetParam.cpp

    r18064 r19217  
    5858}
    5959/*}}}*/
     60void DataSetParam::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
     61
     62        if(marshall_direction==MARSHALLING_BACKWARD)value=new DataSet();
     63       
     64        MARSHALLING_ENUM(DataSetParamEnum);
     65        MARSHALLING(enum_type);
     66        value->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
     67
     68}
     69/*}}}*/
    6070
    6171/*DataSetParam virtual functions definitions: */
  • issm/trunk-jpl/src/c/classes/Params/DataSetParam.h

    r19198 r19217  
    3737                int   ObjectEnum();
    3838                Object* copy();
    39                 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
     39                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
    4040                /*}}}*/
    4141                /*Param vritual function definitions: {{{*/
  • issm/trunk-jpl/src/c/classes/Params/DoubleMatParam.cpp

    r18064 r19217  
    7373}
    7474/*}}}*/
     75void DoubleMatParam::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
     76
     77        MARSHALLING_ENUM(DoubleMatParamEnum);
     78
     79        MARSHALLING(enum_type);
     80        MARSHALLING(M);
     81        MARSHALLING(N);
     82        MARSHALLING_DYNAMIC(value,IssmDouble,M*N);
     83}
     84/*}}}*/
    7585
    7686/*DoubleMatParam virtual functions definitions: */
  • issm/trunk-jpl/src/c/classes/Params/DoubleMatParam.h

    r19198 r19217  
    3838                int   ObjectEnum();
    3939                Object* copy();
    40                 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
     40                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
    4141                /*}}}*/
    4242                /*Param vritual function definitions: {{{*/
  • issm/trunk-jpl/src/c/classes/Params/DoubleVecParam.cpp

    r18064 r19217  
    6262}
    6363/*}}}*/
     64void DoubleVecParam::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
     65
     66        MARSHALLING_ENUM(DoubleVecParamEnum);
     67
     68        MARSHALLING(enum_type);
     69        MARSHALLING(M);
     70        MARSHALLING_DYNAMIC(values,IssmDouble,M);
     71
     72}
     73/*}}}*/
    6474
    6575/*DoubleVecParam virtual functions definitions: */
  • issm/trunk-jpl/src/c/classes/Params/DoubleVecParam.h

    r19198 r19217  
    3737                int   ObjectEnum();
    3838                Object* copy();
    39                 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
     39                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
    4040                /*}}}*/
    4141                /*Param virtual functions definitions: {{{*/
  • issm/trunk-jpl/src/c/classes/Params/StringArrayParam.cpp

    r18064 r19217  
    8181}
    8282/*}}}*/
     83void StringArrayParam::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
     84
     85        int* sizes=NULL;
     86
     87        if(marshall_direction==MARSHALLING_FORWARD || marshall_direction==MARSHALLING_SIZE){
     88                if(numstrings)sizes=xNew<int>(numstrings);
     89                for(int i=0;i<numstrings;i++)sizes[i]=strlen(value[i])+1;
     90        }
     91
     92        MARSHALLING_ENUM(StringArrayParamEnum);
     93       
     94        MARSHALLING(enum_type);
     95        MARSHALLING(numstrings);
     96
     97        if(numstrings){
     98                MARSHALLING_DYNAMIC(sizes,int,numstrings);
     99               
     100                if(marshall_direction==MARSHALLING_BACKWARD) value=xNew<char*>(numstrings);
     101               
     102                for(int i=0;i<numstrings;i++)MARSHALLING_DYNAMIC(value[i],char,sizes[i]);
     103        }
     104
     105}
     106/*}}}*/
    83107
    84108/*StringArrayParam virtual functions definitions: */
  • issm/trunk-jpl/src/c/classes/Params/StringArrayParam.h

    r19198 r19217  
    2121
    2222        private:
    23                 /*just hold 3 values for 3 vertices: */
    2423                int      enum_type;
    2524                char**   value;
     
    3837                int   ObjectEnum();
    3938                Object* copy();
    40                 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
     39                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
    4140                /*}}}*/
    4241                /*Param vritual function definitions: {{{*/
Note: See TracChangeset for help on using the changeset viewer.