42cf5bc1 |
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 |
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 _MoniTool_TransientElem_HeaderFile |
18 | #define _MoniTool_TransientElem_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
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; |
29 | |
30 | |
31 | class MoniTool_TransientElem; |
32 | DEFINE_STANDARD_HANDLE(MoniTool_TransientElem, MoniTool_Element) |
33 | |
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 |
37 | //! |
38 | //! Transient from Standard defines the class to be keyed |
39 | //! MapTransientHasher from TColStd is the associated Hasher |
40 | //! DataInfo from MoniTool is an additionnal class which helps to provide |
41 | //! informations on the value (template : see DataInfo) |
42 | class MoniTool_TransientElem : public MoniTool_Element |
43 | { |
44 | |
45 | public: |
46 | |
47 | |
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); |
52 | |
53 | //! Returns the contained value |
54 | Standard_EXPORT const Handle(Standard_Transient)& Value() const; |
55 | |
56 | //! Specific testof equallity : defined as False if <other> has |
57 | //! not the same true Type, else contents are compared (by |
58 | //! C++ operator ==) |
79104795 |
59 | Standard_EXPORT Standard_Boolean Equates (const Handle(MoniTool_Element)& other) const Standard_OVERRIDE; |
42cf5bc1 |
60 | |
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; |
64 | |
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; |
68 | |
69 | |
70 | |
71 | |
92efcf78 |
72 | DEFINE_STANDARD_RTTIEXT(MoniTool_TransientElem,MoniTool_Element) |
42cf5bc1 |
73 | |
74 | protected: |
75 | |
76 | |
77 | |
78 | |
79 | private: |
80 | |
81 | |
82 | Handle(Standard_Transient) theval; |
83 | |
84 | |
85 | }; |
86 | |
87 | |
88 | |
89 | |
90 | |
91 | |
92 | |
93 | #endif // _MoniTool_TransientElem_HeaderFile |