Index: ../trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h =================================================================== --- ../trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h (revision 23689) +++ ../trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h (revision 23690) @@ -55,17 +55,24 @@ void GenericMarshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/ MARSHALLING_ENUM(this->ObjectEnum()); - - bool isnull=true; - if(marshall_direction==MARSHALLING_FORWARD || marshall_direction == MARSHALLING_SIZE) if(value) isnull=false; - MARSHALLING(id); - MARSHALLING(result_name); - MARSHALLING(isnull) - if (!isnull) MARSHALLING(value) else value=0; MARSHALLING(step); MARSHALLING(time); + /*Marshal result name*/ + int size = 0; + if(marshall_direction==MARSHALLING_FORWARD || marshall_direction == MARSHALLING_SIZE) size=strlen(result_name)+1; + MARSHALLING(size); + MARSHALLING_DYNAMIC(result_name,char,size); + + /*Marshall value*/ + this->value=0; + bool isnull=true; + if(marshall_direction==MARSHALLING_FORWARD || marshall_direction == MARSHALLING_SIZE){ + if(value) isnull=false; + } + MARSHALLING(isnull); + if(!isnull) MARSHALLING(value) } /*}}}*/ /*GenericExternalResult constructors and destructors*/ @@ -76,7 +83,7 @@ N = 0; step = 0; time = 0; - value = NULL; + value = 0; } /*}}}*/ GenericExternalResult(int in_id, int in_enum_type,ResultType in_values, int in_M,int in_N,int in_step,IssmDouble in_time){/*{{{*/ _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"); Index: ../trunk-jpl/src/c/datastructures/DataSet.cpp =================================================================== --- ../trunk-jpl/src/c/datastructures/DataSet.cpp (revision 23689) +++ ../trunk-jpl/src/c/datastructures/DataSet.cpp (revision 23690) @@ -292,6 +292,12 @@ penpair->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); this->AddObject(penpair); } + else if(obj_enum==DoubleExternalResultEnum){ + GenericExternalResult* result=new GenericExternalResult(); + result->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); + result->Echo(); + this->AddObject(result); + } else _error_("could not recognize enum type: " << obj_enum << ": " << EnumToStringx(obj_enum) ); } }