Ice Sheet System Model  4.18
Code documentation
BoolParam.h
Go to the documentation of this file.
1 
5 #ifndef _BOOLPARAM_H_
6 #define _BOOLPARAM_H_
7 
8 /*Headers:*/
9 /*{{{*/
10 #ifdef HAVE_CONFIG_H
11  #include <config.h>
12 #else
13 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
14 #endif
15 
16 #include "./Param.h"
17 #include "../../shared/shared.h"
18 /*}}}*/
19 
20 class BoolParam: public Param{
21 
22  public:
23  /*just hold 3 values for 3 vertices: */
24  int enum_type;
25  bool value;
26 
27  /*BoolParam constructors, destructors: {{{*/
28  BoolParam();
29  BoolParam(int enum_type,bool value);
30  ~BoolParam();
31  /*}}}*/
32  /*Object virtual functions definitions:{{{ */
33  Param* copy();
34  void DeepEcho();
35  void Echo();
36  int Id();
37  void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
38  int ObjectEnum();
39  /*}}}*/
40  /*Param vritual function definitions: {{{*/
41  void GetParameterValue(bool* pbool){*pbool=value;}
42  void GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}
43  void GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
44  void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}
45  void GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}
46  void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
47  void GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
48  void GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
49  void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
50  void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
51  void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
52  void GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
53  void GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
54  void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
55  void GetParameterValue(DataSet** pdataset){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a DataSet");}
56  int InstanceEnum(){return enum_type;}
57 
58  void SetEnum(int enum_in){this->enum_type = enum_in;};
59  void SetValue(bool boolean){this->value=boolean;}
60  void SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an int");}
61  void SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an IssmPDouble");}
62  void SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
63  void SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
64  void SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
65  void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
66  void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
67  void SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
68  void SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
69  void SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
70  void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
71  void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
72  /*}}}*/
73 };
74 #endif /* _BOOLPARAM_H */
Matrix< IssmDouble >
BoolParam::GetParameterValue
void GetParameterValue(IssmDouble ***parray, int *pM, int **pmdims, int **pndims)
Definition: BoolParam.h:51
BoolParam::SetValue
void SetValue(bool boolean)
Definition: BoolParam.h:59
BoolParam::SetValue
void SetValue(IssmDouble *IssmDoublearray, int M)
Definition: BoolParam.h:64
IssmDouble
double IssmDouble
Definition: types.h:37
Param
Definition: Param.h:21
BoolParam::SetValue
void SetValue(int *pintarray, int M, int N)
Definition: BoolParam.h:67
BoolParam::Marshall
void Marshall(char **pmarshalled_data, int *pmarshalled_data_size, int marshall_direction)
Definition: BoolParam.cpp:50
BoolParam::SetValue
void SetValue(char **stringarray, int M)
Definition: BoolParam.h:63
BoolParam::Id
int Id()
Definition: BoolParam.cpp:48
BoolParam::SetValue
void SetValue(IssmDouble scalar)
Definition: BoolParam.h:61
BoolParam::GetParameterValue
void GetParameterValue(char **pstring)
Definition: BoolParam.h:47
BoolParam::InstanceEnum
int InstanceEnum()
Definition: BoolParam.h:56
BoolParam::GetParameterValue
void GetParameterValue(int *pinteger)
Definition: BoolParam.h:42
BoolParam::GetParameterValue
void GetParameterValue(DataSet **pdataset)
Definition: BoolParam.h:55
BoolParam::DeepEcho
void DeepEcho()
Definition: BoolParam.cpp:40
BoolParam::GetParameterValue
void GetParameterValue(IssmDouble *pdouble, IssmDouble time)
Definition: BoolParam.h:46
BoolParam::BoolParam
BoolParam()
Definition: BoolParam.cpp:18
BoolParam::GetParameterValue
void GetParameterValue(bool *pbool)
Definition: BoolParam.h:41
BoolParam::GetParameterValue
void GetParameterValue(int **pintarray, int *pM)
Definition: BoolParam.h:43
BoolParam::Echo
void Echo()
Definition: BoolParam.cpp:44
BoolParam::GetParameterValue
void GetParameterValue(FILE **pfid)
Definition: BoolParam.h:54
BoolParam::GetParameterValue
void GetParameterValue(IssmDouble **pIssmDoublearray, int *pM)
Definition: BoolParam.h:49
BoolParam::SetValue
void SetValue(int integer)
Definition: BoolParam.h:60
BoolParam::GetParameterValue
void GetParameterValue(IssmDouble *pIssmDouble)
Definition: BoolParam.h:45
BoolParam::SetValue
void SetValue(IssmDouble *pIssmDoublearray, int M, int N)
Definition: BoolParam.h:65
BoolParam::GetParameterValue
void GetParameterValue(IssmDouble **pIssmDoublearray, int *pM, int *pN)
Definition: BoolParam.h:50
EnumToStringx
const char * EnumToStringx(int enum_in)
Definition: EnumToStringx.cpp:15
BoolParam::value
bool value
Definition: BoolParam.h:25
BoolParam::copy
Param * copy()
Definition: BoolParam.cpp:34
Param.h
abstract class for Param object
BoolParam::enum_type
int enum_type
Definition: BoolParam.h:24
BoolParam::SetValue
void SetValue(IssmDouble **array, int M, int *mdim_array, int *ndim_array)
Definition: BoolParam.h:71
BoolParam::~BoolParam
~BoolParam()
Definition: BoolParam.cpp:28
BoolParam::SetValue
void SetValue(char *string)
Definition: BoolParam.h:62
BoolParam::GetParameterValue
void GetParameterValue(Vector< IssmDouble > **pvec)
Definition: BoolParam.h:52
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49
BoolParam::GetParameterValue
void GetParameterValue(Matrix< IssmDouble > **pmat)
Definition: BoolParam.h:53
BoolParam::SetEnum
void SetEnum(int enum_in)
Definition: BoolParam.h:58
BoolParam::GetParameterValue
void GetParameterValue(char ***pstringarray, int *pM)
Definition: BoolParam.h:48
BoolParam::SetValue
void SetValue(Vector< IssmDouble > *vec)
Definition: BoolParam.h:68
BoolParam::ObjectEnum
int ObjectEnum()
Definition: BoolParam.cpp:59
BoolParam
Definition: BoolParam.h:20
DataSet
Declaration of DataSet class.
Definition: DataSet.h:14
BoolParam::SetValue
void SetValue(FILE *fid)
Definition: BoolParam.h:70
Vector< IssmDouble >
BoolParam::GetParameterValue
void GetParameterValue(int **pintarray, int *pM, int *pN)
Definition: BoolParam.h:44
BoolParam::SetValue
void SetValue(int *intarray, int M)
Definition: BoolParam.h:66
BoolParam::SetValue
void SetValue(Matrix< IssmDouble > *mat)
Definition: BoolParam.h:69