TrinityCore
Loading...
Searching...
No Matches
ObjectGuid Class Reference

#include <ObjectGuid.h>

Public Types

using LowType = uint64
 

Public Member Functions

 ObjectGuid ()
 
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 &guid) const
 
bool operator!= (ObjectGuid const &guid) const
 
bool operator< (ObjectGuid const &guid) 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)
 

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

uint64 _data [2]
 

Friends

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

Member Typedef Documentation

◆ LowType

Constructor & Destructor Documentation

◆ ObjectGuid() [1/2]

ObjectGuid::ObjectGuid ( )
inline
270{ Clear(); }
void Clear()
Definition: ObjectGuid.h:276

◆ ObjectGuid() [2/2]

ObjectGuid::ObjectGuid ( uint64  high,
uint64  low 
)
inlineprotected
373 {
374 _data[0] = low;
375 _data[1] = high;
376 }
uint64 _data[2]
Definition: ObjectGuid.h:378

Member Function Documentation

◆ Clear()

void ObjectGuid::Clear ( )
inline
276{ std::fill(std::begin(_data), std::end(_data), UI64LIT(0)); }
#define UI64LIT(N)
Definition: Define.h:128

◆ Create() [1/19]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Null, ObjectGuid > ObjectGuid::Create ( )
inlinestatic
static ObjectGuid CreateNull()
Definition: ObjectGuid.cpp:575
+ Here is the call graph for this function:

◆ Create() [2/19]

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
359{ return ObjectGuidFactory::CreateChatChannel(0, builtIn, trade, zoneId, factionGroupMask, counter); }
static ObjectGuid CreateChatChannel(uint32 realmId, bool builtIn, bool trade, uint16 zoneId, uint8 factionGroupMask, uint64 counter)
Definition: ObjectGuid.cpp:626
+ Here is the call graph for this function:

◆ Create() [3/19]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Player, ObjectGuid > ObjectGuid::Create ( ObjectGuid::LowType  dbId)
inlinestatic
353{ return ObjectGuidFactory::CreatePlayer(0, dbId); }
static ObjectGuid CreatePlayer(uint32 realmId, uint64 dbId)
Definition: ObjectGuid.cpp:586
+ Here is the call graph for this function:

◆ Create() [4/19]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Item, ObjectGuid > ObjectGuid::Create ( ObjectGuid::LowType  dbId)
inlinestatic
354{ return ObjectGuidFactory::CreateItem(0, dbId); }
static ObjectGuid CreateItem(uint32 realmId, uint64 dbId)
Definition: ObjectGuid.cpp:593
+ Here is the call graph for this function:

◆ Create() [5/19]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Global, ObjectGuid > ObjectGuid::Create ( ObjectGuid::LowType  dbId)
inlinestatic
360{ return ObjectGuidFactory::CreateGlobal(type, UI64LIT(0), dbId); }
static ObjectGuid CreateGlobal(HighGuid type, uint64 dbIdHigh, uint64 dbId)
Definition: ObjectGuid.cpp:637
+ Here is the call graph for this function:

◆ Create() [6/19]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Guild, ObjectGuid > ObjectGuid::Create ( ObjectGuid::LowType  dbId)
inlinestatic
361{ return ObjectGuidFactory::CreateGuild(type, 0, dbId); }
static ObjectGuid CreateGuild(HighGuid type, uint32 realmId, uint64 dbId)
Definition: ObjectGuid.cpp:644
+ Here is the call graph for this function:

◆ Create() [7/19]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Uniq, ObjectGuid > ObjectGuid::Create ( ObjectGuid::LowType  id)
inlinestatic
352{ return ObjectGuidFactory::CreateUniq(id); }
static ObjectGuid CreateUniq(uint64 id)
Definition: ObjectGuid.cpp:580
+ Here is the call graph for this function:

◆ Create() [8/19]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::MobileSession, ObjectGuid > ObjectGuid::Create ( uint16  arg1,
ObjectGuid::LowType  counter 
)
inlinestatic
362{ return ObjectGuidFactory::CreateMobileSession(0, arg1, counter); }
static ObjectGuid CreateMobileSession(uint32 realmId, uint16 arg1, uint64 counter)
Definition: ObjectGuid.cpp:651
+ Here is the call graph for this function:

◆ Create() [9/19]

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
355{ return ObjectGuidFactory::CreateWorldObject(type, 0, 0, mapId, 0, entry, counter); }
static ObjectGuid CreateWorldObject(HighGuid type, uint8 subType, uint32 realmId, uint16 mapId, uint32 serverId, uint32 entry, uint64 counter)
Definition: ObjectGuid.cpp:600
+ Here is the call graph for this function:

◆ Create() [10/19]

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
368{ return ObjectGuidFactory::CreateToolsClient(mapId, serverId, counter); }
static ObjectGuid CreateToolsClient(uint16 mapId, uint32 serverId, uint64 counter)
Definition: ObjectGuid.cpp:704
+ Here is the call graph for this function:

◆ Create() [11/19]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::ClientActor, ObjectGuid > ObjectGuid::Create ( uint16  ownerType,
uint16  ownerId,
uint32  counter 
)
inlinestatic
358{ return ObjectGuidFactory::CreateClientActor(ownerType, ownerId, counter); }
static ObjectGuid CreateClientActor(uint16 ownerType, uint16 ownerId, uint32 counter)
Definition: ObjectGuid.cpp:618
+ Here is the call graph for this function:

◆ Create() [12/19]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Client, ObjectGuid > ObjectGuid::Create ( uint32  arg1,
ObjectGuid::LowType  counter 
)
inlinestatic
366{ return ObjectGuidFactory::CreateClient(type, 0, arg1, counter); }
static ObjectGuid CreateClient(HighGuid type, uint32 realmId, uint32 arg1, uint64 counter)
Definition: ObjectGuid.cpp:687
+ Here is the call graph for this function:

◆ Create() [13/19]

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
369{ return ObjectGuidFactory::CreateWorldLayer(arg1, arg2, arg3, arg4); }
static ObjectGuid CreateWorldLayer(uint32 arg1, uint16 arg2, uint8 arg3, uint32 arg4)
Definition: ObjectGuid.cpp:712
+ Here is the call graph for this function:

◆ Create() [14/19]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::Transport, ObjectGuid > ObjectGuid::Create ( uint32  counter)
inlinestatic
357{ return ObjectGuidFactory::CreateTransport(type, counter); }
static ObjectGuid CreateTransport(HighGuid type, uint32 counter)
Definition: ObjectGuid.cpp:611
+ Here is the call graph for this function:

◆ Create() [15/19]

template<HighGuid type>
static std::enable_if_t< ObjectGuidTraits< type >::Format::value==ObjectGuidFormatType::LFGList, ObjectGuid > ObjectGuid::Create ( uint8  arg1,
ObjectGuid::LowType  counter 
)
inlinestatic
365{ return ObjectGuidFactory::CreateLFGList(arg1, counter); }
static ObjectGuid CreateLFGList(uint8 arg1, uint64 counter)
Definition: ObjectGuid.cpp:680
+ Here is the call graph for this function:

◆ Create() [16/19]

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
363{ return ObjectGuidFactory::CreateWebObj(0, arg1, arg2, counter); }
static ObjectGuid CreateWebObj(uint32 realmId, uint8 arg1, uint8 arg2, uint64 counter)
Definition: ObjectGuid.cpp:659
+ Here is the call graph for this function:

◆ Create() [17/19]

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
364{ return ObjectGuidFactory::CreateLFGObject(arg1, arg2, arg3, arg4, arg5, arg6, counter); }
static ObjectGuid CreateLFGObject(uint8 arg1, uint8 arg2, uint8 arg3, uint8 arg4, bool arg5, uint8 arg6, uint64 counter)
Definition: ObjectGuid.cpp:668
+ Here is the call graph for this function:

◆ Create() [18/19]

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
367{ return ObjectGuidFactory::CreateClubFinder(0, clubType, clubFinderId, dbId); }
static ObjectGuid CreateClubFinder(uint32 realmId, uint8 type, uint32 clubFinderId, uint64 dbId)
Definition: ObjectGuid.cpp:695
+ Here is the call graph for this function:

◆ Create() [19/19]

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
356{ return ObjectGuidFactory::CreateWorldObject(type, subType, 0, mapId, 0, entry, counter); }
+ Here is the call graph for this function:

◆ FromString()

ObjectGuid ObjectGuid::FromString ( std::string const &  guidString)
static
542{
543 return Info.Parse(guidString);
544}
+ Here is the caller graph for this function:

◆ GetCounter()

LowType ObjectGuid::GetCounter ( ) const
inline
284 {
285 switch (GetHigh())
286 {
287 case HighGuid::Transport:
288 return (_data[1] >> 38) & UI64LIT(0xFFFFF);
289 default:
290 break;
291 }
292 return _data[0] & UI64LIT(0x000000FFFFFFFFFF);
293 }
HighGuid GetHigh() const
Definition: ObjectGuid.h:278

◆ GetEntry()

uint32 ObjectGuid::GetEntry ( ) const
inline
281{ return uint32((_data[1] >> 6) & 0x7FFFFF); }
uint32_t uint32
Definition: Define.h:143
+ Here is the caller graph for this function:

◆ GetHash()

std::size_t ObjectGuid::GetHash ( ) const
547{
548 std::size_t hashVal = 0;
549 Trinity::hash_combine(hashVal, _data[0]);
550 Trinity::hash_combine(hashVal, _data[1]);
551 return hashVal;
552}
void hash_combine(std::size_t &seed, T const &val)
Definition: Hash.h:27
+ Here is the call graph for this function:

◆ GetHigh()

HighGuid ObjectGuid::GetHigh ( ) const
inline
278{ return HighGuid((_data[1] >> 58) & 0x3F); }
HighGuid
Definition: ObjectGuid.h:71
+ Here is the caller graph for this function:

◆ GetMapId()

uint32 ObjectGuid::GetMapId ( ) const
inline
280{ return uint32((_data[1] >> 29) & 0x1FFF); }

◆ GetMaxCounter() [1/2]

LowType ObjectGuid::GetMaxCounter ( ) const
inline
307{ return GetMaxCounter(GetHigh()); }
LowType GetMaxCounter() const
Definition: ObjectGuid.h:307
+ 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
296 {
297 switch (high)
298 {
299 case HighGuid::Transport:
300 return UI64LIT(0xFFFFF);
301 default:
302 break;
303 }
304 return UI64LIT(0xFFFFFFFFFF);
305 }

◆ GetRawValue() [1/2]

std::vector< uint8 > ObjectGuid::GetRawValue ( ) const
555{
556 std::vector<uint8> raw(16);
557 memcpy(raw.data(), this, sizeof(*this));
558 return raw;
559}

◆ GetRawValue() [2/2]

uint64 ObjectGuid::GetRawValue ( std::size_t  i) const
inline
272{ return _data[i]; }
+ Here is the caller graph for this function:

◆ GetRealmId()

uint32 ObjectGuid::GetRealmId ( ) const
inline
279{ return uint32((_data[1] >> 42) & 0xFFFF); }

◆ GetSubType()

uint32 ObjectGuid::GetSubType ( ) const
inline
282{ return uint32(_data[1] & 0x3F); }

◆ GetTypeName() [1/2]

char const * ObjectGuid::GetTypeName ( ) const
inline
345{ return !IsEmpty() ? GetTypeName(GetHigh()) : "None"; }
bool IsEmpty() const
Definition: ObjectGuid.h:309
char const * GetTypeName() const
Definition: ObjectGuid.h:345
+ 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
524{
525 if (high >= HighGuid::Count)
526 return "<unknown>";
527
528 return Info.Names[uint32(high)].c_str();
529}
+ Here is the caller graph for this function:

◆ IsAnyTypeCreature()

bool ObjectGuid::IsAnyTypeCreature ( ) const
inline
315{ return IsCreature() || IsPet() || IsVehicle(); }
bool IsVehicle() const
Definition: ObjectGuid.h:312
bool IsCreature() const
Definition: ObjectGuid.h:310
bool IsPet() const
Definition: ObjectGuid.h:311
+ Here is the caller graph for this function:

◆ IsAnyTypeGameObject()

bool ObjectGuid::IsAnyTypeGameObject ( ) const
inline
324{ return IsGameObject() || IsMOTransport(); }
bool IsMOTransport() const
Definition: ObjectGuid.h:323
bool IsGameObject() const
Definition: ObjectGuid.h:319
+ Here is the caller graph for this function:

◆ IsAreaTrigger()

bool ObjectGuid::IsAreaTrigger ( ) const
inline
322{ return GetHigh() == HighGuid::AreaTrigger; }

◆ IsCast()

bool ObjectGuid::IsCast ( ) const
inline
329{ return GetHigh() == HighGuid::Cast; }

◆ IsConversation()

bool ObjectGuid::IsConversation ( ) const
inline
328{ return GetHigh() == HighGuid::Conversation; }

◆ IsCorpse()

bool ObjectGuid::IsCorpse ( ) const
inline
321{ return GetHigh() == HighGuid::Corpse; }
+ Here is the caller graph for this function:

◆ IsCreature()

bool ObjectGuid::IsCreature ( ) const
inline
310{ return GetHigh() == HighGuid::Creature; }
+ Here is the caller graph for this function:

◆ IsCreatureOrPet()

bool ObjectGuid::IsCreatureOrPet ( ) const
inline
313{ return IsCreature() || IsPet(); }

◆ IsCreatureOrVehicle()

bool ObjectGuid::IsCreatureOrVehicle ( ) const
inline
314{ return IsCreature() || IsVehicle(); }
+ Here is the caller graph for this function:

◆ IsDynamicObject()

bool ObjectGuid::IsDynamicObject ( ) const
inline
320{ return GetHigh() == HighGuid::DynamicObject; }

◆ IsEmpty()

bool ObjectGuid::IsEmpty ( ) const
inline
309{ return _data[0] == 0 && _data[1] == 0; }

◆ IsGameObject()

bool ObjectGuid::IsGameObject ( ) const
inline
319{ return GetHigh() == HighGuid::GameObject; }
+ Here is the caller graph for this function:

◆ IsGuild()

bool ObjectGuid::IsGuild ( ) const
inline
326{ return GetHigh() == HighGuid::Guild; }
+ Here is the caller graph for this function:

◆ IsItem()

bool ObjectGuid::IsItem ( ) const
inline
318{ return GetHigh() == HighGuid::Item; }
+ Here is the caller graph for this function:

◆ IsMOTransport()

bool ObjectGuid::IsMOTransport ( ) const
inline
323{ return GetHigh() == HighGuid::Transport; }
+ Here is the caller graph for this function:

◆ IsParty()

bool ObjectGuid::IsParty ( ) const
inline
325{ return GetHigh() == HighGuid::Party; }
+ Here is the caller graph for this function:

◆ IsPet()

bool ObjectGuid::IsPet ( ) const
inline
311{ return GetHigh() == HighGuid::Pet; }
+ Here is the caller graph for this function:

◆ IsPlayer()

bool ObjectGuid::IsPlayer ( ) const
inline
316{ return !IsEmpty() && GetHigh() == HighGuid::Player; }
+ Here is the caller graph for this function:

◆ IsSceneObject()

bool ObjectGuid::IsSceneObject ( ) const
inline
327{ return GetHigh() == HighGuid::SceneObject; }

◆ IsUnit()

bool ObjectGuid::IsUnit ( ) const
inline
317{ return IsAnyTypeCreature() || IsPlayer(); }
bool IsPlayer() const
Definition: ObjectGuid.h:316
bool IsAnyTypeCreature() const
Definition: ObjectGuid.h:315
+ Here is the caller graph for this function:

◆ IsVehicle()

bool ObjectGuid::IsVehicle ( ) const
inline
312{ return GetHigh() == HighGuid::Vehicle; }
+ Here is the caller graph for this function:

◆ operator!()

bool ObjectGuid::operator! ( ) const
inline
331{ return IsEmpty(); }

◆ operator!=()

bool ObjectGuid::operator!= ( ObjectGuid const &  guid) const
inline
333{ return !(*this == guid); }

◆ operator<()

bool ObjectGuid::operator< ( ObjectGuid const &  guid) const
inline
335 {
336 if (_data[1] < guid._data[1])
337 return true;
338 else if (_data[1] > guid._data[1])
339 return false;
340
341 return _data[0] < guid._data[0];
342 }

◆ operator==()

bool ObjectGuid::operator== ( ObjectGuid const &  guid) const
inline
332{ return _data[0] == guid._data[0] && _data[1] == guid._data[1]; }

◆ SetRawValue() [1/2]

void ObjectGuid::SetRawValue ( std::vector< uint8 > const &  guid)
562{
563 ASSERT(guid.size() == sizeof(*this));
564 memcpy(this, guid.data(), sizeof(*this));
565}
#define ASSERT
Definition: Errors.h:68
+ Here is the caller graph for this function:

◆ SetRawValue() [2/2]

void ObjectGuid::SetRawValue ( uint64  high,
uint64  low 
)
inline
275{ _data[0] = low; _data[1] = high; }

◆ ToHexString()

std::string ObjectGuid::ToHexString ( ) const
537{
538 return Trinity::StringFormat("0x%016llX%016llX", _data[1], _data[0]);
539}
std::string StringFormat(FormatString< Args... > fmt, Args &&... args)
Default TC string format function.
Definition: StringFormat.h:30
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ToString()

std::string ObjectGuid::ToString ( ) const
532{
533 return Info.Format(*this);
534}

Friends And Related Function Documentation

◆ ObjectGuidFactory

friend class ObjectGuidFactory
friend

◆ operator<<

TC_GAME_API ByteBuffer & operator<< ( ByteBuffer buf,
ObjectGuid const &  guid 
)
friend
726{
727 uint8 lowMask = 0;
728 uint8 highMask = 0;
729 buf.FlushBits(); // flush any unwritten bits to make wpos return a meaningful value
730 std::size_t pos = buf.wpos();
731 buf << uint8(lowMask);
732 buf << uint8(highMask);
733
734 uint8 packed[8];
735 if (size_t packedSize = ByteBuffer::PackUInt64(guid._data[0], &lowMask, packed))
736 buf.append(packed, packedSize);
737 if (size_t packedSize = ByteBuffer::PackUInt64(guid._data[1], &highMask, packed))
738 buf.append(packed, packedSize);
739
740 buf.put(pos, lowMask);
741 buf.put(pos + 1, highMask);
742
743 return buf;
744}
uint8_t uint8
Definition: Define.h:145
static size_t PackUInt64(uint64 value, uint8 *mask, uint8 *result)
Definition: ByteBuffer.h:607
void append(T value)
Definition: ByteBuffer.h:143
size_t wpos() const
Definition: ByteBuffer.h:412
void put(std::size_t pos, T value)
Definition: ByteBuffer.h:220
void FlushBits()
Definition: ByteBuffer.h:155

◆ operator>>

TC_GAME_API ByteBuffer & operator>> ( ByteBuffer buf,
ObjectGuid guid 
)
friend
747{
748 uint8 lowMask, highMask;
749 buf >> lowMask >> highMask;
750 buf.ReadPackedUInt64(lowMask, guid._data[0]);
751 buf.ReadPackedUInt64(highMask, guid._data[1]);
752 return buf;
753}
void ReadPackedUInt64(uint64 &guid)
Definition: ByteBuffer.h:485

Member Data Documentation

◆ _data

uint64 ObjectGuid::_data[2]
protected

◆ Empty

ObjectGuid const ObjectGuid::Empty = ObjectGuid()
static

◆ FromStringFailed

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

◆ TradeItem

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

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