Ignore:
Timestamp:
05/01/12 17:28:47 (13 years ago)
Author:
cborstad
Message:

merged trunk-jpl into branch through revision 12167

Location:
issm/branches/trunk-jpl-damage
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/branches/trunk-jpl-damage

  • issm/branches/trunk-jpl-damage/src/c/objects/Loads/Icefront.cpp

    r12004 r12168  
    163163}
    164164/*}}}*/
    165 #ifdef _SERIAL_
    166 /*FUNCTION Icefront::Marshall {{{1*/
    167 void  Icefront::Marshall(char** pmarshalled_dataset){
    168 
    169         char* marshalled_dataset=NULL;
    170         int   enum_type=0;
    171         char* marshalled_inputs=NULL;
    172         int   marshalled_inputs_size;
    173 
    174         /*recover marshalled_dataset: */
    175         marshalled_dataset=*pmarshalled_dataset;
    176 
    177         /*get enum type of Icefront: */
    178         enum_type=IcefrontEnum;
    179 
    180         /*marshall enum: */
    181         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    182 
    183         /*marshall Icefront data: */
    184         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    185         memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    186 
    187         /*Marshall hooks: */
    188         hnodes->Marshall(&marshalled_dataset);
    189         helement->Marshall(&marshalled_dataset);
    190         hmatpar->Marshall(&marshalled_dataset);
    191 
    192         /*Marshall inputs: */
    193         marshalled_inputs_size=inputs->MarshallSize();
    194         marshalled_inputs=inputs->Marshall();
    195         memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
    196         marshalled_dataset+=marshalled_inputs_size;
    197 
    198         /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
    199 
    200         xfree((void**)&marshalled_inputs);
    201 
    202         *pmarshalled_dataset=marshalled_dataset;
    203 }
    204 /*}}}*/
    205 /*FUNCTION Icefront::MarshallSize {{{1*/
    206 int   Icefront::MarshallSize(){
    207        
    208         return sizeof(id)
    209                 +sizeof(analysis_type)
    210                 +hnodes->MarshallSize()
    211                 +helement->MarshallSize()
    212                 +hmatpar->MarshallSize()
    213                 +inputs->MarshallSize()
    214                 +sizeof(int); //sizeof(int) for enum type
    215 }
    216 /*}}}*/
    217 /*FUNCTION Icefront::Demarshall {{{1*/
    218 void  Icefront::Demarshall(char** pmarshalled_dataset){
    219 
    220         char* marshalled_dataset=NULL;
    221         int   i;
    222 
    223         /*recover marshalled_dataset: */
    224         marshalled_dataset=*pmarshalled_dataset;
    225 
    226         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    227          *object data (thanks to DataSet::Demarshall):*/
    228         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    229         memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    230 
    231         /*demarshall hooks: */
    232         hnodes=new Hook(); hnodes->Demarshall(&marshalled_dataset);
    233         helement=new Hook(); helement->Demarshall(&marshalled_dataset);
    234         hmatpar=new Hook(); hmatpar->Demarshall(&marshalled_dataset);
    235        
    236         /*pointers are garbabe, until configuration is carried out: */
    237         nodes=NULL;
    238         element=NULL;
    239         matpar=NULL;
    240 
    241         /*demarshall inputs: */
    242         inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
    243 
    244         /*parameters: may not exist even yet, so let Configure handle it: */
    245         this->parameters=NULL;
    246 
    247         /*return: */
    248         *pmarshalled_dataset=marshalled_dataset;
    249         return;
    250 }
    251 /*}}}*/
    252 #endif
    253165/*FUNCTION Icefront::ObjectEnum{{{1*/
    254166int Icefront::ObjectEnum(void){
Note: See TracChangeset for help on using the changeset viewer.