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

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

NEW: adding Archive/23390-24306

File size: 2.5 KB
RevLine 
[24307]1Index: ../trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h
2===================================================================
3--- ../trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h (revision 23689)
4+++ ../trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h (revision 23690)
5@@ -55,17 +55,24 @@
6 void GenericMarshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
7
8 MARSHALLING_ENUM(this->ObjectEnum());
9-
10- bool isnull=true;
11- if(marshall_direction==MARSHALLING_FORWARD || marshall_direction == MARSHALLING_SIZE) if(value) isnull=false;
12-
13 MARSHALLING(id);
14- MARSHALLING(result_name);
15- MARSHALLING(isnull)
16- if (!isnull) MARSHALLING(value) else value=0;
17 MARSHALLING(step);
18 MARSHALLING(time);
19
20+ /*Marshal result name*/
21+ int size = 0;
22+ if(marshall_direction==MARSHALLING_FORWARD || marshall_direction == MARSHALLING_SIZE) size=strlen(result_name)+1;
23+ MARSHALLING(size);
24+ MARSHALLING_DYNAMIC(result_name,char,size);
25+
26+ /*Marshall value*/
27+ this->value=0;
28+ bool isnull=true;
29+ if(marshall_direction==MARSHALLING_FORWARD || marshall_direction == MARSHALLING_SIZE){
30+ if(value) isnull=false;
31+ }
32+ MARSHALLING(isnull);
33+ if(!isnull) MARSHALLING(value)
34 } /*}}}*/
35
36 /*GenericExternalResult constructors and destructors*/
37@@ -76,7 +83,7 @@
38 N = 0;
39 step = 0;
40 time = 0;
41- value = NULL;
42+ value = 0;
43 } /*}}}*/
44 GenericExternalResult(int in_id, int in_enum_type,ResultType in_values, int in_M,int in_N,int in_step,IssmDouble in_time){/*{{{*/
45 _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");
46Index: ../trunk-jpl/src/c/datastructures/DataSet.cpp
47===================================================================
48--- ../trunk-jpl/src/c/datastructures/DataSet.cpp (revision 23689)
49+++ ../trunk-jpl/src/c/datastructures/DataSet.cpp (revision 23690)
50@@ -292,6 +292,12 @@
51 penpair->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
52 this->AddObject(penpair);
53 }
54+ else if(obj_enum==DoubleExternalResultEnum){
55+ GenericExternalResult<double>* result=new GenericExternalResult<double>();
56+ result->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
57+ result->Echo();
58+ this->AddObject(result);
59+ }
60 else _error_("could not recognize enum type: " << obj_enum << ": " << EnumToStringx(obj_enum) );
61 }
62 }
Note: See TracBrowser for help on using the repository browser.