AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
ObjectGuidGenerator< high > Class Template Reference

#include "ObjectGuid.h"

Inheritance diagram for ObjectGuidGenerator< high >:
ObjectGuidGeneratorBase

Public Member Functions

 ObjectGuidGenerator (ObjectGuid::LowType start=1)
 
ObjectGuid::LowType Generate () override
 
- Public Member Functions inherited from ObjectGuidGeneratorBase
 ObjectGuidGeneratorBase (ObjectGuid::LowType start=1)
 
virtual void Set (ObjectGuid::LowType val)
 
virtual ObjectGuid::LowType Generate ()=0
 
ObjectGuid::LowType GetNextAfterMaxUsed () const
 
virtual ~ObjectGuidGeneratorBase ()=default
 

Additional Inherited Members

- Static Protected Member Functions inherited from ObjectGuidGeneratorBase
static void HandleCounterOverflow (HighGuid high)
 
- Protected Attributes inherited from ObjectGuidGeneratorBase
ObjectGuid::LowType _nextGuid
 

Detailed Description

template<HighGuid high>
class ObjectGuidGenerator< high >

Constructor & Destructor Documentation

◆ ObjectGuidGenerator()

template<HighGuid high>
ObjectGuidGenerator< high >::ObjectGuidGenerator ( ObjectGuid::LowType  start = 1)
inlineexplicit
301: ObjectGuidGeneratorBase(start) { }
Definition: ObjectGuid.h:283

Member Function Documentation

◆ Generate()

template<HighGuid high>
ObjectGuid::LowType ObjectGuidGenerator< high >::Generate ( )
inlineoverridevirtual

Implements ObjectGuidGeneratorBase.

304 {
305 if (_nextGuid >= ObjectGuid::GetMaxCounter(high) - 1)
307
308 return _nextGuid++;
309 }
ObjectGuid::LowType GetMaxCounter() const
Definition: ObjectGuid.h:161
ObjectGuid::LowType _nextGuid
Definition: ObjectGuid.h:294
static void HandleCounterOverflow(HighGuid high)
Definition: ObjectGuid.cpp:93

References ObjectGuidGeneratorBase::_nextGuid, ObjectGuid::GetMaxCounter(), and ObjectGuidGeneratorBase::HandleCounterOverflow().