0027772: Foundation Classes - define Standard_Boolean using C++ type "bool" instead...
[occt.git] / src / TFunction / TFunction_Function.hxx
CommitLineData
42cf5bc1 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>
28class TDF_Label;
29class Standard_GUID;
30class TDF_Attribute;
31class TDF_RelocationTable;
32class TDF_DataSet;
33
34
35class TFunction_Function;
36DEFINE_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.
42class TFunction_Function : public TDF_Attribute
43{
44
45public:
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();
dde68833 66
42cf5bc1 67 //! Returns the GUID for this function's driver.
dde68833 68 const Standard_GUID& GetDriverGUID() const { return myDriverGUID; }
69
42cf5bc1 70 //! Sets the driver for this function as that
71 //! indentified by the GUID guid.
72 Standard_EXPORT void SetDriverGUID (const Standard_GUID& guid);
dde68833 73
42cf5bc1 74 //! Returns true if the execution failed
dde68833 75 Standard_Boolean Failed() const { return myFailure != 0; }
76
42cf5bc1 77 //! Sets the failed index.
78 Standard_EXPORT void SetFailure (const Standard_Integer mode = 0);
42cf5bc1 79
80 //! Returns an index of failure if the execution of this function failed.
81 //! If this integer value is 0, no failure has occurred.
82 //! Implementation of Attribute methods:
83 //! ===================================
dde68833 84 Standard_Integer GetFailure() const { return myFailure; }
85
79104795 86 Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
42cf5bc1 87
79104795 88 Standard_EXPORT virtual void Restore (const Handle(TDF_Attribute)& with) Standard_OVERRIDE;
42cf5bc1 89
79104795 90 Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const Standard_OVERRIDE;
42cf5bc1 91
92 Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
93
94 Standard_EXPORT virtual void References (const Handle(TDF_DataSet)& aDataSet) const Standard_OVERRIDE;
95
96 Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
97
92efcf78 98 DEFINE_STANDARD_RTTIEXT(TFunction_Function,TDF_Attribute)
42cf5bc1 99
42cf5bc1 100private:
101
42cf5bc1 102 Standard_GUID myDriverGUID;
103 Standard_Integer myFailure;
104
42cf5bc1 105};
106
42cf5bc1 107#endif // _TFunction_Function_HeaderFile