GeoModel - GeoModelCore
ParameterSum.cpp
1 //==========================================================================//
2 // Imported from the QAT library (qat.pitt.edu) by the copyright holder //
3 // Joe Boudreau. Software licensed under the terms and conditions of the //
4 // GNU Lesser Public License v3. //
5 //==========================================================================//
6 
7 #include "GeoGenericFunctions/ParameterSum.h"
8 #include "GeoGenericFunctions/Parameter.h"
9 
10 namespace GeoGenfun {
11 PARAMETER_OBJECT_IMP(ParameterSum)
12 
13 ParameterSum::ParameterSum(const AbsParameter *arg1, const AbsParameter *arg2):
14  _arg1(arg1->clone()),
15  _arg2(arg2->clone())
16 {
17  if (arg1->parameter() && _arg1->parameter()) _arg1->parameter()->connectFrom(arg1->parameter());
18  if (arg2->parameter() && _arg2->parameter()) _arg2->parameter()->connectFrom(arg2->parameter());
19 }
20 
21 ParameterSum::ParameterSum(const ParameterSum & right) :
22 AbsParameter(),
23 _arg1(right._arg1->clone()),
24 _arg2(right._arg2->clone())
25 {}
26 
27 
28 ParameterSum::~ParameterSum()
29 {
30  delete _arg1;
31  delete _arg2;
32 }
33 
34 
35 double ParameterSum::getValue() const {
36  return _arg1->getValue()+_arg2->getValue();
37 }
38 
39 } // namespace GeoGenfun
Definition: Abs.h:15