1 // File: AdvApprox_EvaluatorFunction.hxx
2 // Created: Mon May 29 17:04:50 1995
3 // Author: Xavier BENVENISTE
6 #ifndef _Standard_Integer_HeaderFile
7 #include <Standard_Integer.hxx>
9 #ifndef _Standard_Real_HeaderFile
10 #include <Standard_Real.hxx>
12 #ifndef _Standard_PrimitiveTypes_HeaderFile
13 #include <Standard_PrimitiveTypes.hxx>
15 #ifndef _AdvApprox_EvaluatorFunction_HeaderFile
16 #define _AdvApprox_EvaluatorFunction_HeaderFile
18 // abv 01.04.2009: the C function pointer converted to a virtual class
19 // in order to get rid of usage of static functions and static data
21 //! Interface for a class implementing a function to be approximated
22 //! by AdvApprox_ApproxAFunction
23 class AdvApprox_EvaluatorFunction
28 AdvApprox_EvaluatorFunction () {}
30 //! Destructor should be declared as virtual
31 virtual ~AdvApprox_EvaluatorFunction () {}
33 //! Function evaluation method to be defined by descendant
34 virtual void Evaluate (Standard_Integer *Dimension,
35 Standard_Real StartEnd[2],
36 Standard_Real *Parameter,
37 Standard_Integer *DerivativeRequest,
38 Standard_Real *Result, // [Dimension]
39 Standard_Integer *ErrorCode) = 0;
41 //! Shortcut for function-call style usage
42 void operator () (Standard_Integer *Dimension,
43 Standard_Real StartEnd[2],
44 Standard_Real *Parameter,
45 Standard_Integer *DerivativeRequest,
46 Standard_Real *Result, // [Dimension]
47 Standard_Integer *ErrorCode)
48 { Evaluate (Dimension, StartEnd, Parameter, DerivativeRequest, Result, ErrorCode); }
52 //! Copy constructor is declared private to forbid copying
53 AdvApprox_EvaluatorFunction (const AdvApprox_EvaluatorFunction&) {}
55 //! Assignment operator is declared private to forbid copying
56 void operator = (const AdvApprox_EvaluatorFunction&) {}