- Timestamp:
- 09/01/20 14:46:34 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h
r25506 r25507 119 119 } 120 120 121 #define MARSHALLING_ENUM(EN)\122 int type_enum=EN;\123 if(marshall_direction==MARSHALLING_WRITE){\124 memcpy(*pmarshalled_data,&type_enum,sizeof(int));\125 *pmarshalled_data+=sizeof(int);\126 }\127 else if(marshall_direction==MARSHALLING_SIZE){\128 *pmarshalled_data_size+=sizeof(int);\129 }\130 else if(marshall_direction==MARSHALLING_LOAD){\131 *pmarshalled_data+=sizeof(int);\132 }\133 else _error_("Wrong direction during the Marshall process");\134 135 136 #define MARSHALLING(FIELD)\137 \138 if(marshall_direction==MARSHALLING_WRITE){\139 memcpy(*pmarshalled_data,&FIELD,sizeof(FIELD));\140 *pmarshalled_data+=sizeof(FIELD);\141 }\142 else if(marshall_direction==MARSHALLING_SIZE){\143 *pmarshalled_data_size+=sizeof(FIELD);\144 }\145 else if(marshall_direction==MARSHALLING_LOAD){\146 memcpy(&FIELD,*pmarshalled_data,sizeof(FIELD));\147 *pmarshalled_data+=sizeof(FIELD);\148 }\149 else _error_("Wrong direction during the Marshall process");150 151 152 #define MARSHALLING_DYNAMIC(FIELD,TYPE,SIZE) \153 \154 {\155 bool field_null=true;\156 if (FIELD)field_null=false;\157 MARSHALLING(field_null);\158 \159 if(!field_null){\160 if(marshall_direction==MARSHALLING_WRITE){\161 memcpy(*pmarshalled_data,FIELD,SIZE*sizeof(TYPE));\162 *pmarshalled_data+=SIZE*sizeof(TYPE);\163 }\164 else if(marshall_direction==MARSHALLING_SIZE){\165 *pmarshalled_data_size+=SIZE*sizeof(TYPE);\166 }\167 else if(marshall_direction==MARSHALLING_LOAD){\168 FIELD=xNew<TYPE>(SIZE);\169 memcpy(FIELD,*pmarshalled_data,SIZE*sizeof(TYPE));\170 *pmarshalled_data+=SIZE*sizeof(TYPE);\171 }\172 else _error_("Wrong direction during the Marshall process");\173 }\174 }175 176 121 #endif
Note:
See TracChangeset
for help on using the changeset viewer.