1 // Created on: 1994-11-04
2 // Created by: Christian CAILLET
3 // Copyright (c) 1994-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 _MoniTool_TransientElem_HeaderFile
18 #define _MoniTool_TransientElem_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <MoniTool_Element.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <Standard_Type.hxx>
26 #include <Standard_CString.hxx>
27 class Standard_Transient;
28 class MoniTool_Element;
31 class MoniTool_TransientElem;
32 DEFINE_STANDARD_HANDLE(MoniTool_TransientElem, MoniTool_Element)
34 //! an TransientElem defines an Element for a specific input class
35 //! its definition includes the value of the Key to be mapped,
36 //! and the HashCoder associated to the class of the Key
38 //! Transient from Standard defines the class to be keyed
39 //! MapTransientHasher from TColStd is the associated Hasher
40 //! DataInfo from MoniTool is an additional class which helps to provide
41 //! information on the value (template : see DataInfo)
42 class MoniTool_TransientElem : public MoniTool_Element
48 //! Creates a TransientElem with a Value. This Value can then not be
49 //! changed. It is used by the Hasher to compute the HashCode,
50 //! which will then be stored for an immediate reading.
51 Standard_EXPORT MoniTool_TransientElem(const Handle(Standard_Transient)& akey);
53 //! Returns the contained value
54 Standard_EXPORT const Handle(Standard_Transient)& Value() const;
56 //! Specific testof equality : defined as False if <other> has
57 //! not the same true Type, else contents are compared (by
59 Standard_EXPORT Standard_Boolean Equates (const Handle(MoniTool_Element)& other) const Standard_OVERRIDE;
61 //! Returns the Type of the Value. By default, returns the
62 //! DynamicType of <me>, but can be redefined
63 Standard_EXPORT virtual Handle(Standard_Type) ValueType() const Standard_OVERRIDE;
65 //! Returns the name of the Type of the Value. Default is name
66 //! of ValueType, unless it is for a non-handled object
67 Standard_EXPORT virtual Standard_CString ValueTypeName() const Standard_OVERRIDE;
72 DEFINE_STANDARD_RTTIEXT(MoniTool_TransientElem,MoniTool_Element)
82 Handle(Standard_Transient) theval;
93 #endif // _MoniTool_TransientElem_HeaderFile