mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[Sync] Some project sync
This commit is contained in:
parent
b25fa433fe
commit
bbf0020c1a
98 changed files with 5866 additions and 2121 deletions
|
|
@ -22,8 +22,8 @@
|
|||
* and lore are copyrighted by Blizzard Entertainment, Inc.
|
||||
*/
|
||||
|
||||
#ifndef _REFMANAGER_H
|
||||
#define _REFMANAGER_H
|
||||
#ifndef MANGOS_H_REFMANAGER
|
||||
#define MANGOS_H_REFMANAGER
|
||||
|
||||
//=====================================================
|
||||
|
||||
|
|
@ -31,24 +31,84 @@
|
|||
#include "Utilities/LinkedReference/Reference.h"
|
||||
|
||||
template <class TO, class FROM>
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
*/
|
||||
class RefManager : public LinkedListHead
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
*/
|
||||
typedef LinkedListHead::Iterator<Reference<TO, FROM> > iterator;
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
*/
|
||||
RefManager() {}
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
*/
|
||||
virtual ~RefManager() { clearReferences(); }
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @return Reference<TO, FROM>
|
||||
*/
|
||||
Reference<TO, FROM>* getFirst() { return ((Reference<TO, FROM>*) LinkedListHead::getFirst()); }
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @return const Reference<TO, FROM>
|
||||
*/
|
||||
Reference<TO, FROM> const* getFirst() const { return ((Reference<TO, FROM> const*) LinkedListHead::getFirst()); }
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @return Reference<TO, FROM>
|
||||
*/
|
||||
Reference<TO, FROM>* getLast() { return ((Reference<TO, FROM>*) LinkedListHead::getLast()); }
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @return const Reference<TO, FROM>
|
||||
*/
|
||||
Reference<TO, FROM> const* getLast() const { return ((Reference<TO, FROM> const*) LinkedListHead::getLast()); }
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @return iterator
|
||||
*/
|
||||
iterator begin() { return iterator(getFirst()); }
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @return iterator
|
||||
*/
|
||||
iterator end() { return iterator(NULL); }
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @return iterator
|
||||
*/
|
||||
iterator rbegin() { return iterator(getLast()); }
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @return iterator
|
||||
*/
|
||||
iterator rend() { return iterator(NULL); }
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
*/
|
||||
void clearReferences()
|
||||
{
|
||||
LinkedListElement* ref;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue