Ice Sheet System Model  4.18
Code documentation
Public Member Functions | Private Attributes
GenericParam< P > Class Template Reference

#include <GenericParam.h>

Inheritance diagram for GenericParam< P >:
Param Object

Public Member Functions

 GenericParam (int enumVal)
 
 GenericParam (P Pin, int enumVal)
 
 ~GenericParam ()
 
Paramcopy ()
 
void DeepEcho ()
 
void Echo ()
 
int Id ()
 
void Marshall (char **pmarshalled_data, int *pmarshalled_data_size, int marshall_direction)
 
int ObjectEnum ()
 
P & GetParameterValue ()
 
const P & GetParameterValue () const
 
int InstanceEnum ()
 
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)
 
void SetEnum (int enum_in)
 
void SetValue (bool boolean)
 
void SetValue (int integer)
 
void SetValue (int *intarray, int M)
 
void SetValue (int *intarray, int M, int N)
 
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 (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

myP
 
int myEnumVal
 

Detailed Description

template<class P>
class GenericParam< P >

here we have a class that holds an instance of P but because it should live side by side with the other instances derived from Param it - unfortunately - inherits all the accessors that are useless in this context

Definition at line 26 of file GenericParam.h.

Constructor & Destructor Documentation

◆ GenericParam() [1/2]

template<class P >
GenericParam< P >::GenericParam ( int  enumVal)
inline

Definition at line 34 of file GenericParam.h.

34 : myEnumVal(enumVal){};

◆ GenericParam() [2/2]

template<class P >
GenericParam< P >::GenericParam ( Pin,
int  enumVal 
)
inline

Definition at line 35 of file GenericParam.h.

35 : myP(Pin),myEnumVal(enumVal){};

◆ ~GenericParam()

template<class P >
GenericParam< P >::~GenericParam ( )
inline

Definition at line 36 of file GenericParam.h.

36 {};

Member Function Documentation

◆ copy()

template<class P >
Param* GenericParam< P >::copy ( void  )
inlinevirtual

Implements Param.

Definition at line 41 of file GenericParam.h.

41 { return new GenericParam<P>(*this); };

◆ DeepEcho()

template<class P >
void GenericParam< P >::DeepEcho ( void  )
inlinevirtual

Implements Param.

Definition at line 42 of file GenericParam.h.

42  {
43  _printf_("GenericParam:\n");
44  _printf_(" enum: " << myEnumVal << " (" << EnumToStringx(myEnumVal) << ")\n");
45  _printf_(" value: " << myP << "\n");;
46  }

◆ Echo()

template<class P >
void GenericParam< P >::Echo ( void  )
inlinevirtual

Implements Param.

Definition at line 47 of file GenericParam.h.

47 {DeepEcho();};

◆ Id()

template<class P >
int GenericParam< P >::Id ( void  )
inlinevirtual

Implements Object.

Definition at line 48 of file GenericParam.h.

48 { return -1; };

◆ Marshall()

template<class P >
void GenericParam< P >::Marshall ( char **  pmarshalled_data,
int *  pmarshalled_data_size,
int  marshall_direction 
)
inlinevirtual

Implements Param.

Definition at line 54 of file GenericParam.h.

54  {
55  _printf_(" WARNING: parameter "<<EnumToStringx(this->myEnumVal)<<" is a GenericParam and cannot be marshalled\n");
56  /*Nothing for now*/
57  }

◆ ObjectEnum()

template<class P >
int GenericParam< P >::ObjectEnum ( void  )
inlinevirtual

Implements Param.

Definition at line 58 of file GenericParam.h.

58 {return GenericParamEnum;};

◆ GetParameterValue() [1/17]

template<class P >
P& GenericParam< P >::GetParameterValue ( )
inline

Definition at line 62 of file GenericParam.h.

62 { return myP;}

◆ GetParameterValue() [2/17]

template<class P >
const P& GenericParam< P >::GetParameterValue ( ) const
inline

Definition at line 63 of file GenericParam.h.

63 { return myP;};

◆ InstanceEnum()

template<class P >
int GenericParam< P >::InstanceEnum ( )
inlinevirtual

Implements Param.

Definition at line 64 of file GenericParam.h.

64 {return myEnumVal;}

◆ GetParameterValue() [3/17]

template<class P >
void GenericParam< P >::GetParameterValue ( bool *  pbool)
inlinevirtual

Implements Param.

Definition at line 67 of file GenericParam.h.

67 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a bool");}

◆ GetParameterValue() [4/17]

template<class P >
void GenericParam< P >::GetParameterValue ( int *  pinteger)
inlinevirtual

Implements Param.

Definition at line 68 of file GenericParam.h.

68 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return an integer");}

◆ GetParameterValue() [5/17]

template<class P >
void GenericParam< P >::GetParameterValue ( int **  pintarray,
int *  pM 
)
inlinevirtual

Implements Param.

Definition at line 69 of file GenericParam.h.

69 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return an array of integers");}

◆ GetParameterValue() [6/17]

template<class P >
void GenericParam< P >::GetParameterValue ( int **  pintarray,
int *  pM,
int *  pN 
)
inlinevirtual

Implements Param.

Definition at line 70 of file GenericParam.h.

70 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return an array of integers");}

◆ GetParameterValue() [7/17]

template<class P >
void GenericParam< P >::GetParameterValue ( IssmDouble pIssmDouble)
inlinevirtual

Implements Param.

Definition at line 71 of file GenericParam.h.

71 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a IssmDouble");}

◆ GetParameterValue() [8/17]

template<class P >
void GenericParam< P >::GetParameterValue ( IssmDouble pdouble,
IssmDouble  time 
)
inlinevirtual

Implements Param.

Definition at line 72 of file GenericParam.h.

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

◆ GetParameterValue() [9/17]

template<class P >
void GenericParam< P >::GetParameterValue ( char **  pstring)
inlinevirtual

Implements Param.

Definition at line 73 of file GenericParam.h.

73 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a string");}

◆ GetParameterValue() [10/17]

template<class P >
void GenericParam< P >::GetParameterValue ( char ***  pstringarray,
int *  pM 
)
inlinevirtual

Implements Param.

Definition at line 74 of file GenericParam.h.

74 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a string array");}

◆ GetParameterValue() [11/17]

template<class P >
void GenericParam< P >::GetParameterValue ( IssmDouble **  pIssmDoublearray,
int *  pM 
)
inlinevirtual

Implements Param.

Definition at line 75 of file GenericParam.h.

75 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a IssmDouble array");}

◆ GetParameterValue() [12/17]

template<class P >
void GenericParam< P >::GetParameterValue ( IssmDouble **  pIssmDoublearray,
int *  pM,
int *  pN 
)
inlinevirtual

Implements Param.

Definition at line 76 of file GenericParam.h.

76 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a IssmDouble array");}

◆ GetParameterValue() [13/17]

template<class P >
void GenericParam< P >::GetParameterValue ( IssmDouble ***  parray,
int *  pM,
int **  pmdims,
int **  pndims 
)
inlinevirtual

Implements Param.

Definition at line 77 of file GenericParam.h.

77 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a matrix array");}

◆ GetParameterValue() [14/17]

template<class P >
void GenericParam< P >::GetParameterValue ( Vector< IssmDouble > **  pvec)
inlinevirtual

Implements Param.

Definition at line 78 of file GenericParam.h.

78 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a Vec");}

◆ GetParameterValue() [15/17]

template<class P >
void GenericParam< P >::GetParameterValue ( Matrix< IssmDouble > **  pmat)
inlinevirtual

Implements Param.

Definition at line 79 of file GenericParam.h.

79 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a Mat");}

◆ GetParameterValue() [16/17]

template<class P >
void GenericParam< P >::GetParameterValue ( FILE **  pfid)
inlinevirtual

Implements Param.

Definition at line 80 of file GenericParam.h.

80 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a FILE");}

◆ GetParameterValue() [17/17]

template<class P >
void GenericParam< P >::GetParameterValue ( DataSet **  pdataset)
inlinevirtual

Implements Param.

Definition at line 81 of file GenericParam.h.

81 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a DataSet");}

◆ SetEnum()

template<class P >
void GenericParam< P >::SetEnum ( int  enum_in)
inlinevirtual

Implements Param.

Definition at line 83 of file GenericParam.h.

83 {this->myEnumVal = enum_in;};

◆ SetValue() [1/13]

template<class P >
void GenericParam< P >::SetValue ( bool  boolean)
inlinevirtual

Implements Param.

Definition at line 84 of file GenericParam.h.

84 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a bool");}

◆ SetValue() [2/13]

template<class P >
void GenericParam< P >::SetValue ( int  integer)
inlinevirtual

Implements Param.

Definition at line 85 of file GenericParam.h.

85 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold an integer");}

◆ SetValue() [3/13]

template<class P >
void GenericParam< P >::SetValue ( int *  intarray,
int  M 
)
inlinevirtual

Implements Param.

Definition at line 86 of file GenericParam.h.

86 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold an int array");}

◆ SetValue() [4/13]

template<class P >
void GenericParam< P >::SetValue ( int *  intarray,
int  M,
int  N 
)
inlinevirtual

Implements Param.

Definition at line 87 of file GenericParam.h.

87 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold an int array");}

◆ SetValue() [5/13]

template<class P >
void GenericParam< P >::SetValue ( IssmDouble  scalar)
inlinevirtual

Implements Param.

Definition at line 88 of file GenericParam.h.

88 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold an IssmDouble");}

◆ SetValue() [6/13]

template<class P >
void GenericParam< P >::SetValue ( char *  string)
inlinevirtual

Implements Param.

Definition at line 89 of file GenericParam.h.

89 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a string");}

◆ SetValue() [7/13]

template<class P >
void GenericParam< P >::SetValue ( char **  stringarray,
int  M 
)
inlinevirtual

Implements Param.

Definition at line 90 of file GenericParam.h.

90 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a string array");}

◆ SetValue() [8/13]

template<class P >
void GenericParam< P >::SetValue ( IssmDouble IssmDoublearray,
int  M 
)
inlinevirtual

Implements Param.

Definition at line 91 of file GenericParam.h.

91 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a IssmDouble array");}

◆ SetValue() [9/13]

template<class P >
void GenericParam< P >::SetValue ( IssmDouble pIssmDoublearray,
int  M,
int  N 
)
inlinevirtual

Implements Param.

Definition at line 92 of file GenericParam.h.

92 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a IssmDouble array");}

◆ SetValue() [10/13]

template<class P >
void GenericParam< P >::SetValue ( Vector< IssmDouble > *  vec)
inlinevirtual

Implements Param.

Definition at line 93 of file GenericParam.h.

93 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a Vec");}

◆ SetValue() [11/13]

template<class P >
void GenericParam< P >::SetValue ( Matrix< IssmDouble > *  mat)
inlinevirtual

Implements Param.

Definition at line 94 of file GenericParam.h.

94 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a Mat");}

◆ SetValue() [12/13]

template<class P >
void GenericParam< P >::SetValue ( FILE *  fid)
inlinevirtual

Implements Param.

Definition at line 95 of file GenericParam.h.

95 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a FILE");}

◆ SetValue() [13/13]

template<class P >
void GenericParam< P >::SetValue ( IssmDouble **  array,
int  M,
int *  mdim_array,
int *  ndim_array 
)
inlinevirtual

Implements Param.

Definition at line 96 of file GenericParam.h.

96 {_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold an array of matrices");}

Field Documentation

◆ myP

template<class P >
P GenericParam< P >::myP
private

Definition at line 29 of file GenericParam.h.

◆ myEnumVal

template<class P >
int GenericParam< P >::myEnumVal
private

Definition at line 30 of file GenericParam.h.


The documentation for this class was generated from the following file:
_printf_
#define _printf_(StreamArgs)
Definition: Print.h:22
GenericParam::DeepEcho
void DeepEcho()
Definition: GenericParam.h:42
EnumToStringx
const char * EnumToStringx(int enum_in)
Definition: EnumToStringx.cpp:15
GenericParam::myP
P myP
Definition: GenericParam.h:29
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49
GenericParamEnum
@ GenericParamEnum
Definition: EnumDefinitions.h:1083
GenericParam::myEnumVal
int myEnumVal
Definition: GenericParam.h:30
GenericParam
Definition: GenericParam.h:26