openModeller  Version 1.5.0
AlgParameter.cpp
Go to the documentation of this file.
1 
30 
31 #include <stdlib.h>
32 #include <string.h>
33 #include <stdio.h>
34 
35 /****************************************************************/
36 /*********************** Om Alg Parameter ***********************/
37 
38 /********************/
39 /*** constructors ***/
40 
42  _id(""),
43  _value("")
44 {
45 
46 }
47 
48 AlgParameter::AlgParameter( std::string const id, std::string const value )
49 {
50  _id = id;
51  _value = value;
52 }
53 
55 {
56  _id = param._id;
57  _value = param._value;
58 }
59 
60 
61 /******************/
62 /*** destructor ***/
63 
65 {
66 
67 }
68 
69 
70 /******************/
71 /*** operator = ***/
74 {
75  if ( this == &param ) {
76 
77  return *this;
78  }
79 
80  _id = param._id;
81  _value = param._value;
82 
83  return *this;
84 }
85 
86 
87 /******************/
88 /*** value Real ***/
89 double
91 {
92  return _value.c_str() ? atof( _value.c_str() ) : 0.0;
93 }
94 
95 
96 /*****************/
97 /*** set Value ***/
98 void
99 AlgParameter::setValue( double value )
100 {
101  char buf[32];
102  sprintf( buf, "%-32.8f", value );
103 
104  _value = std::string(buf);
105 }
106 
107 
108 
void setValue(std::string const val)
Definition: AlgParameter.hh:68
std::string const value() const
Definition: AlgParameter.hh:62
std::string const id() const
Definition: AlgParameter.hh:56
std::string _value
Definition: AlgParameter.hh:74
AlgParameter & operator=(const AlgParameter &)
double valueReal()
std::string _id
Definition: AlgParameter.hh:73