source: issm/trunk-jpl/src/c/classes/objects/Params/VectorParam.cpp@ 14996

Last change on this file since 14996 was 14996, checked in by Eric.Larour, 12 years ago

CHG: integrated Container/ directory into src/c/classes/objects directory. No reason to have the containers
and the objects that they contain defined in different places.

File size: 2.4 KB
Line 
1/*!\file VectorParam.c
2 * \brief: implementation of the VectorParam 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 "../../../shared/shared.h"
17/*}}}*/
18
19/*VectorParam constructors and destructor*/
20/*FUNCTION VectorParam::VectorParam(){{{*/
21VectorParam::VectorParam(){
22 return;
23}
24/*}}}*/
25/*FUNCTION VectorParam::VectorParam(int enum_type,IssmVector value){{{*/
26VectorParam::VectorParam(int in_enum_type,Vector<IssmDouble>* in_value){
27
28 enum_type=in_enum_type;
29
30 value=NULL;
31
32 if(in_value){
33 value=in_value->Duplicate();
34 in_value->Copy(value);
35 }
36}
37/*}}}*/
38/*FUNCTION VectorParam::~VectorParam(){{{*/
39VectorParam::~VectorParam(){
40 delete value;
41}
42/*}}}*/
43
44/*Object virtual functions definitions:*/
45/*FUNCTION VectorParam::Echo {{{*/
46void VectorParam::Echo(void){
47
48 _printLine_("VectorParam:");
49 _printLine_(" enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
50
51}
52/*}}}*/
53/*FUNCTION VectorParam::DeepEcho{{{*/
54void VectorParam::DeepEcho(void){
55
56 _printLine_("VectorParam:");
57 _printLine_(" enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
58 value->Echo();
59}
60/*}}}*/
61/*FUNCTION VectorParam::Id{{{*/
62int VectorParam::Id(void){ return -1; }
63/*}}}*/
64/*FUNCTION VectorParam::ObjectEnum{{{*/
65int VectorParam::ObjectEnum(void){
66
67 return VectorParamEnum;
68
69}
70/*}}}*/
71/*FUNCTION VectorParam::copy{{{*/
72Object* VectorParam::copy() {
73
74 return new VectorParam(this->enum_type,this->value);
75
76}
77/*}}}*/
78
79/*VectorParam virtual functions definitions: */
80/*FUNCTION VectorParam::GetParameterValue{{{*/
81void VectorParam::GetParameterValue(Vector<IssmDouble>** poutput){
82 Vector<IssmDouble>* output=NULL;
83
84 if(value){
85 output=value->Duplicate();
86 value->Copy(output);
87 }
88 *poutput=output;
89}
90/*}}}*/
91/*FUNCTION VectorParam::GetParameterName{{{*/
92void VectorParam::GetParameterName(char**pname){
93 EnumToStringx(pname,this->enum_type);
94}
95/*}}}*/
96/*FUNCTION VectorParam::SetValue{{{*/
97void VectorParam::SetValue(Vector<IssmDouble>* vector){
98
99 /*avoid leak: */
100 delete value;
101
102 /*copy: */
103 value=vector->Duplicate();
104 vector->Copy(value);
105}
106/*}}}*/
107/*FUNCTION VectorParam::UnitConversion{{{*/
108void VectorParam::UnitConversion(int direction_enum){
109 /*do nothing, no unit conversion*/
110}
111/*}}}*/
Note: See TracBrowser for help on using the repository browser.