1 | /*!\file IntParam.c
|
---|
2 | * \brief: implementation of the IntParam object
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*header files: */
|
---|
6 | /*{{{*/
|
---|
7 | #ifdef HAVE_CONFIG_H
|
---|
8 | #include <config.h>
|
---|
9 | #else
|
---|
10 | #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
|
---|
11 | #endif
|
---|
12 |
|
---|
13 | #include <stdio.h>
|
---|
14 | #include <string.h>
|
---|
15 | #include "../objects.h"
|
---|
16 | #include "../../../EnumDefinitions/EnumDefinitions.h"
|
---|
17 | #include "../../../shared/shared.h"
|
---|
18 | #include "../../../Container/Container.h"
|
---|
19 | #include "../../../include/include.h"
|
---|
20 | /*}}}*/
|
---|
21 |
|
---|
22 | /*IntParam constructors and destructor*/
|
---|
23 | /*FUNCTION IntParam::IntParam(){{{*/
|
---|
24 | IntParam::IntParam(){
|
---|
25 | return;
|
---|
26 | }
|
---|
27 | /*}}}*/
|
---|
28 | /*FUNCTION IntParam::IntParam(int enum_type,IssmInt value){{{*/
|
---|
29 | IntParam::IntParam(int in_enum_type,IssmInt in_value){
|
---|
30 |
|
---|
31 | enum_type=in_enum_type;
|
---|
32 | value=in_value;
|
---|
33 | }
|
---|
34 | /*}}}*/
|
---|
35 | /*FUNCTION IntParam::~IntParam(){{{*/
|
---|
36 | IntParam::~IntParam(){
|
---|
37 | return;
|
---|
38 | }
|
---|
39 | /*}}}*/
|
---|
40 |
|
---|
41 | /*Object virtual functions definitions:*/
|
---|
42 | /*FUNCTION IntParam::Echo {{{*/
|
---|
43 | void IntParam::Echo(void){
|
---|
44 | this->DeepEcho();
|
---|
45 | }
|
---|
46 | /*}}}*/
|
---|
47 | /*FUNCTION IntParam::DeepEcho{{{*/
|
---|
48 | void IntParam::DeepEcho(void){
|
---|
49 |
|
---|
50 | _printLine_("IntParam:");
|
---|
51 | _printLine_(" enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
|
---|
52 | _printLine_(" value: " << this->value);
|
---|
53 | }
|
---|
54 | /*}}}*/
|
---|
55 | /*FUNCTION IntParam::Id{{{*/
|
---|
56 | int IntParam::Id(void){ return -1; }
|
---|
57 | /*}}}*/
|
---|
58 | /*FUNCTION IntParam::MyRank{{{*/
|
---|
59 | int IntParam::MyRank(void){
|
---|
60 | extern int my_rank;
|
---|
61 | return my_rank;
|
---|
62 | }
|
---|
63 | /*}}}*/
|
---|
64 | /*FUNCTION IntParam::ObjectEnum{{{*/
|
---|
65 | int IntParam::ObjectEnum(void){
|
---|
66 |
|
---|
67 | return IntParamEnum;
|
---|
68 |
|
---|
69 | }
|
---|
70 | /*}}}*/
|
---|
71 | /*FUNCTION IntParam::copy{{{*/
|
---|
72 | Object* IntParam::copy() {
|
---|
73 |
|
---|
74 | return new IntParam(this->enum_type,this->value);
|
---|
75 |
|
---|
76 | }
|
---|
77 | /*}}}*/
|
---|
78 |
|
---|
79 | /*IntParam virtual functions definitions: */
|
---|
80 | /*FUNCTION IntParam::GetParameterName{{{*/
|
---|
81 | void IntParam::GetParameterName(char**pname){
|
---|
82 | EnumToStringx(pname,this->enum_type);
|
---|
83 | }
|
---|
84 | /*}}}*/
|
---|
85 | /*FUNCTION IntParam::UnitConversion{{{*/
|
---|
86 | void IntParam::UnitConversion(int direction_enum){
|
---|
87 | /*do nothing, no unit conversion*/
|
---|
88 | }
|
---|
89 | /*}}}*/
|
---|