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 | /*}}}*/
|
---|
20 |
|
---|
21 | /*IntParam constructors and destructor*/
|
---|
22 | /*FUNCTION IntParam::IntParam(){{{*/
|
---|
23 | IntParam::IntParam(){
|
---|
24 | return;
|
---|
25 | }
|
---|
26 | /*}}}*/
|
---|
27 | /*FUNCTION IntParam::IntParam(int enum_type,IssmInt value){{{*/
|
---|
28 | IntParam::IntParam(int in_enum_type,IssmInt in_value){
|
---|
29 |
|
---|
30 | enum_type=in_enum_type;
|
---|
31 | value=in_value;
|
---|
32 | }
|
---|
33 | /*}}}*/
|
---|
34 | /*FUNCTION IntParam::~IntParam(){{{*/
|
---|
35 | IntParam::~IntParam(){
|
---|
36 | return;
|
---|
37 | }
|
---|
38 | /*}}}*/
|
---|
39 |
|
---|
40 | /*Object virtual functions definitions:*/
|
---|
41 | /*FUNCTION IntParam::Echo {{{*/
|
---|
42 | void IntParam::Echo(void){
|
---|
43 | this->DeepEcho();
|
---|
44 | }
|
---|
45 | /*}}}*/
|
---|
46 | /*FUNCTION IntParam::DeepEcho{{{*/
|
---|
47 | void IntParam::DeepEcho(void){
|
---|
48 |
|
---|
49 | _printLine_("IntParam:");
|
---|
50 | _printLine_(" enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
|
---|
51 | _printLine_(" value: " << this->value);
|
---|
52 | }
|
---|
53 | /*}}}*/
|
---|
54 | /*FUNCTION IntParam::Id{{{*/
|
---|
55 | int IntParam::Id(void){ return -1; }
|
---|
56 | /*}}}*/
|
---|
57 | /*FUNCTION IntParam::ObjectEnum{{{*/
|
---|
58 | int IntParam::ObjectEnum(void){
|
---|
59 |
|
---|
60 | return IntParamEnum;
|
---|
61 |
|
---|
62 | }
|
---|
63 | /*}}}*/
|
---|
64 | /*FUNCTION IntParam::copy{{{*/
|
---|
65 | Object* IntParam::copy() {
|
---|
66 |
|
---|
67 | return new IntParam(this->enum_type,this->value);
|
---|
68 |
|
---|
69 | }
|
---|
70 | /*}}}*/
|
---|
71 |
|
---|
72 | /*IntParam virtual functions definitions: */
|
---|
73 | /*FUNCTION IntParam::GetParameterName{{{*/
|
---|
74 | void IntParam::GetParameterName(char**pname){
|
---|
75 | EnumToStringx(pname,this->enum_type);
|
---|
76 | }
|
---|
77 | /*}}}*/
|
---|
78 | /*FUNCTION IntParam::UnitConversion{{{*/
|
---|
79 | void IntParam::UnitConversion(int direction_enum){
|
---|
80 | /*do nothing, no unit conversion*/
|
---|
81 | }
|
---|
82 | /*}}}*/
|
---|