Ice Sheet System Model  4.18
Code documentation
Public Member Functions | Private Attributes
FileParam Class Reference

#include <FileParam.h>

Inheritance diagram for FileParam:
Param Object

Public Member Functions

 FileParam ()
 
 FileParam (int enum_type, FILE *fid)
 
 ~FileParam ()
 
Paramcopy ()
 
void DeepEcho ()
 
void Echo ()
 
int Id ()
 
void Marshall (char **pmarshalled_data, int *pmarshalled_data_size, int marshall_direction)
 
int ObjectEnum ()
 
void GetParameterValue (bool *pbool)
 
void GetParameterValue (int *pinteger)
 
void GetParameterValue (int **pintarray, int *pM)
 
void GetParameterValue (int **pintarray, int *pM, int *pN)
 
void GetParameterValue (IssmDouble *pIssmDouble)
 
void GetParameterValue (IssmDouble *pdouble, IssmDouble time)
 
void GetParameterValue (char **pstring)
 
void GetParameterValue (char ***pstringarray, int *pM)
 
void GetParameterValue (IssmDouble **pIssmDoublearray, int *pM)
 
void GetParameterValue (IssmDouble **pIssmDoublearray, int *pM, int *pN)
 
void GetParameterValue (IssmDouble ***parray, int *pM, int **pmdims, int **pndims)
 
void GetParameterValue (Vector< IssmDouble > **pvec)
 
void GetParameterValue (Matrix< IssmDouble > **pmat)
 
void GetParameterValue (FILE **pfid)
 
void GetParameterValue (DataSet **pdataset)
 
int InstanceEnum ()
 
void SetEnum (int enum_in)
 
void SetValue (bool boolean)
 
void SetValue (int integer)
 
void SetValue (IssmDouble scalar)
 
void SetValue (char *string)
 
void SetValue (char **stringarray, int M)
 
void SetValue (IssmDouble *IssmDoublearray, int M)
 
void SetValue (IssmDouble *pIssmDoublearray, int M, int N)
 
void SetValue (int *intarray, int M)
 
void SetValue (int *pintarray, int M, int N)
 
void SetValue (Vector< IssmDouble > *vec)
 
void SetValue (Matrix< IssmDouble > *mat)
 
void SetValue (FILE *fid)
 
void SetValue (IssmDouble **array, int M, int *mdim_array, int *ndim_array)
 
- Public Member Functions inherited from Param
virtual ~Param ()
 
virtual void GetParameterValue (IssmDouble *pdouble, int row, IssmDouble time)
 
virtual void SetValue (DataSet *dataset)
 
- Public Member Functions inherited from Object
virtual ~Object ()
 

Private Attributes

int enum_type
 
FILE * value
 

Detailed Description

Definition at line 20 of file FileParam.h.

Constructor & Destructor Documentation

◆ FileParam() [1/2]

FileParam::FileParam ( )

Definition at line 18 of file FileParam.cpp.

18  {/*{{{*/
19  return;
20 }

◆ FileParam() [2/2]

FileParam::FileParam ( int  enum_type,
FILE *  fid 
)

Definition at line 22 of file FileParam.cpp.

22  {/*{{{*/
23 
24  enum_type=in_enum_type;
25  value=in_value;
26 }

◆ ~FileParam()

FileParam::~FileParam ( )

Definition at line 28 of file FileParam.cpp.

28  {/*{{{*/
29  return;
30 }

Member Function Documentation

◆ copy()

Param * FileParam::copy ( void  )
virtual

Implements Param.

Definition at line 34 of file FileParam.cpp.

34  {/*{{{*/
35 
36  return new FileParam(this->enum_type,this->value);
37 
38 }

◆ DeepEcho()

void FileParam::DeepEcho ( void  )
virtual

Implements Param.

Definition at line 40 of file FileParam.cpp.

40  {/*{{{*/
41 
42  _printf_(setw(22)<<" FileParam "<<setw(35)<<left<<EnumToStringx(this->enum_type)<<" "<<this->value<<"\n");
43 }

◆ Echo()

void FileParam::Echo ( void  )
virtual

Implements Param.

Definition at line 45 of file FileParam.cpp.

45  {/*{{{*/
46  this->DeepEcho();
47 }

◆ Id()

