mirror of
https://github.com/mangosfour/server.git
synced 2025-12-25 04:37:02 +00:00
[9775] Cleanups in framework library.
* Removed last bits of threading in grid code. * Removed some weird and unneeded declarations. * General code style fixes. * (Perhaps some things I forgot.) Thanks to Lynx3d for the usual GCC-stabbing...
This commit is contained in:
parent
4d89b41f60
commit
7532061a79
25 changed files with 774 additions and 398 deletions
|
|
@ -21,32 +21,49 @@
|
|||
|
||||
#include "Utilities/LinkedReference/Reference.h"
|
||||
|
||||
template<class OBJECT>
|
||||
class GridRefManager;
|
||||
template<class OBJECT> class GridRefManager;
|
||||
|
||||
template<class OBJECT>
|
||||
class MANGOS_DLL_SPEC GridReference : public Reference<GridRefManager<OBJECT>, OBJECT>
|
||||
{
|
||||
protected:
|
||||
|
||||
void targetObjectBuildLink()
|
||||
{
|
||||
// called from link()
|
||||
this->getTarget()->insertFirst(this);
|
||||
this->getTarget()->incSize();
|
||||
}
|
||||
|
||||
void targetObjectDestroyLink()
|
||||
{
|
||||
// called from unlink()
|
||||
if(this->isValid()) this->getTarget()->decSize();
|
||||
if (this->isValid())
|
||||
this->getTarget()->decSize();
|
||||
}
|
||||
|
||||
void sourceObjectDestroyLink()
|
||||
{
|
||||
// called from invalidate()
|
||||
this->getTarget()->decSize();
|
||||
}
|
||||
|
||||
public:
|
||||
GridReference() : Reference<GridRefManager<OBJECT>, OBJECT>() {}
|
||||
~GridReference() { this->unlink(); }
|
||||
GridReference *next() { return (GridReference*)Reference<GridRefManager<OBJECT>, OBJECT>::next(); }
|
||||
|
||||
GridReference()
|
||||
: Reference<GridRefManager<OBJECT>, OBJECT>()
|
||||
{
|
||||
}
|
||||
|
||||
~GridReference()
|
||||
{
|
||||
this->unlink();
|
||||
}
|
||||
|
||||
GridReference *next()
|
||||
{
|
||||
return (GridReference*)Reference<GridRefManager<OBJECT>, OBJECT>::next();
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue