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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _TFunction_Function_HeaderFile
18 #define _TFunction_Function_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
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>
31 class TDF_RelocationTable;
35 class TFunction_Function;
36 DEFINE_STANDARD_HANDLE(TFunction_Function, TDF_Attribute)
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
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);
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);
59 //! Returns the GUID for functions.
60 //! Returns a function found on the label.
63 Standard_EXPORT static const Standard_GUID& GetID();
65 Standard_EXPORT TFunction_Function();
67 //! Returns the GUID for this function's driver.
68 const Standard_GUID& GetDriverGUID() const;
70 //! Sets the driver for this function as that
71 //! indentified by the GUID guid.
72 Standard_EXPORT void SetDriverGUID (const Standard_GUID& guid);
74 //! Returns true if the execution failed
75 Standard_Boolean Failed() const;
77 //! Sets the failed index.
78 Standard_EXPORT void SetFailure (const Standard_Integer mode = 0);
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;
87 Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
89 Standard_EXPORT virtual void Restore (const Handle(TDF_Attribute)& with) Standard_OVERRIDE;
91 Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const Standard_OVERRIDE;
93 Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
95 Standard_EXPORT virtual void References (const Handle(TDF_DataSet)& aDataSet) const Standard_OVERRIDE;
97 Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
102 DEFINE_STANDARD_RTTIEXT(TFunction_Function,TDF_Attribute)
112 Standard_GUID myDriverGUID;
113 Standard_Integer myFailure;
119 #include <TFunction_Function.lxx>
125 #endif // _TFunction_Function_HeaderFile