int FileParam::Id ( void  )
virtual

Implements Object.

Definition at line 49 of file FileParam.cpp.

49 { return -1; }/*{{{*/

◆ Marshall()

void FileParam::Marshall ( char **  pmarshalled_data,
int *  pmarshalled_data_size,
int  marshall_direction 
)
virtual

Implements Param.

Definition at line 51 of file FileParam.cpp.

51  { /*{{{*/
52 
56 
57  if(marshall_direction==MARSHALLING_BACKWARD) value=NULL; //meaningless file pointer!
58 
59 }

◆ ObjectEnum()

int FileParam::ObjectEnum ( void  )
virtual

Implements Param.

Definition at line 61 of file FileParam.cpp.

61  {/*{{{*/
62 
63  return FileParamEnum;
64 
65 }

◆ GetParameterValue() [1/15]

void FileParam::GetParameterValue ( bool *  pbool)
inlinevirtual

Implements Param.

Definition at line 41 of file FileParam.h.

41 { _error_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}

◆ GetParameterValue() [2/15]

void FileParam::GetParameterValue ( int *  pinteger)
inlinevirtual

Implements Param.

Definition at line 42 of file FileParam.h.

42 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}

◆ GetParameterValue() [3/15]

void FileParam::GetParameterValue ( int **  pintarray,
int *  pM 
)
inlinevirtual

Implements Param.

Definition at line 43 of file FileParam.h.

43 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}

◆ GetParameterValue() [4/15]

void FileParam::GetParameterValue ( int **  pintarray,
int *  pM,
int *  pN 
)
inlinevirtual

Implements Param.

Definition at line 44 of file FileParam.h.

44 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}

◆ GetParameterValue() [5/15]

void FileParam::GetParameterValue ( IssmDouble pIssmDouble)
inlinevirtual

Implements Param.

Definition at line 45 of file FileParam.h.

45 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}

◆ GetParameterValue() [6/15]

void FileParam::GetParameterValue ( IssmDouble pdouble,
IssmDouble  time 
)
inlinevirtual

Implements Param.

Definition at line 46 of file FileParam.h.

46 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}

◆ GetParameterValue() [7/15]

void FileParam::GetParameterValue ( char **  pstring)
inlinevirtual

Implements Param.

Definition at line 47 of file FileParam.h.

47 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}

◆ GetParameterValue() [8/15]

void FileParam::GetParameterValue ( char ***  pstringarray,
int *  pM 
)
inlinevirtual

Implements Param.

Definition at line 48 of file FileParam.h.

48 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}

◆ GetParameterValue() [9/15]

void FileParam::GetParameterValue ( IssmDouble **  pIssmDoublearray,
int *  pM 
)
inlinevirtual

Implements Param.

Definition at line 49 of file FileParam.h.

49 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}

◆ GetParameterValue() [10/15]

void FileParam::GetParameterValue ( IssmDouble **  pIssmDoublearray,
int *  pM,
int *  pN 
)
inlinevirtual

Implements Param.

Definition at line 50 of file FileParam.h.

50 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}

◆ GetParameterValue() [11/15]

void FileParam::GetParameterValue ( IssmDouble ***  parray,
int *  pM,
int **  pmdims,
int **  pndims 
)
inlinevirtual

Implements Param.

Definition at line 51 of file FileParam.h.

51 {_error_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}

◆ GetParameterValue() [12/15]

void FileParam::GetParameterValue ( Vector< IssmDouble > **  pvec)
inlinevirtual

Implements Param.

Definition at line 52 of file FileParam.h.

52 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}

◆ GetParameterValue() [13/15]

void FileParam::GetParameterValue ( Matrix< IssmDouble > **  pmat)
inlinevirtual

Implements Param.

Definition at line 53 of file FileParam.h.

53 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}

◆ GetParameterValue() [14/15]

void FileParam::GetParameterValue ( FILE **  pfid)
inlinevirtual

Implements Param.

Definition at line 54 of file FileParam.h.

54 {*pfid=value;};

◆ GetParameterValue() [15/15]

void FileParam::GetParameterValue ( DataSet **  pdataset)
inlinevirtual

Implements Param.

Definition at line 55 of file FileParam.h.

55 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return a DataSet");}

◆ InstanceEnum()

