GeoModel - GeoModelCore
ParameterComposition.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/ParameterComposition.h"
8 #include "GeoGenericFunctions/Parameter.h"
9 #include "GeoGenericFunctions/AbsFunction.h"
10 
11 namespace GeoGenfun {
12 PARAMETER_OBJECT_IMP(ParameterComposition)
13 
14 ParameterComposition::ParameterComposition(const AbsFunction *arg1, const AbsParameter *arg2):
15  AbsParameter(),
16  _arg1(arg1->clone()),
17  _arg2(arg2->clone())
18 {
19  if (arg2->parameter() && _arg2->parameter()) _arg2->parameter()->connectFrom(arg2->parameter());
20 }
21 
22 ParameterComposition::ParameterComposition(const ParameterComposition & right) :
23 AbsParameter(),
24 _arg1(right._arg1->clone()),
25 _arg2(right._arg2->clone())
26 {}
27 
28 
29 ParameterComposition::~ParameterComposition()
30 {
31  delete _arg1;
32  delete _arg2;
33 }
34 
35 
36 double ParameterComposition::getValue() const {
37  return _arg1->operator() (_arg2->getValue());
38 }
39 
40 } // namespace GeoGenfun
Definition: Abs.h:15