- Timestamp:
- 06/26/10 12:30:21 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.cpp
r4236 r4248 20 20 /*}}}*/ 21 21 22 /* Object constructors and destructor*/22 /*BoolExternalResult constructors and destructor*/ 23 23 /*FUNCTION BoolExternalResult::BoolExternalResult(){{{1*/ 24 24 BoolExternalResult::BoolExternalResult(){ … … 42 42 /*}}}*/ 43 43 44 /*Object methods*/ 45 /*FUNCTION BoolExternalResult::copy{{{1*/ 46 Object* BoolExternalResult::copy() { 47 48 return new BoolExternalResult(this->id,this->enum_type,this->value,this->step,this->time); 49 44 /*Object virtual functions definitions:*/ 45 /*FUNCTION BoolExternalResult::Echo {{{1*/ 46 void BoolExternalResult::Echo(void){ 47 this->DeepEcho(); 50 48 } 51 49 /*}}}*/ … … 59 57 printf(" step: %i\n",this->step); 60 58 printf(" time: %g\n",this->time); 59 } 60 /*}}}*/ 61 /*FUNCTION BoolExternalResult::Id{{{1*/ 62 int BoolExternalResult::Id(void){ return -1; } 63 /*}}}*/ 64 /*FUNCTION BoolExternalResult::MyRank{{{1*/ 65 int BoolExternalResult::MyRank(void){ 66 extern int my_rank; 67 return my_rank; 68 } 69 /*}}}*/ 70 /*FUNCTION BoolExternalResult::Marshall{{{1*/ 71 void BoolExternalResult::Marshall(char** pmarshalled_dataset){ 72 73 char* marshalled_dataset=NULL; 74 int enum_value=0; 75 76 /*recover marshalled_dataset: */ 77 marshalled_dataset=*pmarshalled_dataset; 78 79 /*get enum value of BoolExternalResult: */ 80 enum_value=BoolExternalResultEnum; 81 82 /*marshall enum: */ 83 memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value); 84 85 /*marshall BoolExternalResult data: */ 86 memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id); 87 memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type); 88 memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value); 89 memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step); 90 memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time); 91 92 *pmarshalled_dataset=marshalled_dataset; 93 } 94 /*}}}*/ 95 /*FUNCTION BoolExternalResult::MarshallSize{{{1*/ 96 int BoolExternalResult::MarshallSize(){ 97 98 return sizeof(value)+ 99 +sizeof(id) 100 +sizeof(enum_type) 101 +sizeof(step) 102 +sizeof(time) 103 +sizeof(int); //sizeof(int) for enum value 61 104 } 62 105 /*}}}*/ … … 83 126 } 84 127 /*}}}*/ 85 /*FUNCTION BoolExternalResult::Echo {{{1*/86 void BoolExternalResult::Echo(void){87 this->DeepEcho();88 }89 /*}}}*/90 128 /*FUNCTION BoolExternalResult::Enum{{{1*/ 91 129 int BoolExternalResult::Enum(void){ … … 95 133 } 96 134 /*}}}*/ 97 /*FUNCTION BoolExternalResult::Id{{{1*/ 98 int BoolExternalResult::Id(void){ return -1; } 99 /*}}}*/ 100 /*FUNCTION BoolExternalResult::Marshall{{{1*/ 101 void BoolExternalResult::Marshall(char** pmarshalled_dataset){ 102 103 char* marshalled_dataset=NULL; 104 int enum_value=0; 105 106 /*recover marshalled_dataset: */ 107 marshalled_dataset=*pmarshalled_dataset; 108 109 /*get enum value of BoolExternalResult: */ 110 enum_value=BoolExternalResultEnum; 111 112 /*marshall enum: */ 113 memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value); 114 115 /*marshall BoolExternalResult data: */ 116 memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id); 117 memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type); 118 memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value); 119 memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step); 120 memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time); 121 122 *pmarshalled_dataset=marshalled_dataset; 123 } 124 /*}}}*/ 125 /*FUNCTION BoolExternalResult::MarshallSize{{{1*/ 126 int BoolExternalResult::MarshallSize(){ 127 128 return sizeof(value)+ 129 +sizeof(id) 130 +sizeof(enum_type) 131 +sizeof(step) 132 +sizeof(time) 133 +sizeof(int); //sizeof(int) for enum value 134 } 135 /*}}}*/ 136 /*FUNCTION BoolExternalResult::MyRank{{{1*/ 137 int BoolExternalResult::MyRank(void){ 138 extern int my_rank; 139 return my_rank; 140 } 141 /*}}}*/ 142 143 /*Numerics: */ 135 /*FUNCTION BoolExternalResult::copy{{{1*/ 136 Object* BoolExternalResult::copy() { 137 138 return new BoolExternalResult(this->id,this->enum_type,this->value,this->step,this->time); 139 140 } 141 /*}}}*/ 142 143 /*BoolExternalResult management: */ 144 144 /*FUNCTION BoolExternalResult::WriteData(FILE* fid) {{{1*/ 145 145 void BoolExternalResult::WriteData(FILE* fid){
Note:
See TracChangeset
for help on using the changeset viewer.