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 (uint16 realmId=DEFAULT_NON_CROSSREALM_REALM_ID) override
 
- Public Member Functions inherited from ObjectGuidGeneratorBase
 ObjectGuidGeneratorBase (ObjectGuid::LowType start=1)
 
virtual void Set (ObjectGuid::LowType val)
 
ObjectGuid::LowType GetNextAfterMaxUsed () const
 
virtual ~ObjectGuidGeneratorBase ()=default
 

Additional Inherited Members

- Static Protected Member Functions inherited from ObjectGuidGeneratorBase
static void HandleCounterOverflow (HighGuid high)
 
static bool GetClusterGuid (HighGuid high, uint16 realmId, ObjectGuid::LowType &clusterGuid)
 
- 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
304: ObjectGuidGeneratorBase(start) { }
Definition ObjectGuid.h:285

Member Function Documentation

◆ Generate()

template<HighGuid high>
ObjectGuid::LowType ObjectGuidGenerator< high >::Generate ( uint16  realmId = DEFAULT_NON_CROSSREALM_REALM_ID)
inlineoverridevirtual

Implements ObjectGuidGeneratorBase.

307 {
308 ObjectGuid::LowType clusterGuid = 0;
309 if (GetClusterGuid(high, realmId, clusterGuid))
310 return clusterGuid;
311
312 if (_nextGuid >= ObjectGuid::GetMaxCounter(high) - 1)
314
315 return _nextGuid++;
316 }
ObjectGuid::LowType _nextGuid
Definition ObjectGuid.h:297
static bool GetClusterGuid(HighGuid high, uint16 realmId, ObjectGuid::LowType &clusterGuid)
Definition ObjectGuid.cpp:100
static void HandleCounterOverflow(HighGuid high)
Definition ObjectGuid.cpp:94
uint32 LowType
Definition ObjectGuid.h:125
ObjectGuid::LowType GetMaxCounter() const
Definition ObjectGuid.h:163

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


The documentation for this class was generated from the following file: