1 // Created on: 1991-01-10
2 // Created by: Arnaud BOUZY
3 // Copyright (c) 1991-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 _Expr_NamedExpression_HeaderFile
18 #define _Expr_NamedExpression_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <TCollection_AsciiString.hxx>
24 #include <Expr_GeneralExpression.hxx>
25 #include <Standard_Boolean.hxx>
26 class TCollection_AsciiString;
27 class Expr_GeneralExpression;
30 class Expr_NamedExpression;
31 DEFINE_STANDARD_HANDLE(Expr_NamedExpression, Expr_GeneralExpression)
33 //! Describe an expression used by its name (as constants
34 //! or variables). A single reference is made to a
35 //! NamedExpression in every Expression (i.e. a
36 //! NamedExpression is shared).
37 class Expr_NamedExpression : public Expr_GeneralExpression
43 Standard_EXPORT const TCollection_AsciiString& GetName() const;
45 Standard_EXPORT void SetName (const TCollection_AsciiString& name);
47 //! Tests if <me> can be shared by one or more expressions
48 //! or must be copied. This method redefines to a True
49 //! value the GeneralExpression method.
50 Standard_EXPORT virtual Standard_Boolean IsShareable() const Standard_OVERRIDE;
52 //! Tests if <me> and <Other> define the same expression.
53 //! This method does not include any simplification before
55 Standard_EXPORT Standard_Boolean IsIdentical (const Handle(Expr_GeneralExpression)& Other) const Standard_OVERRIDE;
57 //! returns a string representing <me> in a readable way.
58 Standard_EXPORT TCollection_AsciiString String() const Standard_OVERRIDE;
63 DEFINE_STANDARD_RTTIEXT(Expr_NamedExpression,Expr_GeneralExpression)
73 TCollection_AsciiString myName;
84 #endif // _Expr_NamedExpression_HeaderFile