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