|
|
|||
File indexing completed on 2026-08-20 09:14:18
0001 // Created on: 1994-11-04 0002 // Created by: Christian CAILLET 0003 // Copyright (c) 1994-1999 Matra Datavision 0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS 0005 // 0006 // This file is part of Open CASCADE Technology software library. 0007 // 0008 // This library is free software; you can redistribute it and/or modify it under 0009 // the terms of the GNU Lesser General Public License version 2.1 as published 0010 // by the Free Software Foundation, with special exception defined in the file 0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 0012 // distribution for complete text of the license and disclaimer of any warranty. 0013 // 0014 // Alternatively, this file may be used under the terms of Open CASCADE 0015 // commercial license or contractual agreement. 0016 0017 #ifndef _MoniTool_Element_HeaderFile 0018 #define _MoniTool_Element_HeaderFile 0019 0020 #include <Standard.hxx> 0021 0022 #include <Standard_Integer.hxx> 0023 #include <MoniTool_AttrList.hxx> 0024 #include <Standard_Transient.hxx> 0025 #include <Standard_Type.hxx> 0026 0027 class MoniTool_Element; 0028 DEFINE_STANDARD_HANDLE(MoniTool_Element, Standard_Transient) 0029 0030 //! a Element allows to map any kind of object as a Key for a Map. 0031 //! This works by defining, for a Hash Code, that of the real Key, 0032 //! not of the Element which acts only as an intermediate. 0033 //! When a Map asks for the HashCode of a Element, this one returns 0034 //! the code it has determined at creation time 0035 class MoniTool_Element : public Standard_Transient 0036 { 0037 0038 public: 0039 //! Empty constructor 0040 Standard_EXPORT MoniTool_Element(); 0041 0042 //! Returns the HashCode which has been stored by SetHashCode 0043 //! (remark that HashCode could be deferred then be defined by 0044 //! sub-classes, the result is the same) 0045 Standard_EXPORT size_t GetHashCode() const; 0046 0047 //! Specific testof equality : to be defined by each sub-class, 0048 //! must be False if Elements have not the same true Type, else 0049 //! their contents must be compared 0050 Standard_EXPORT virtual Standard_Boolean Equates(const Handle(MoniTool_Element)& other) const = 0; 0051 0052 //! Returns the Type of the Value. By default, returns the 0053 //! DynamicType of <me>, but can be redefined 0054 Standard_EXPORT virtual Handle(Standard_Type) ValueType() const; 0055 0056 //! Returns the name of the Type of the Value. Default is name 0057 //! of ValueType, unless it is for a non-handled object 0058 Standard_EXPORT virtual Standard_CString ValueTypeName() const; 0059 0060 //! Returns (readonly) the Attribute List 0061 Standard_EXPORT const MoniTool_AttrList& ListAttr() const; 0062 0063 //! Returns (modifiable) the Attribute List 0064 Standard_EXPORT MoniTool_AttrList& ChangeAttr(); 0065 0066 DEFINE_STANDARD_RTTIEXT(MoniTool_Element, Standard_Transient) 0067 0068 protected: 0069 //! Stores the HashCode which corresponds to the Value given to 0070 //! create the Mapper 0071 Standard_EXPORT void SetHashCode(const size_t code); 0072 0073 private: 0074 size_t thecode; 0075 MoniTool_AttrList theattrib; 0076 }; 0077 0078 #endif // _MoniTool_Element_HeaderFile
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|