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