Ignore:
Timestamp:
06/26/10 12:30:21 (15 years ago)
Author:
Eric.Larour
Message:

Better organization of header files for abstract classes and their derivatives

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.cpp

    r4236 r4248  
    2020/*}}}*/
    2121
    22 /*Object constructors and destructor*/
     22/*BoolExternalResult constructors and destructor*/
    2323/*FUNCTION BoolExternalResult::BoolExternalResult(){{{1*/
    2424BoolExternalResult::BoolExternalResult(){
     
    4242/*}}}*/
    4343
    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*/
     46void BoolExternalResult::Echo(void){
     47        this->DeepEcho();
    5048}
    5149/*}}}*/
     
    5957        printf("   step: %i\n",this->step);
    6058        printf("   time: %g\n",this->time);
     59}
     60/*}}}*/
     61/*FUNCTION BoolExternalResult::Id{{{1*/
     62int    BoolExternalResult::Id(void){ return -1; }
     63/*}}}*/
     64/*FUNCTION BoolExternalResult::MyRank{{{1*/
     65int    BoolExternalResult::MyRank(void){
     66        extern int my_rank;
     67        return my_rank;
     68}
     69/*}}}*/
     70/*FUNCTION BoolExternalResult::Marshall{{{1*/
     71void  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*/
     96int   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
    61104}
    62105/*}}}*/
     
    83126}
    84127/*}}}*/
    85 /*FUNCTION BoolExternalResult::Echo {{{1*/
    86 void BoolExternalResult::Echo(void){
    87         this->DeepEcho();
    88 }
    89 /*}}}*/
    90128/*FUNCTION BoolExternalResult::Enum{{{1*/
    91129int BoolExternalResult::Enum(void){
     
    95133}
    96134/*}}}*/
    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*/
     136Object* 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: */
    144144/*FUNCTION BoolExternalResult::WriteData(FILE* fid) {{{1*/
    145145void   BoolExternalResult::WriteData(FILE* fid){
Note: See TracChangeset for help on using the changeset viewer.