0026936: Drawbacks of inlining in new type system in OCCT 7.0 -- automatic
[occt.git] / src / TFunction / TFunction_Function.hxx
1 // Created on: 1999-06-10
2 // Created by: Vladislav ROMASHKO
3 // Copyright (c) 1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _TFunction_Function_HeaderFile
18 #define _TFunction_Function_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <Standard_GUID.hxx>
24 #include <Standard_Integer.hxx>
25 #include <TDF_Attribute.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <Standard_OStream.hxx>
28 class TDF_Label;
29 class Standard_GUID;
30 class TDF_Attribute;
31 class TDF_RelocationTable;
32 class TDF_DataSet;
33
34
35 class TFunction_Function;
36 DEFINE_STANDARD_HANDLE(TFunction_Function, TDF_Attribute)
37
38 //! Provides the following two services
39 //! -   a link to an evaluation driver
40 //! -   the means of providing a link between a
41 //! function and an evaluation driver.
42 class TFunction_Function : public TDF_Attribute
43 {
44
45 public:
46
47   
48   //! Static methods:
49   //! ==============
50   //! Finds or Creates a function attribute on the label <L>.
51   //! Returns the function attribute.
52   Standard_EXPORT static Handle(TFunction_Function) Set (const TDF_Label& L);
53   
54   //! Finds or Creates a function attribute on the label <L>.
55   //! Sets a driver ID to the function.
56   //! Returns the function attribute.
57   Standard_EXPORT static Handle(TFunction_Function) Set (const TDF_Label& L, const Standard_GUID& DriverID);
58   
59   //! Returns the GUID for functions.
60   //! Returns a function found on the label.
61   //! Instance methods:
62   //! ================
63   Standard_EXPORT static const Standard_GUID& GetID();
64   
65   Standard_EXPORT TFunction_Function();
66   
67   //! Returns the GUID for this function's driver.
68     const Standard_GUID& GetDriverGUID() const;
69   
70   //! Sets the driver for this function as that
71   //! indentified by the GUID guid.
72   Standard_EXPORT void SetDriverGUID (const Standard_GUID& guid);
73   
74   //! Returns true if the execution failed
75     Standard_Boolean Failed() const;
76   
77   //! Sets the failed index.
78   Standard_EXPORT void SetFailure (const Standard_Integer mode = 0);
79   
80
81   //! Returns an index of failure if the execution of this function failed.
82   //! If this integer value is 0, no failure has occurred.
83   //! Implementation of Attribute methods:
84   //! ===================================
85     Standard_Integer GetFailure() const;
86   
87   Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
88   
89   Standard_EXPORT virtual void Restore (const Handle(TDF_Attribute)& with) Standard_OVERRIDE;
90   
91   Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const Standard_OVERRIDE;
92   
93   Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
94   
95   Standard_EXPORT virtual void References (const Handle(TDF_DataSet)& aDataSet) const Standard_OVERRIDE;
96   
97   Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
98
99
100
101
102   DEFINE_STANDARD_RTTIEXT(TFunction_Function,TDF_Attribute)
103
104 protected:
105
106
107
108
109 private:
110
111
112   Standard_GUID myDriverGUID;
113   Standard_Integer myFailure;
114
115
116 };
117
118
119 #include <TFunction_Function.lxx>
120
121
122
123
124
125 #endif // _TFunction_Function_HeaderFile