Open CASCADE Technology 6.6.0
|
a Element allows to map any kind of object as a Key for a Map.
This works by defining, for a Hash Code, that of the real Key,
not of the Element which acts only as an intermediate.
When a Map asks for the HashCode of a Element, this one returns
the code it has determined at creation time
#include <MoniTool_Element.hxx>
Public Member Functions | |
Standard_Integer | GetHashCode () const |
Returns the HashCode which has been stored by SetHashCode (remark that HashCode could be deferred then be defined by sub-classes, the result is the same) | |
virtual Standard_Boolean | Equates (const Handle< MoniTool_Element > &other) const =0 |
Specific testof equallity : to be defined by each sub-class, must be False if Elements have not the same true Type, else their contents must be compared | |
virtual Handle_Standard_Type | ValueType () const |
Returns the Type of the Value. By default, returns the DynamicType of <me>, but can be redefined | |
virtual Standard_CString | ValueTypeName () const |
Returns the name of the Type of the Value. Default is name of ValueType, unless it is for a non-handled object | |
const MoniTool_AttrList & | ListAttr () const |
Returns (readonly) the Attribute List | |
MoniTool_AttrList & | ChangeAttr () |
Returns (modifiable) the Attribute List | |
Protected Member Functions | |
void | SetHashCode (const Standard_Integer code) |
Stores the HashCode which corresponds to the Value given to create the Mapper |
MoniTool_AttrList& MoniTool_Element::ChangeAttr | ( | ) |
virtual Standard_Boolean MoniTool_Element::Equates | ( | const Handle< MoniTool_Element > & | other | ) | const [pure virtual] |
Implemented in MoniTool_TransientElem.
Standard_Integer MoniTool_Element::GetHashCode | ( | ) | const |
const MoniTool_AttrList& MoniTool_Element::ListAttr | ( | ) | const |
void MoniTool_Element::SetHashCode | ( | const Standard_Integer | code | ) | [protected] |
virtual Handle_Standard_Type MoniTool_Element::ValueType | ( | ) | const [virtual] |
Reimplemented in MoniTool_TransientElem.
virtual Standard_CString MoniTool_Element::ValueTypeName | ( | ) | const [virtual] |
Reimplemented in MoniTool_TransientElem.