Skip to content
Snippets Groups Projects
Unverified Commit 3a67511d authored by Xavier Robin's avatar Xavier Robin
Browse files

fix: SCHWED-4345 fix validity of views too

parent 1f1713a4
Branches
Tags
No related merge requests found
...@@ -167,6 +167,11 @@ unsigned long AtomView::GetHashCode() const ...@@ -167,6 +167,11 @@ unsigned long AtomView::GetHashCode() const
return reinterpret_cast<unsigned long>(data_.get()); return reinterpret_cast<unsigned long>(data_.get());
} }
bool AtomView::IsValid() const
{
return Impl().get()!=0 && Impl()->GetEntity();
}
}} // ns }} // ns
...@@ -47,7 +47,7 @@ public: ...@@ -47,7 +47,7 @@ public:
operator bool() const { return this->IsValid(); } operator bool() const { return this->IsValid(); }
/// \brief check validity of handle /// \brief check validity of handle
/// \sa #operator bool() /// \sa #operator bool()
bool IsValid() const { return data_.get()!=0; } bool IsValid() const;
//@} //@}
// constructors // constructors
AtomView(); AtomView();
......
...@@ -483,5 +483,11 @@ unsigned long ChainView::GetHashCode() const ...@@ -483,5 +483,11 @@ unsigned long ChainView::GetHashCode() const
return reinterpret_cast<unsigned long>(data_.get()); return reinterpret_cast<unsigned long>(data_.get());
} }
bool ChainView::IsValid() const
{
return Impl().get()!=0 && Impl()->GetEntity();
}
}} // ns }} // ns
...@@ -56,7 +56,7 @@ public: ...@@ -56,7 +56,7 @@ public:
operator bool() const { return this->IsValid(); } operator bool() const { return this->IsValid(); }
/// \brief check validity of handle /// \brief check validity of handle
/// \sa #operator bool() /// \sa #operator bool()
bool IsValid() const { return data_.get()!=0; } bool IsValid() const;
//@} //@}
/// \brief Get parent entity view /// \brief Get parent entity view
......
...@@ -291,4 +291,9 @@ unsigned long ResidueView::GetHashCode() const ...@@ -291,4 +291,9 @@ unsigned long ResidueView::GetHashCode() const
return reinterpret_cast<unsigned long>(data_.get()); return reinterpret_cast<unsigned long>(data_.get());
} }
bool ResidueView::IsValid() const
{
return Impl().get()!=0 && Impl()->GetEntity();
}
}} //ns }} //ns
...@@ -65,7 +65,7 @@ public: ...@@ -65,7 +65,7 @@ public:
operator bool() const { return this->IsValid(); } operator bool() const { return this->IsValid(); }
/// \brief check validity of handle /// \brief check validity of handle
/// \sa #operator bool() /// \sa #operator bool()
bool IsValid() const { return data_.get()!=0; } bool IsValid() const;
//@} //@}
/// \name internal /// \name internal
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment