source: issm/oecreview/Archive/23390-24306/ISSM-23689-23690.diff

Last change on this file was 24307, checked in by Mathieu Morlighem, 5 years ago

NEW: adding Archive/23390-24306

File size: 2.5 KB
  • ../trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h

     
    5555                void GenericMarshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
    5656
    5757                        MARSHALLING_ENUM(this->ObjectEnum());
    58 
    59                         bool isnull=true;
    60                         if(marshall_direction==MARSHALLING_FORWARD || marshall_direction == MARSHALLING_SIZE) if(value) isnull=false;
    61 
    6258                        MARSHALLING(id);
    63                         MARSHALLING(result_name);
    64                         MARSHALLING(isnull)
    65                         if (!isnull) MARSHALLING(value) else value=0;
    6659                        MARSHALLING(step);
    6760                        MARSHALLING(time);
    6861
     62                        /*Marshal result name*/
     63                        int size = 0;
     64                        if(marshall_direction==MARSHALLING_FORWARD || marshall_direction == MARSHALLING_SIZE) size=strlen(result_name)+1;
     65                        MARSHALLING(size);
     66                        MARSHALLING_DYNAMIC(result_name,char,size);
     67
     68                        /*Marshall value*/
     69                        this->value=0;
     70                        bool isnull=true;
     71                        if(marshall_direction==MARSHALLING_FORWARD || marshall_direction == MARSHALLING_SIZE){
     72                                if(value) isnull=false;
     73                        }
     74                        MARSHALLING(isnull);
     75                        if(!isnull) MARSHALLING(value)
    6976                }  /*}}}*/
    7077
    7178                /*GenericExternalResult constructors and  destructors*/
     
    7683                        N           = 0;
    7784                        step        = 0;
    7885                        time        = 0;
    79                         value       = NULL;
     86                        value       = 0;
    8087                } /*}}}*/
    8188                GenericExternalResult(int in_id, int in_enum_type,ResultType in_values, int in_M,int in_N,int in_step,IssmDouble in_time){/*{{{*/
    8289                        _error_("template GenericExternalResult(int in_id, int in_enum_type,double* in_values, int in_M,int in_N,int in_step,IssmDouble in_time) not implemented for this ResultType\n");
  • ../trunk-jpl/src/c/datastructures/DataSet.cpp

     
    292292                                penpair->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
    293293                                this->AddObject(penpair);
    294294                        }
     295                        else if(obj_enum==DoubleExternalResultEnum){
     296                                GenericExternalResult<double>* result=new GenericExternalResult<double>();
     297                                result->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
     298                                result->Echo();
     299                                this->AddObject(result);
     300                        }
    295301                        else _error_("could not recognize enum type: " << obj_enum << ": " << EnumToStringx(obj_enum) );
    296302                }
    297303        }
Note: See TracBrowser for help on using the repository browser.