source: issm/trunk/src/c/objects/Params/BoolParam.h@ 9356

Last change on this file since 9356 was 9356, checked in by Eric.Larour, 14 years ago

Major rewrite of the code so that IoModel now has a parameters dataset, which gets
loaded with all the int,char and double objects in the input file.
This is a lot more flexible, as anyone can add a field to the model, and it will
automatically appear in the IoModel parameters dataset.

Not debugged with respect to nightly runs yet. Trying to get the whole change finished.

File size: 4.6 KB
RevLine 
[3683]1/*! \file BoolParam.h
2 * \brief: header file for triavertexinput object
3 */
4
5
6#ifndef _BOOLPARAM_H_
7#define _BOOLPARAM_H_
8
9/*Headers:*/
10/*{{{1*/
[3715]11#ifdef HAVE_CONFIG_H
[9320]12 #include <config.h>
[3715]13#else
14#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
15#endif
16
17#ifdef _SERIAL_
18#include <mex.h>
19#endif
20
[3683]21#include "./Param.h"
[3775]22#include "../../include/include.h"
[3683]23#include "../../shared/shared.h"
24/*}}}*/
25
26class BoolParam: public Param{
27
[3751]28 public:
[3683]29 /*just hold 3 values for 3 vertices: */
30 int enum_type;
31 IssmBool value;
32
[4248]33 /*BoolParam constructors, destructors: {{{1*/
[3683]34 BoolParam();
35 BoolParam(int enum_type,IssmBool value);
36 ~BoolParam();
37 /*}}}*/
[4248]38 /*Object virtual functions definitions:{{{1 */
39 void Echo();
[3683]40 void DeepEcho();
[4248]41 int Id();
42 int MyRank();
43 void Marshall(char** pmarshalled_dataset);
44 int MarshallSize();
[3683]45 void Demarshall(char** pmarshalled_dataset);
46 int Enum();
[4248]47 Object* copy();
[3683]48 /*}}}*/
[4248]49 /*Param vritual function definitions: {{{1*/
[3683]50 int EnumType(){return enum_type;}
51 void GetParameterValue(bool* pbool){*pbool=value;}
[8224]52 void GetParameterValue(int* pinteger){_error_("Bool param of enum %i (%s) cannot return an integer",enum_type,EnumToStringx(enum_type));}
53 void GetParameterValue(int** pintarray,int* pM){_error_("Bool param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));}
[8600]54 void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Bool param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));}
[8224]55 void GetParameterValue(double* pdouble){_error_("Bool param of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}
56 void GetParameterValue(char** pstring){_error_("Bool param of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));}
57 void GetParameterValue(char*** pstringarray,int* pM){_error_("Bool param of enum %i (%s) cannot return a string arrayl",enum_type,EnumToStringx(enum_type));}
58 void GetParameterValue(double** pdoublearray,int* pM){_error_("Bool param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
59 void GetParameterValue(double** pdoublearray,int* pM, int* pN){_error_("Bool param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
60 void GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){_error_("Bool param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}
61 void GetParameterValue(Vec* pvec){_error_("Bool param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));}
62 void GetParameterValue(Mat* pmat){_error_("Bool param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));}
63 void GetParameterValue(FILE** pfid){_error_("Bool param of enum %i (%s) cannot return a FILE",enum_type,EnumToStringx(enum_type));}
[4059]64
65 void SetValue(bool boolean){this->value=boolean;}
66 void SetValue(int integer){this->value=(bool)integer;}
67 void SetValue(double scalar){this->value=(bool)scalar;}
[8224]68 void SetValue(char* string){_error_("Bool param of enum %i (%s) cannot hold a string",enum_type,EnumToStringx(enum_type));}
69 void SetValue(char** stringarray,int M){_error_("Bool param of enum %i (%s) cannot hold a string array",enum_type,EnumToStringx(enum_type));}
70 void SetValue(double* doublearray,int M){_error_("Bool param of enum %i (%s) cannot hold a double array",enum_type,EnumToStringx(enum_type));}
71 void SetValue(double* pdoublearray,int M,int N){_error_("Bool param of enum %i (%s) cannot hold a double array",enum_type,EnumToStringx(enum_type));}
[8600]72 void SetValue(int* intarray,int M){_error_("Bool param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));}
73 void SetValue(int* pintarray,int M,int N){_error_("Bool param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));}
[8224]74 void SetValue(Vec vec){_error_("Bool param of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));}
75 void SetValue(Mat mat){_error_("Bool param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));}
76 void SetValue(FILE* fid){_error_("Bool param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
77 void SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("Bool param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
[9356]78 void UnitConversion(int direction_enum);
[4059]79
[3683]80 char* GetParameterName(void);
[3715]81 #ifdef _SERIAL_
[3683]82 void SetMatlabField(mxArray* dataref);
[3715]83 #endif
[3683]84 /*}}}*/
85};
86#endif /* _BOOLPARAM_H */
Note: See TracBrowser for help on using the repository browser.