Changeset 8535


Ignore:
Timestamp:
06/07/11 15:31:43 (14 years ago)
Author:
jschierm
Message:

Option objects: Added Get methods to OptionCell and OptionStruct, among other minor changes.

Location:
issm/trunk/src/c/objects/Options
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Options/Option.h

    r7825 r8535  
    11/*! \file Option.h
    2  *  \brief: header file for optionsobject abstract object
     2 *  \brief: header file for option abstract object
    33 */
    44
    5 #ifndef _OPTIONSOBJECT_H_
    6 #define _OPTIONSOBJECT_H_
     5#ifndef _OPTIONOBJECT_H_
     6#define _OPTIONOBJECT_H_
    77
    88/*Headers:{{{1*/
     
    4949                virtual void  Get(char** pvalue)=0;
    5050                virtual void  Get(double** pvalue,int *pnumel)=0;
     51                virtual void  Get(Options** pvalue)=0;
     52                virtual void  Get(Options*** pvalue,int *pnumel)=0;
    5153
    5254};
    53 #endif  /* _OPTIONSOBJECT_H */
     55#endif  /* _OPTIONOBJECT_H */
    5456
  • issm/trunk/src/c/objects/Options/OptionCell.cpp

    r8529 r8535  
    118118}
    119119/*}}}*/
    120 /*FUNCTION OptionCell::Get {{{1*/
    121 //void* OptionCell::Get(){
     120/*FUNCTION OptionCell::Get(Options** pvalue) {{{1*/
     121void OptionCell::Get(Options** pvalue){
    122122
    123 //      ;
    124 
    125 //      return;
    126 //}
     123        /*Assign output pointer*/
     124        *pvalue=this->values;
     125}
    127126/*}}}*/
  • issm/trunk/src/c/objects/Options/OptionCell.h

    r7760 r8535  
    11/*! \file OptionCell.h
    2  *  \brief: header file for optionscell object
     2 *  \brief: header file for optioncell object
    33 */
    44
    5 #ifndef _OPTIONSCELL_H_
    6 #define _OPTIONSCELL_H_
     5#ifndef _OPTIONCELL_H_
     6#define _OPTIONCELL_H_
    77
    88/*Headers:{{{1*/
     
    4646                void  Get(char** pvalue){ _error_("An OptionCell object cannot return a string");};
    4747                void  Get(double** pvalue,int *pnumel){ _error_("An OptionCell object cannot return a double vec");};
     48                void  Get(Options** pvalue);
     49                void  Get(Options*** pvalue,int *pnumel){ _error_("An OptionCell object cannot return an Options DataSet vec");};
    4850
    4951};
    50 #endif  /* _OPTIONSCELL_H */
     52#endif  /* _OPTIONCELL_H */
    5153
  • issm/trunk/src/c/objects/Options/OptionChar.h

    r7760 r8535  
    11/*! \file OptionChar.h
    2  *  \brief: header file for optionschar object
     2 *  \brief: header file for optionchar object
    33 */
    44
    5 #ifndef _OPTIONSCHAR_H_
    6 #define _OPTIONSCHAR_H_
     5#ifndef _OPTIONCHAR_H_
     6#define _OPTIONCHAR_H_
    77
    88/*Headers:{{{1*/
     
    4646                void  Get(char** pvalue);
    4747                void  Get(double** pvalue,int *pnumel){ _error_("An OptionChar object cannot return a double vec");};
     48                void  Get(Options** pvalue){ _error_("An OptionChar object cannot return an Options DataSet");};
     49                void  Get(Options*** pvalue,int *pnumel){ _error_("An OptionChar object cannot return an Options DataSet vec");};
    4850
    4951};
    50 #endif  /* _OPTIONSCHAR_H */
     52#endif  /* _OPTIONCHAR_H */
    5153
  • issm/trunk/src/c/objects/Options/OptionDouble.cpp

    r7760 r8535  
    134134void OptionDouble::Get(double** pvalue,int* numel){
    135135
    136         /*We should first check that the size is one*/
     136        /*We should first check that the size is at least one*/
    137137        if(this->NumEl()<=0){
    138138                _error_("option \"%s\" is empty and cannot return a double vector",this->name);
  • issm/trunk/src/c/objects/Options/OptionDouble.h

    r7760 r8535  
    11/*! \file OptionDouble.h
    2  *  \brief: header file for optionsdouble object
     2 *  \brief: header file for optiondouble object
    33 */
    44
    5 #ifndef _OPTIONSDOUBLE_H_
    6 #define _OPTIONSDOUBLE_H_
     5#ifndef _OPTIONDOUBLE_H_
     6#define _OPTIONDOUBLE_H_
    77
    88/*Headers:{{{1*/
     
    4646                void  Get(char** pvalue){ _error_("An OptionDouble object cannot return a string");};
    4747                void  Get(double** pvalue,int* pnumel);
     48                void  Get(Options** pvalue){ _error_("An OptionDouble object cannot return an Options DataSet");};
     49                void  Get(Options*** pvalue,int *pnumel){ _error_("An OptionDouble object cannot return an Options DataSet vec");};
    4850
    4951};
    50 #endif  /* _OPTIONSDOUBLE_H */
     52#endif  /* _OPTIONDOUBLE_H */
    5153
  • issm/trunk/src/c/objects/Options/OptionLogical.h

    r7760 r8535  
    11/*! \file OptionLogical.h
    2  *  \brief: header file for optionslogical object
     2 *  \brief: header file for optionlogical object
    33 */
    44
    5 #ifndef _OPTIONSLOGICAL_H_
    6 #define _OPTIONSLOGICAL_H_
     5#ifndef _OPTIONLOGICAL_H_
     6#define _OPTIONLOGICAL_H_
    77
    88/*Headers:{{{1*/
     
    4646                void  Get(char** pvalue){ _error_("An OptionLogical object cannot return a string");};
    4747                void  Get(double** pvalue,int *pnumel){ _error_("An OptionLogical object cannot return a double vec");};
     48                void  Get(Options** pvalue){ _error_("An OptionLogical object cannot return an Options DataSet");};
     49                void  Get(Options*** pvalue,int *pnumel){ _error_("An OptionLogical object cannot return an Options DataSet vec");};
    4850
    4951};
    50 #endif  /* _OPTIONSLOGICAL_H */
     52#endif  /* _OPTIONLOGICAL_H */
    5153
  • issm/trunk/src/c/objects/Options/OptionStruct.cpp

    r8529 r8535  
    126126}
    127127/*}}}*/
    128 /*FUNCTION OptionStruct::Get {{{1*/
    129 //void* OptionStruct::Get(){
     128/*FUNCTION OptionStruct::Get(Options** pvalue) {{{1*/
     129void OptionStruct::Get(Options** pvalue){
    130130
    131 //      ;
     131        /*We should first check that the size is one*/
     132        if(this->NumEl()!=1){
     133                _error_("option \"%s\" has %i elements and cannot return a single options dataset",this->name,this->NumEl());
     134        }
    132135
    133 //      return;
    134 //}
     136        /*Assign output pointer*/
     137        *pvalue=this->values[0];
     138}
    135139/*}}}*/
     140/*FUNCTION OptionStruct::Get(Options*** pvalue,int* numel) {{{1*/
     141void OptionStruct::Get(Options*** pvalue,int* numel){
     142
     143        /*We should first check that the size is at least one*/
     144        if(this->NumEl()<=0){
     145                _error_("option \"%s\" is empty and cannot return an options dataset vector",this->name);
     146        }
     147
     148        /*Assign output pointer*/
     149        *pvalue=this->values;
     150        if(numel) *numel=this->NumEl();
     151}
     152/*}}}*/
  • issm/trunk/src/c/objects/Options/OptionStruct.h

    r7760 r8535  
    11/*! \file OptionStruct.h
    2  *  \brief: header file for optionsstruct object
     2 *  \brief: header file for optionstruct object
    33 */
    44
    5 #ifndef _OPTIONSSTRUCT_H_
    6 #define _OPTIONSSTRUCT_H_
     5#ifndef _OPTIONSTRUCT_H_
     6#define _OPTIONSTRUCT_H_
    77
    88/*Headers:{{{1*/
     
    4646                void  Get(char** pvalue){ _error_("An OptionStruct object cannot return a string");};
    4747                void  Get(double** pvalue,int *pnumel){ _error_("An OptionStruct object cannot return a double vec");};
     48                void  Get(Options** pvalue);
     49                void  Get(Options*** pvalue,int *pnumel);
    4850
    4951};
    50 #endif  /* _OPTIONSSTRUCT_H */
     52#endif  /* _OPTIONSTRUCT_H */
    5153
  • issm/trunk/src/c/objects/Options/OptionUtilities.h

    r7739 r8535  
    11/*! \file OptionUtilities.h
    2  *  \brief: header file for options utilities
     2 *  \brief: header file for option object utilities
    33 */
    44
    5 #ifndef _OPTIONSUTILITIES_H_
    6 #define _OPTIONSUTILITIES_H_
     5#ifndef _OPTIONUTILITIES_H_
     6#define _OPTIONUTILITIES_H_
    77
    88/*Headers:{{{1*/
     
    2121int StringFromSize(char* cstr, int* size, int ndims);
    2222
    23 #endif  /* _OPTIONSUTILITIES_H */
     23#endif  /* _OPTIONUTILITIES_H */
    2424
Note: See TracChangeset for help on using the changeset viewer.