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

refactor: SCHWED-4345 move IsValid to the implementation

parent c454b5c7
No related branches found
No related tags found
No related merge requests found
...@@ -102,6 +102,11 @@ String AtomBase::GetQualifiedName() const ...@@ -102,6 +102,11 @@ String AtomBase::GetQualifiedName() const
return Impl()->GetQualifiedName(); return Impl()->GetQualifiedName();
} }
bool AtomBase::IsValid() const
{
return Impl().get()!=0;
}
void AtomBase::CheckValidity() const void AtomBase::CheckValidity() const
{ {
if (! (impl_ && impl_->GetEntity())) if (! (impl_ && impl_->GetEntity()))
......
...@@ -57,7 +57,7 @@ public: ...@@ -57,7 +57,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 Impl().get()!=0; } bool IsValid() const;
//@} //@}
friend class ConstGenericPropContainer<AtomBase>; friend class ConstGenericPropContainer<AtomBase>;
///\brief Get atom name. ///\brief Get atom name.
......
...@@ -52,6 +52,11 @@ String ChainBase::GetDescription() const { ...@@ -52,6 +52,11 @@ String ChainBase::GetDescription() const {
return impl_->GetDescription(); return impl_->GetDescription();
} }
bool ChainBase::IsValid() const
{
return Impl().get()!=0;
}
void ChainBase::CheckValidity() const { void ChainBase::CheckValidity() const {
if (! (impl_ && impl_->GetEntity())) if (! (impl_ && impl_->GetEntity()))
throw InvalidHandle(); throw InvalidHandle();
......
...@@ -55,7 +55,7 @@ public: ...@@ -55,7 +55,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 Impl().get()!=0; } bool IsValid() const;
//@} //@}
friend class ConstGenericPropContainer<ChainBase>; friend class ConstGenericPropContainer<ChainBase>;
String GetName() const; String GetName() const;
......
...@@ -156,6 +156,11 @@ const impl::ResidueImplPtr& ResidueBase::Impl() const ...@@ -156,6 +156,11 @@ const impl::ResidueImplPtr& ResidueBase::Impl() const
return impl_; return impl_;
} }
bool ResidueBase::IsValid() const
{
return Impl().get()!=0;
}
void ResidueBase::CheckValidity() const void ResidueBase::CheckValidity() const
{ {
if (! (impl_ && impl_->GetEntity())) if (! (impl_ && impl_->GetEntity()))
......
...@@ -81,7 +81,7 @@ public: ...@@ -81,7 +81,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 Impl().get()!=0; } bool IsValid() const;
friend class ConstGenericPropContainer<ResidueBase>; friend class ConstGenericPropContainer<ResidueBase>;
/// \brief return residue number /// \brief return residue number
const ResNum& GetNumber() const; const ResNum& GetNumber() const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment