TrinityCore
ObjectGuid Class Reference

#include <ObjectGuid.h>

Public Types

using LowType = uint64
 

Public Member Functions

 ObjectGuid ()=default
 
uint64 GetRawValue (std::size_t i) const
 
std::vector< uint8GetRawValue () const
 
void SetRawValue (std::vector< uint8 > const &guid)
 
void SetRawValue (uint64 high, uint64 low)
 
void Clear ()
 
HighGuid GetHigh () const
 
uint32 GetRealmId () const
 
uint32 GetMapId () const
 
uint32 GetEntry () const
 
uint32 GetSubType () const
 
LowType GetCounter () const
 
LowType GetMaxCounter () const
 
bool IsEmpty () const
 
bool IsCreature () const
 
bool IsPet () const
 
bool IsVehicle () const
 
bool IsCreatureOrPet () const
 
bool IsCreatureOrVehicle () const
 
bool IsAnyTypeCreature () const
 
bool IsPlayer () const
 
bool IsUnit () const
 
bool IsItem () const
 
bool IsGameObject () const
 
bool IsDynamicObject () const
 
bool IsCorpse () const
 
bool IsAreaTrigger () const
 
bool IsMOTransport () const
 
bool IsAnyTypeGameObject () const
 
bool IsParty () const
 
bool IsGuild () const
 
bool IsSceneObject () const
 
bool IsConversation () const
 
bool IsCast () const
 
bool operator! () const
 
bool operator== (ObjectGuid const &right) const =default
 
std::strong_ordering operator<=> (ObjectGuid const &right) const
 
char const * GetTypeName () const
 
std::string ToString () const
 
std::string ToHexString () const
 
std::size_t GetHash () const
 

Static Public Member Functions

static LowType GetMaxCounter (HighGuid high)
 
static char const * GetTypeName (HighGuid high)
 
static ObjectGuid FromString (std::string const &guidString)
 
template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Null, ObjectGuidCreate ()
 
template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Uniq, ObjectGuidCreate (ObjectGuid::LowType id)
 
template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Player, ObjectGuidCreate (ObjectGuid::LowType dbId)
 
template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Item, ObjectGuidCreate (ObjectGuid::LowType dbId)
 
template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::WorldObject, ObjectGuidCreate (uint16 mapId, uint32 entry, ObjectGuid::LowType counter)
 
template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::WorldObject, ObjectGuidCreate (uint8 subType, uint16 mapId, uint32 entry, ObjectGuid::LowType counter)
 
template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Transport, ObjectGuidCreate (uint32 counter)
 
template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::ClientActor, ObjectGuidCreate (uint16 ownerType, uint16 ownerId, uint32 counter)
 
template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::ChatChannel, ObjectGuidCreate (bool builtIn, bool trade, uint16 zoneId, uint8 factionGroupMask, ObjectGuid::LowType counter)
 
template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Global, ObjectGuidCreate (ObjectGuid::LowType dbId)
 
template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Guild, ObjectGuidCreate (ObjectGuid::LowType dbId)
 
template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::MobileSession, ObjectGuidCreate (uint16 arg1, ObjectGuid::LowType counter)
 
template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::WebObj, ObjectGuidCreate (uint8 arg1, uint8 arg2, ObjectGuid::LowType counter)
 
template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::LFGObject, ObjectGuidCreate (uint8 arg1, uint8 arg2, uint8 arg3, uint8 arg4, bool arg5, uint8 arg6, ObjectGuid::LowType counter)
 
template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::LFGList, ObjectGuidCreate (uint8 arg1, ObjectGuid::LowType counter)
 
template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Client, ObjectGuidCreate (uint32 arg1, ObjectGuid::LowType counter)
 
template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::ClubFinder, ObjectGuidCreate (uint8 clubType, uint32 clubFinderId, ObjectGuid::LowType dbId)
 
template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::ToolsClient, ObjectGuidCreate (uint16 mapId, uint32 serverId, ObjectGuid::LowType counter)
 
template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::WorldLayer, ObjectGuidCreate (uint32 arg1, uint16 arg2, uint8 arg3, uint32 arg4)
 
template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::LMMLobby, ObjectGuidCreate (uint32 arg2, uint8 arg3, uint8 arg4, ObjectGuid::LowType counter)
 

Static Public Attributes

static ObjectGuid const Empty = ObjectGuid()
 
static ObjectGuid const FromStringFailed = ObjectGuid::Create<HighGuid::Uniq>(UI64LIT(4))
 
static ObjectGuid const TradeItem = ObjectGuid::Create<HighGuid::Uniq>(UI64LIT(10))
 

Protected Member Functions

 ObjectGuid (uint64 high, uint64 low)
 

Protected Attributes

std::array< uint64, 2 > _data = { }
 

Friends

class ObjectGuidFactory
 
TC_GAME_API ByteBufferoperator<< (ByteBuffer &buf, ObjectGuid const &guid)
 
TC_GAME_API ByteBufferoperator>> (ByteBuffer &buf, ObjectGuid &guid)
 

Detailed Description

Definition at line 267 of file ObjectGuid.h.

Member Typedef Documentation

◆ LowType

Definition at line 278 of file ObjectGuid.h.

Constructor & Destructor Documentation

◆ ObjectGuid() [1/2]

ObjectGuid::ObjectGuid ( )
default

◆ ObjectGuid() [2/2]

ObjectGuid::ObjectGuid ( uint64  high,
uint64  low 
)
inlineprotected

Definition at line 381 of file ObjectGuid.h.

Member Function Documentation

◆ Clear()

void ObjectGuid::Clear ( )
inline

Definition at line 286 of file ObjectGuid.h.

◆ Create() [1/20]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Null, ObjectGuid > ObjectGuid::Create ( )
inlinestatic

Definition at line 359 of file ObjectGuid.h.

+ Here is the call graph for this function:

◆ Create() [2/20]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::ChatChannel, ObjectGuid > ObjectGuid::Create ( bool  builtIn,
bool  trade,
uint16  zoneId,
uint8  factionGroupMask,
ObjectGuid::LowType  counter 
)
inlinestatic

Definition at line 367 of file ObjectGuid.h.

+ Here is the call graph for this function:

◆ Create() [3/20]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Player, ObjectGuid > ObjectGuid::Create ( ObjectGuid::LowType  dbId)
inlinestatic

Definition at line 361 of file ObjectGuid.h.

+ Here is the call graph for this function:

◆ Create() [4/20]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Item, ObjectGuid > ObjectGuid::Create ( ObjectGuid::LowType  dbId)
inlinestatic

Definition at line 362 of file ObjectGuid.h.

+ Here is the call graph for this function:

◆ Create() [5/20]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Global, ObjectGuid > ObjectGuid::Create ( ObjectGuid::LowType  dbId)
inlinestatic

Definition at line 368 of file ObjectGuid.h.

+ Here is the call graph for this function:

◆ Create() [6/20]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Guild, ObjectGuid > ObjectGuid::Create ( ObjectGuid::LowType  dbId)
inlinestatic

Definition at line 369 of file ObjectGuid.h.

+ Here is the call graph for this function:

◆ Create() [7/20]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Uniq, ObjectGuid > ObjectGuid::Create ( ObjectGuid::LowType  id)
inlinestatic

Definition at line 360 of file ObjectGuid.h.

+ Here is the call graph for this function:

◆ Create() [8/20]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::MobileSession, ObjectGuid > ObjectGuid::Create ( uint16  arg1,
ObjectGuid::LowType  counter 
)
inlinestatic

Definition at line 370 of file ObjectGuid.h.

+ Here is the call graph for this function:

◆ Create() [9/20]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::WorldObject, ObjectGuid > ObjectGuid::Create ( uint16  mapId,
uint32  entry,
ObjectGuid::LowType  counter 
)
inlinestatic

Definition at line 363 of file ObjectGuid.h.

+ Here is the call graph for this function:

◆ Create() [10/20]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::ToolsClient, ObjectGuid > ObjectGuid::Create ( uint16  mapId,
uint32  serverId,
ObjectGuid::LowType  counter 
)
inlinestatic

Definition at line 376 of file ObjectGuid.h.

+ Here is the call graph for this function:

◆ Create() [11/20]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::ClientActor, ObjectGuid > ObjectGuid::Create ( uint16  ownerType,
uint16  ownerId,
uint32  counter 
)
inlinestatic

Definition at line 366 of file ObjectGuid.h.

+ Here is the call graph for this function:

◆ Create() [12/20]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Client, ObjectGuid > ObjectGuid::Create ( uint32  arg1,
ObjectGuid::LowType  counter 
)
inlinestatic

Definition at line 374 of file ObjectGuid.h.

+ Here is the call graph for this function:

◆ Create() [13/20]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::WorldLayer, ObjectGuid > ObjectGuid::Create ( uint32  arg1,
uint16  arg2,
uint8  arg3,
uint32  arg4 
)
inlinestatic

Definition at line 377 of file ObjectGuid.h.

+ Here is the call graph for this function:

◆ Create() [14/20]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::LMMLobby, ObjectGuid > ObjectGuid::Create ( uint32  arg2,
uint8  arg3,
uint8  arg4,
ObjectGuid::LowType  counter 
)
inlinestatic

Definition at line 378 of file ObjectGuid.h.

+ Here is the call graph for this function:

◆ Create() [15/20]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Transport, ObjectGuid > ObjectGuid::Create ( uint32  counter)
inlinestatic

Definition at line 365 of file ObjectGuid.h.

+ Here is the call graph for this function:

◆ Create() [16/20]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::LFGList, ObjectGuid > ObjectGuid::Create ( uint8  arg1,
ObjectGuid::LowType  counter 
)
inlinestatic

Definition at line 373 of file ObjectGuid.h.

+ Here is the call graph for this function:

◆ Create() [17/20]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::WebObj, ObjectGuid > ObjectGuid::Create ( uint8  arg1,
uint8  arg2,
ObjectGuid::LowType  counter 
)
inlinestatic

Definition at line 371 of file ObjectGuid.h.

+ Here is the call graph for this function:

◆ Create() [18/20]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::LFGObject, ObjectGuid > ObjectGuid::Create ( uint8  arg1,
uint8  arg2,
uint8  arg3,
uint8  arg4,
bool  arg5,
uint8  arg6,
ObjectGuid::LowType  counter 
)
inlinestatic

Definition at line 372 of file ObjectGuid.h.

+ Here is the call graph for this function:

◆ Create() [19/20]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::ClubFinder, ObjectGuid > ObjectGuid::Create ( uint8  clubType,
uint32  clubFinderId,
ObjectGuid::LowType  dbId 
)
inlinestatic

Definition at line 375 of file ObjectGuid.h.

+ Here is the call graph for this function:

◆ Create() [20/20]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::WorldObject, ObjectGuid > ObjectGuid::Create ( uint8  subType,
uint16  mapId,
uint32  entry,
ObjectGuid::LowType  counter 
)
inlinestatic

Definition at line 364 of file ObjectGuid.h.

+ Here is the call graph for this function:

◆ FromString()

ObjectGuid ObjectGuid::FromString ( std::string const &  guidString)
static

Definition at line 564 of file ObjectGuid.cpp.

+ Here is the caller graph for this function:

◆ GetCounter()

LowType ObjectGuid::GetCounter ( ) const
inline

Definition at line 293 of file ObjectGuid.h.

◆ GetEntry()

uint32 ObjectGuid::GetEntry ( ) const
inline

Definition at line 291 of file ObjectGuid.h.

+ Here is the caller graph for this function:

◆ GetHash()

std::size_t ObjectGuid::GetHash ( ) const

Definition at line 569 of file ObjectGuid.cpp.

+ Here is the call graph for this function:

◆ GetHigh()

HighGuid ObjectGuid::GetHigh ( ) const
inline

Definition at line 288 of file ObjectGuid.h.

+ Here is the caller graph for this function:

◆ GetMapId()

uint32 ObjectGuid::GetMapId ( ) const
inline

Definition at line 290 of file ObjectGuid.h.

◆ GetMaxCounter() [1/2]

LowType ObjectGuid::GetMaxCounter ( ) const
inline

Definition at line 317 of file ObjectGuid.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetMaxCounter() [2/2]

static LowType ObjectGuid::GetMaxCounter ( HighGuid  high)
inlinestatic

Definition at line 305 of file ObjectGuid.h.

◆ GetRawValue() [1/2]

std::vector< uint8 > ObjectGuid::GetRawValue ( ) const

Definition at line 577 of file ObjectGuid.cpp.

◆ GetRawValue() [2/2]

uint64 ObjectGuid::GetRawValue ( std::size_t  i) const
inline

Definition at line 282 of file ObjectGuid.h.

+ Here is the caller graph for this function:

◆ GetRealmId()

uint32 ObjectGuid::GetRealmId ( ) const
inline

Definition at line 289 of file ObjectGuid.h.

◆ GetSubType()

uint32 ObjectGuid::GetSubType ( ) const
inline

Definition at line 292 of file ObjectGuid.h.

◆ GetTypeName() [1/2]

char const * ObjectGuid::GetTypeName ( ) const
inline

Definition at line 353 of file ObjectGuid.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTypeName() [2/2]

char const * ObjectGuid::GetTypeName ( HighGuid  high)
static

Definition at line 546 of file ObjectGuid.cpp.

+ Here is the caller graph for this function:

◆ IsAnyTypeCreature()

bool ObjectGuid::IsAnyTypeCreature ( ) const
inline

Definition at line 325 of file ObjectGuid.h.

+ Here is the caller graph for this function:

◆ IsAnyTypeGameObject()

bool ObjectGuid::IsAnyTypeGameObject ( ) const
inline

Definition at line 334 of file ObjectGuid.h.

+ Here is the caller graph for this function:

◆ IsAreaTrigger()

bool ObjectGuid::IsAreaTrigger ( ) const
inline

Definition at line 332 of file ObjectGuid.h.

◆ IsCast()

bool ObjectGuid::IsCast ( ) const
inline

Definition at line 339 of file ObjectGuid.h.

◆ IsConversation()

bool ObjectGuid::IsConversation ( ) const
inline

Definition at line 338 of file ObjectGuid.h.

◆ IsCorpse()

bool ObjectGuid::IsCorpse ( ) const
inline

Definition at line 331 of file ObjectGuid.h.

+ Here is the caller graph for this function:

◆ IsCreature()

bool ObjectGuid::IsCreature ( ) const
inline

Definition at line 320 of file ObjectGuid.h.

+ Here is the caller graph for this function:

◆ IsCreatureOrPet()

bool ObjectGuid::IsCreatureOrPet ( ) const
inline

Definition at line 323 of file ObjectGuid.h.

◆ IsCreatureOrVehicle()

bool ObjectGuid::IsCreatureOrVehicle ( ) const
inline

Definition at line 324 of file ObjectGuid.h.

+ Here is the caller graph for this function:

◆ IsDynamicObject()

bool ObjectGuid::IsDynamicObject ( ) const
inline

Definition at line 330 of file ObjectGuid.h.

◆ IsEmpty()

bool ObjectGuid::IsEmpty ( ) const
inline

Definition at line 319 of file ObjectGuid.h.

◆ IsGameObject()

bool ObjectGuid::IsGameObject ( ) const
inline

Definition at line 329 of file ObjectGuid.h.

+ Here is the caller graph for this function:

◆ IsGuild()

bool ObjectGuid::IsGuild ( ) const
inline

Definition at line 336 of file ObjectGuid.h.

+ Here is the caller graph for this function:

◆ IsItem()

bool ObjectGuid::IsItem ( ) const
inline

Definition at line 328 of file ObjectGuid.h.

+ Here is the caller graph for this function:

◆ IsMOTransport()

bool ObjectGuid::IsMOTransport ( ) const
inline

Definition at line 333 of file ObjectGuid.h.

+ Here is the caller graph for this function:

◆ IsParty()

bool ObjectGuid::IsParty ( ) const
inline

Definition at line 335 of file ObjectGuid.h.

+ Here is the caller graph for this function:

◆ IsPet()

bool ObjectGuid::IsPet ( ) const
inline

Definition at line 321 of file ObjectGuid.h.

+ Here is the caller graph for this function:

◆ IsPlayer()

bool ObjectGuid::IsPlayer ( ) const
inline

Definition at line 326 of file ObjectGuid.h.

+ Here is the caller graph for this function:

◆ IsSceneObject()

bool ObjectGuid::IsSceneObject ( ) const
inline

Definition at line 337 of file ObjectGuid.h.

◆ IsUnit()

bool ObjectGuid::IsUnit ( ) const
inline

Definition at line 327 of file ObjectGuid.h.

+ Here is the caller graph for this function:

◆ IsVehicle()

bool ObjectGuid::IsVehicle ( ) const
inline

Definition at line 322 of file ObjectGuid.h.

+ Here is the caller graph for this function:

◆ operator!()

bool ObjectGuid::operator! ( ) const
inline

Definition at line 341 of file ObjectGuid.h.

◆ operator<=>()

std::strong_ordering ObjectGuid::operator<=> ( ObjectGuid const &  right) const
inline

Definition at line 343 of file ObjectGuid.h.

+ Here is the call graph for this function:

◆ operator==()

bool ObjectGuid::operator== ( ObjectGuid const &  right) const
default

◆ SetRawValue() [1/2]

void ObjectGuid::SetRawValue ( std::vector< uint8 > const &  guid)

Definition at line 584 of file ObjectGuid.cpp.

+ Here is the caller graph for this function:

◆ SetRawValue() [2/2]

void ObjectGuid::SetRawValue ( uint64  high,
uint64  low 
)
inline

Definition at line 285 of file ObjectGuid.h.

◆ ToHexString()

std::string ObjectGuid::ToHexString ( ) const

Definition at line 559 of file ObjectGuid.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ToString()

std::string ObjectGuid::ToString ( ) const

Definition at line 554 of file ObjectGuid.cpp.

Friends And Related Function Documentation

◆ ObjectGuidFactory

friend class ObjectGuidFactory
friend

Definition at line 269 of file ObjectGuid.h.

◆ operator<<

TC_GAME_API ByteBuffer & operator<< ( ByteBuffer buf,
ObjectGuid const &  guid 
)
friend

Definition at line 758 of file ObjectGuid.cpp.

◆ operator>>

TC_GAME_API ByteBuffer & operator>> ( ByteBuffer buf,
ObjectGuid guid 
)
friend

Definition at line 779 of file ObjectGuid.cpp.

Member Data Documentation

◆ _data

std::array<uint64, 2> ObjectGuid::_data = { }
protected

Definition at line 387 of file ObjectGuid.h.

◆ Empty

ObjectGuid const ObjectGuid::Empty = ObjectGuid()
static

Definition at line 274 of file ObjectGuid.h.

◆ FromStringFailed

ObjectGuid const ObjectGuid::FromStringFailed = ObjectGuid::Create<HighGuid::Uniq>(UI64LIT(4))
static

Definition at line 275 of file ObjectGuid.h.

◆ TradeItem

ObjectGuid const ObjectGuid::TradeItem = ObjectGuid::Create<HighGuid::Uniq>(UI64LIT(10))
static

Definition at line 276 of file ObjectGuid.h.


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