0026005: Problem with transient TFunction_Logbook
[occt.git] / src / TFunction / TFunction_Driver.hxx
CommitLineData
42cf5bc1 1// Created on: 1999-07-19
2// Created by: Denis PASCAL
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_Driver_HeaderFile
18#define _TFunction_Driver_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <TDF_Label.hxx>
24#include <MMgt_TShared.hxx>
25#include <Standard_Boolean.hxx>
26#include <Standard_Integer.hxx>
27#include <TDF_LabelList.hxx>
28class TDF_Label;
29class TFunction_Logbook;
30
31
32class TFunction_Driver;
33DEFINE_STANDARD_HANDLE(TFunction_Driver, MMgt_TShared)
34
35//! This driver class provide services around function
36//! execution. One instance of this class is built for
37//! the whole session. The driver is bound to the
38//! DriverGUID in the DriverTable class.
39//! It allows you to create classes which inherit from
40//! this abstract class.
41//! These subclasses identify the various algorithms
42//! which can be applied to the data contained in the
43//! attributes of sub-labels of a model.
44//! A single instance of this class and each of its
45//! subclasses is built for the whole session.
46class TFunction_Driver : public MMgt_TShared
47{
48
49public:
50
51
52 //! Initializes the label L for this function prior to its execution.
53 Standard_EXPORT void Init (const TDF_Label& L);
54
55 //! Returns the label of the driver for this function.
56 TDF_Label Label() const;
57
58 //! Validates labels of a function in <log>.
59 //! This function is the one initialized in this function driver.
60 //! Warning
61 //! In regeneration mode, the solver must call this
62 //! method even if the function is not executed.
63 //! execution of function
64 //! =====================
f486f64d 65 Standard_EXPORT virtual void Validate (Handle(TFunction_Logbook)& log) const;
42cf5bc1 66
67 //! Analyzes the labels in the logbook log.
68 //! Returns true if attributes have been modified.
69 //! If the function label itself has been modified, the function must be executed.
f486f64d 70 Standard_EXPORT virtual Standard_Boolean MustExecute (const Handle(TFunction_Logbook)& log) const;
42cf5bc1 71
72 //! Executes the function in this function driver and
73 //! puts the impacted labels in the logbook log.
74 //! arguments & results of functions
75 //! ================================
f486f64d 76 Standard_EXPORT virtual Standard_Integer Execute (Handle(TFunction_Logbook)& log) const = 0;
42cf5bc1 77
78 //! The method fills-in the list by labels,
79 //! where the arguments of the function are located.
80 Standard_EXPORT virtual void Arguments (TDF_LabelList& args) const;
81
82 //! The method fills-in the list by labels,
83 //! where the results of the function are located.
84 Standard_EXPORT virtual void Results (TDF_LabelList& res) const;
85
86
87
88
89 DEFINE_STANDARD_RTTI(TFunction_Driver,MMgt_TShared)
90
91protected:
92
93
94 //! initialisation of the driver
95 //! ============================
96 Standard_EXPORT TFunction_Driver();
97
98
99
100private:
101
102
103 TDF_Label myLabel;
104
105
106};
107
108
109#include <TFunction_Driver.lxx>
110
111
112
113
114
115#endif // _TFunction_Driver_HeaderFile