int FileParam::InstanceEnum ( )
inlinevirtual

Implements Param.

Definition at line 56 of file FileParam.h.

56 {return enum_type;}

◆ SetEnum()

void FileParam::SetEnum ( int  enum_in)
inlinevirtual

Implements Param.

Definition at line 58 of file FileParam.h.

58 {this->enum_type = enum_in;};

◆ SetValue() [1/13]

void FileParam::SetValue ( bool  boolean)
inlinevirtual

Implements Param.

Definition at line 59 of file FileParam.h.

59 {_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}

◆ SetValue() [2/13]

void FileParam::SetValue ( int  integer)
inlinevirtual

Implements Param.

Definition at line 60 of file FileParam.h.

60 {_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}

◆ SetValue() [3/13]

void FileParam::SetValue ( IssmDouble  scalar)
inlinevirtual

Implements Param.

Definition at line 61 of file FileParam.h.

61 {_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}

◆ SetValue() [4/13]

void FileParam::SetValue ( char *  string)
inlinevirtual

Implements Param.

Definition at line 62 of file FileParam.h.

62 {_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}

◆ SetValue() [5/13]

void FileParam::SetValue ( char **  stringarray,
int  M 
)
inlinevirtual

Implements Param.

Definition at line 63 of file FileParam.h.

63 {_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}

◆ SetValue() [6/13]

void FileParam::SetValue ( IssmDouble IssmDoublearray,
int  M 
)
inlinevirtual

Implements Param.

Definition at line 64 of file FileParam.h.

64 {_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}

◆ SetValue() [7/13]

void FileParam::SetValue ( IssmDouble pIssmDoublearray,
int  M,
int  N 
)
inlinevirtual

Implements Param.

Definition at line 65 of file FileParam.h.

65 {_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}

◆ SetValue() [8/13]

void FileParam::SetValue ( int *  intarray,
int  M 
)
inlinevirtual

Implements Param.

Definition at line 66 of file FileParam.h.

66 {_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}

◆ SetValue() [9/13]

void FileParam::SetValue ( int *  pintarray,
int  M,
int  N 
)
inlinevirtual

Implements Param.

Definition at line 67 of file FileParam.h.

67 {_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}

◆ SetValue() [10/13]

void FileParam::SetValue ( Vector< IssmDouble > *  vec)
inlinevirtual

Implements Param.

Definition at line 68 of file FileParam.h.

68 {_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}

◆ SetValue() [11/13]

void FileParam::SetValue ( Matrix< IssmDouble > *  mat)
inlinevirtual

Implements Param.

Definition at line 69 of file FileParam.h.

69 {_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}

◆ SetValue() [12/13]

void FileParam::SetValue ( FILE *  fid)
inlinevirtual

Implements Param.

Definition at line 70 of file FileParam.h.

70 {_error_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}

◆ SetValue() [13/13]

void FileParam::SetValue ( IssmDouble **  array,
int  M,
int *  mdim_array,
int *  ndim_array 
)
inlinevirtual

Implements Param.

Definition at line 71 of file FileParam.h.

71 {_error_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an array of matrices");}

Field Documentation

◆ enum_type

int FileParam::enum_type
private

Definition at line 23 of file FileParam.h.

◆ value

FILE* FileParam::value
private

Definition at line 24 of file FileParam.h.


The documentation for this class was generated from the following files:
FileParam::FileParam
FileParam()
Definition: FileParam.cpp:18
_printf_
#define _printf_(StreamArgs)
Definition: Print.h:22
MARSHALLING_ENUM
#define MARSHALLING_ENUM(EN)
Definition: Marshalling.h:14
FileParam::value
FILE * value
Definition: FileParam.h:24
EnumToStringx
const char * EnumToStringx(int enum_in)
Definition: EnumToStringx.cpp:15
MARSHALLING
#define MARSHALLING(FIELD)
Definition: Marshalling.h:29
MARSHALLING_BACKWARD
@ MARSHALLING_BACKWARD
Definition: Marshalling.h:10
FileParam::DeepEcho
void DeepEcho()
Definition: FileParam.cpp:40
FileParam::enum_type
int enum_type
Definition: FileParam.h:23
FileParamEnum
@ FileParamEnum
Definition: EnumDefinitions.h:1065
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49