Commit | Line | Data |
---|---|---|
b311480e | 1 | // Created on: 1997-03-03 |
2 | // Created by: Xavier BENVENISTE | |
3 | // Copyright (c) 1997-1999 Matra Datavision | |
4 | // Copyright (c) 1999-2012 OPEN CASCADE SAS | |
5 | // | |
6 | // The content of this file is subject to the Open CASCADE Technology Public | |
7 | // License Version 6.5 (the "License"). You may not use the content of this file | |
8 | // except in compliance with the License. Please obtain a copy of the License | |
9 | // at http://www.opencascade.org and read it completely before using this file. | |
10 | // | |
11 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its | |
12 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. | |
13 | // | |
14 | // The Original Code and all software distributed under the License is | |
15 | // distributed on an "AS IS" basis, without warranty of any kind, and the | |
16 | // Initial Developer hereby disclaims all such warranties, including without | |
17 | // limitation, any warranties of merchantability, fitness for a particular | |
18 | // purpose or non-infringement. Please see the License for the specific terms | |
19 | // and conditions governing the rights and limitations under the License. | |
20 | ||
7fd59977 | 21 | |
7fd59977 | 22 | #ifndef _BSplCLib_EvaluatorFunction_HeaderFile |
23 | #define _BSplCLib_EvaluatorFunction_HeaderFile | |
24 | ||
7fd59977 | 25 | #ifndef _Standard_Integer_HeaderFile |
26 | #include <Standard_Integer.hxx> | |
27 | #endif | |
28 | #ifndef _Standard_Real_HeaderFile | |
29 | #include <Standard_Real.hxx> | |
30 | #endif | |
31 | #ifndef _Standard_PrimitiveTypes_HeaderFile | |
32 | #include <Standard_PrimitiveTypes.hxx> | |
33 | #endif | |
7fd59977 | 34 | |
41194117 K |
35 | // History - C function pointer converted to a virtual class |
36 | // in order to get rid of usage of static functions and static data | |
37 | class BSplCLib_EvaluatorFunction | |
38 | { | |
39 | public: | |
40 | ||
41 | //! Empty constructor | |
42 | BSplCLib_EvaluatorFunction () {} | |
43 | ||
44 | //! Destructor should be declared as virtual | |
45 | virtual ~BSplCLib_EvaluatorFunction () {} | |
46 | ||
47 | //! Function evaluation method to be defined by descendant | |
48 | virtual void Evaluate (const Standard_Integer theDerivativeRequest, | |
49 | const Standard_Real* theStartEnd, | |
50 | const Standard_Real theParameter, | |
51 | Standard_Real& theResult, | |
52 | Standard_Integer& theErrorCode) const = 0; | |
53 | ||
54 | //! Shortcut for function-call style usage | |
55 | void operator () (const Standard_Integer theDerivativeRequest, | |
56 | const Standard_Real* theStartEnd, | |
57 | const Standard_Real theParameter, | |
58 | Standard_Real& theResult, | |
59 | Standard_Integer& theErrorCode) const | |
60 | { | |
61 | Evaluate (theDerivativeRequest, theStartEnd, theParameter, theResult, theErrorCode); | |
62 | } | |
63 | ||
64 | private: | |
65 | ||
66 | //! Copy constructor is declared private to forbid copying | |
67 | BSplCLib_EvaluatorFunction (const BSplCLib_EvaluatorFunction&) {} | |
68 | ||
69 | //! Assignment operator is declared private to forbid copying | |
70 | void operator = (const BSplCLib_EvaluatorFunction&) {} | |
71 | }; | |
7fd59977 | 72 | |
73 | #endif |