Changeset 19219
- Timestamp:
- 03/24/15 12:03:49 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h
r19215 r19219 17 17 memcpy(*pmarshalled_data,&enum_type,sizeof(int));\ 18 18 *pmarshalled_data+=sizeof(int);\ 19 *pmarshalled_data_size+=sizeof(int);\20 19 }\ 21 20 else if(marshall_direction==MARSHALLING_SIZE){\ … … 23 22 }\ 24 23 else if(marshall_direction==MARSHALLING_BACKWARD){\ 24 *pmarshalled_data+=sizeof(int);\ 25 25 }\ 26 26 else _error_("Wrong direction during the Marshall process");\ … … 32 32 memcpy(*pmarshalled_data,&FIELD,sizeof(FIELD));\ 33 33 *pmarshalled_data+=sizeof(FIELD);\ 34 *pmarshalled_data_size+=sizeof(FIELD);\35 34 }\ 36 35 else if(marshall_direction==MARSHALLING_SIZE){\ … … 49 48 memcpy(*pmarshalled_data,FIELD,SIZE*sizeof(TYPE));\ 50 49 *pmarshalled_data+=SIZE*sizeof(TYPE);\ 51 *pmarshalled_data_size+=SIZE*sizeof(TYPE);\52 50 }\ 53 51 else if(marshall_direction==MARSHALLING_SIZE){\ … … 63 61 #define MARSHALLING_DYNAMIC(FIELD,TYPE,SIZE) \ 64 62 \ 65 if(marshall_direction==MARSHALLING_FORWARD){\ 66 memcpy(*pmarshalled_data,FIELD,SIZE*sizeof(TYPE));\ 67 *pmarshalled_data+=SIZE*sizeof(TYPE);\ 68 *pmarshalled_data_size+=SIZE*sizeof(TYPE);\ 69 }\ 70 else if(marshall_direction==MARSHALLING_SIZE){\ 71 *pmarshalled_data_size+=SIZE*sizeof(TYPE);\ 72 }\ 73 else if(marshall_direction==MARSHALLING_BACKWARD){\ 74 FIELD=xNew<TYPE>(SIZE);\ 75 memcpy(FIELD,*pmarshalled_data,SIZE*sizeof(TYPE));\ 76 *pmarshalled_data+=SIZE*sizeof(TYPE);\ 77 }\ 78 else _error_("Wrong direction during the Marshall process"); 63 {\ 64 bool field_null=true;\ 65 if (FIELD)field_null=false;\ 66 MARSHALLING(field_null);\ 67 \ 68 if(!field_null){\ 69 if(marshall_direction==MARSHALLING_FORWARD){\ 70 memcpy(*pmarshalled_data,FIELD,SIZE*sizeof(TYPE));\ 71 *pmarshalled_data+=SIZE*sizeof(TYPE);\ 72 }\ 73 else if(marshall_direction==MARSHALLING_SIZE){\ 74 *pmarshalled_data_size+=SIZE*sizeof(TYPE);\ 75 }\ 76 else if(marshall_direction==MARSHALLING_BACKWARD){\ 77 FIELD=xNew<TYPE>(SIZE);\ 78 memcpy(FIELD,*pmarshalled_data,SIZE*sizeof(TYPE));\ 79 *pmarshalled_data+=SIZE*sizeof(TYPE);\ 80 }\ 81 else _error_("Wrong direction during the Marshall process");\ 82 }\ 83 } 79 84 80 85 #endif
Note:
See TracChangeset
for help on using the changeset viewer.