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
return Impl()->GetQualifiedName();
}
bool AtomBase::IsValid() const
{
return Impl().get()!=0;
}
void AtomBase::CheckValidity() const
{
if (! (impl_ && impl_->GetEntity()))
......
......@@ -57,7 +57,7 @@ public:
operator bool() const { return this->IsValid(); }
/// \brief check validity of handle
/// \sa #operator bool()
bool IsValid() const { return Impl().get()!=0; }
bool IsValid() const;
//@}
friend class ConstGenericPropContainer<AtomBase>;
///\brief Get atom name.
......
......@@ -52,6 +52,11 @@ String ChainBase::GetDescription() const {
return impl_->GetDescription();
}
bool ChainBase::IsValid() const
{
return Impl().get()!=0;
}
void ChainBase::CheckValidity() const {
if (! (impl_ && impl_->GetEntity()))
throw InvalidHandle();
......
......@@ -55,7 +55,7 @@ public:
operator bool() const { return this->IsValid(); }
/// \brief check validity of handle
/// \sa #operator bool()
bool IsValid() const { return Impl().get()!=0; }
bool IsValid() const;
//@}
friend class ConstGenericPropContainer<ChainBase>;
String GetName() const;
......
......@@ -156,6 +156,11 @@ const impl::ResidueImplPtr& ResidueBase::Impl() const
return impl_;
}
bool ResidueBase::IsValid() const
{
return Impl().get()!=0;
}
void ResidueBase::CheckValidity() const
{
if (! (impl_ && impl_->GetEntity()))
......
......@@ -81,7 +81,7 @@ public:
operator bool() const { return this->IsValid(); }
/// \brief check validity of handle
/// \sa #operator bool()
bool IsValid() const { return Impl().get()!=0; }
bool IsValid() const;
friend class ConstGenericPropContainer<ResidueBase>;
/// \brief return residue number
const ResNum& GetNumber() 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