mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[12070] Add some override correctness
This commit is contained in:
parent
835d1c7479
commit
8c93370a19
81 changed files with 513 additions and 510 deletions
|
|
@ -28,21 +28,21 @@ class MANGOS_DLL_SPEC GridReference : public Reference<GridRefManager<OBJECT>, O
|
|||
{
|
||||
protected:
|
||||
|
||||
void targetObjectBuildLink()
|
||||
void targetObjectBuildLink() override
|
||||
{
|
||||
// called from link()
|
||||
this->getTarget()->insertFirst(this);
|
||||
this->getTarget()->incSize();
|
||||
}
|
||||
|
||||
void targetObjectDestroyLink()
|
||||
void targetObjectDestroyLink() override
|
||||
{
|
||||
// called from unlink()
|
||||
if (this->isValid())
|
||||
this->getTarget()->decSize();
|
||||
}
|
||||
|
||||
void sourceObjectDestroyLink()
|
||||
void sourceObjectDestroyLink() override
|
||||
{
|
||||
// called from invalidate()
|
||||
this->getTarget()->decSize();
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ namespace MaNGOS
|
|||
}
|
||||
|
||||
// non-const remove method
|
||||
template<class SPECIFIC_TYPE> bool Remove(ContainerMapList<SPECIFIC_TYPE>& elements, CountedPtr<SPECIFIC_TYPE>& obj, OBJECT_HANDLE hdl)
|
||||
template<class SPECIFIC_TYPE> bool Remove(ContainerMapList<SPECIFIC_TYPE>& elements, CountedPtr<SPECIFIC_TYPE>& obj, OBJECT_HANDLE hdl) override
|
||||
{
|
||||
typename std::map<OBJECT_HANDLE, CountedPtr<SPECIFIC_TYPE> >::iterator iter = elements._element.find(hdl);
|
||||
if (iter != elements._element.end())
|
||||
|
|
@ -145,22 +145,22 @@ namespace MaNGOS
|
|||
return false; // found... terminate the search
|
||||
}
|
||||
|
||||
template<class SPECIFIC_TYPE> bool Remove(ContainerMapList<TypeNull>& elements, CountedPtr<SPECIFIC_TYPE>& obj, OBJECT_HANDLE hdl)
|
||||
template<class SPECIFIC_TYPE> bool Remove(ContainerMapList<TypeNull>& elements, CountedPtr<SPECIFIC_TYPE>& obj, OBJECT_HANDLE hdl) override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// this is a missed
|
||||
template<class SPECIFIC_TYPE, class T> bool Remove(ContainerMapList<T>& elements, CountedPtr<SPECIFIC_TYPE>& obj, OBJECT_HANDLE hdl)
|
||||
template<class SPECIFIC_TYPE, class T> bool Remove(ContainerMapList<T>& elements, CountedPtr<SPECIFIC_TYPE>& obj, OBJECT_HANDLE hdl) override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
template<class SPECIFIC_TYPE, class T, class H> bool Remove(ContainerMapList<TypeList<H, T> >& elements, CountedPtr<SPECIFIC_TYPE>& obj, OBJECT_HANDLE hdl)
|
||||
template<class SPECIFIC_TYPE, class T, class H> bool Remove(ContainerMapList<TypeList<H, T> >& elements, CountedPtr<SPECIFIC_TYPE>& obj, OBJECT_HANDLE hdl) override
|
||||
{
|
||||
// The head element is bad
|
||||
bool t = Remove(elements._elements, obj, hdl);
|
||||
return (!t ? Remove(elements._TailElements, obj, hdl) : t);
|
||||
bool t = Remove(elements._elements, obj, hdl) override;
|
||||
return (!t ? Remove(elements._TailElements, obj, hdl) : t) override;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue