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