Skip to content
Snippets Groups Projects
Commit d6c195b6 authored by Studer Gabriel's avatar Studer Gabriel
Browse files

add GetHashCode function to ost::mol::EntityHandle

parent 6eb18380
No related branches found
Tags 1.8.0
No related merge requests found
......@@ -225,7 +225,8 @@ void export_Entity()
.def("EditXCS", &EntityHandle::EditXCS, arg("mode")=UNBUFFERED_EDIT)
.def("EditICS", &EntityHandle::EditICS, arg("mode")=UNBUFFERED_EDIT)
.def("RequestXCSEditor", &depr_request_xcs_editor, arg("mode")=UNBUFFERED_EDIT)
.def("RequestICSEditor", &depr_request_ics_editor, arg("mode")=UNBUFFERED_EDIT)
.def("RequestICSEditor", &depr_request_ics_editor, arg("mode")=UNBUFFERED_EDIT)
.def("GetHashCode", &EntityHandle::GetHashCode)
.def(self==self)
.def(self!=self)
#if OST_NUMPY_SUPPORT_ENABLED
......
......@@ -388,4 +388,11 @@ EntityHandle EntityHandle::GetHandle() const
{
return *this;
}
unsigned long EntityHandle::GetHashCode() const
{
this->CheckValidity();
return reinterpret_cast<unsigned long>(Impl().get());
}
}} // ns
......@@ -272,6 +272,9 @@ public:
///
/// Useful for templated code and duck-typing in Python
EntityHandle GetHandle() const;
unsigned long GetHashCode() const;
bool operator==(const EntityHandle& ref) const;
bool operator!=(const EntityHandle& ref) const;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment