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
299: ObjectGuidGeneratorBase(start) { }
Definition: ObjectGuid.h:281

Member Function Documentation

◆ Generate()

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

Implements ObjectGuidGeneratorBase.

302 {
303 if (_nextGuid >= ObjectGuid::GetMaxCounter(high) - 1)
305
306 return _nextGuid++;
307 }
ObjectGuid::LowType GetMaxCounter() const
Definition: ObjectGuid.h:159
ObjectGuid::LowType _nextGuid
Definition: ObjectGuid.h:292
static void HandleCounterOverflow(HighGuid high)
Definition: ObjectGuid.cpp:93

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