1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0024870: Provide OCCT RTTI test cases

Test commands for checking performance and functionality of OCCT handles and RTTI added.
New test case added for that: test perf fclasses handle.

Implementation of opencascade::handle improved to enable compile-time error if two handles of incompatible types are compared.
Comparison of handle to NULL is not possible any more; method IsNull() should be used instead.

Method LDOM_MemManager::Doc() is removed to avoid cyclic dependency of headers; constructor of LDOM_Document(LDOM_MemManager&) is used directly instead.

Inclusion of headers corrected for compilation after previous patch.
This commit is contained in:
abv
2015-06-30 10:25:48 +03:00
parent c60ae7f6b1
commit e8862cf41a
29 changed files with 846 additions and 44 deletions

View File

@@ -123,38 +123,42 @@ namespace opencascade {
template <class T2>
bool operator== (const handle<T2>& theHandle) const
{
return this->entity == theHandle.entity;
return get() == theHandle.get();
}
//! Check for equality
bool operator== (const Standard_Transient *thePtr) const
template <class T2>
bool operator== (const T2 *thePtr) const
{
return this->entity == thePtr;
return get() == thePtr;
}
//! Check for equality
friend bool operator== (const Standard_Transient *left, const handle& right)
template <class T2>
friend bool operator== (const T2 *left, const handle& right)
{
return left == right.entity;
return left == right.get();
}
//! Check for inequality
template <class T2>
bool operator!= (const handle<T2>& theHandle) const
{
return this->entity != theHandle.entity;
return get() != theHandle.get();
}
//! Check for inequality
bool operator!= (const Standard_Transient *thePtr) const
template <class T2>
bool operator!= (const T2 *thePtr) const
{
return this->entity != thePtr;
return get() != thePtr;
}
//! Check for inequality
friend bool operator!= (const Standard_Transient *left, const handle& right)
template <class T2>
friend bool operator!= (const T2 *left, const handle& right)
{
return left != right.entity;
return left != right.get();
}
//! Down casting operator