Changeset 19222


Ignore:
Timestamp:
03/24/15 12:07:28 (10 years ago)
Author:
Eric.Larour
Message:

CHG: implementing Marshall capability for all Params objects.

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

Legend:

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

    r18064 r19222  
    122122}
    123123/*}}}*/
     124void DoubleMatArrayParam::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
     125
     126        MARSHALLING_ENUM(DoubleMatArrayParamEnum);
     127
     128        MARSHALLING(enum_type);
     129        MARSHALLING(M);
     130        MARSHALLING_DYNAMIC(mdim_array,int,M);
     131        MARSHALLING_DYNAMIC(ndim_array,int,M);
     132
     133        if(marshall_direction==MARSHALLING_BACKWARD)if(M)array=xNew<IssmDouble*>(M);
     134
     135        for(int i=0;i<M;i++){
     136                MARSHALLING_DYNAMIC(array[i],IssmDouble,mdim_array[i]*ndim_array[i]);
     137        }
     138               
     139
     140}
     141/*}}}*/
    124142
    125143/*DoubleMatArrayParam virtual functions definitions: */
     
    211229}
    212230/*}}}*/
     231               
  • issm/trunk-jpl/src/c/classes/Params/DoubleMatArrayParam.h

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

    r18064 r19222  
    5555}
    5656/*}}}*/
     57void FileParam::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
     58
     59        MARSHALLING_ENUM(FileParamEnum);
     60        MARSHALLING(value);
     61
     62        if(marshall_direction==MARSHALLING_BACKWARD)value=NULL; //meaningless file pointer!
     63
     64}
     65/*}}}*/
  • issm/trunk-jpl/src/c/classes/Params/FileParam.h

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

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

    r19198 r19222  
    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/IntVecParam.cpp

    r18064 r19222  
    8585}
    8686/*}}}*/
     87void IntVecParam::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
     88
     89        MARSHALLING_ENUM(IntVecParamEnum);
     90
     91        MARSHALLING(enum_type);
     92        MARSHALLING(M);
     93        MARSHALLING_DYNAMIC(values,int,M);
     94
     95}
     96/*}}}*/
    8797
    8898/*IntVecParam virtual functions definitions: */
  • issm/trunk-jpl/src/c/classes/Params/IntVecParam.h

    r19198 r19222  
    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 virtual functions definitions: {{{*/
  • issm/trunk-jpl/src/c/classes/Params/StringParam.cpp

    r18064 r19222  
    5656}
    5757/*}}}*/
     58void StringParam::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
     59
     60        int size;
     61
     62        if(marshall_direction==MARSHALLING_FORWARD || marshall_direction == MARSHALLING_SIZE)size=strlen(value)+1;
     63       
     64        MARSHALLING_ENUM(StringParamEnum);
     65        MARSHALLING(enum_type);
     66        MARSHALLING(size);
     67        MARSHALLING_DYNAMIC(value,char,size);
     68
     69
     70}
     71/*}}}*/
    5872
    5973/*StringParam virtual functions definitions: */
  • issm/trunk-jpl/src/c/classes/Params/StringParam.h

    r19198 r19222  
    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: {{{*/
Note: See TracChangeset for help on using the changeset viewer.