AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
ObjectGuid.h File Reference
#include "ByteBuffer.h"
#include "Define.h"
#include <deque>
#include <functional>
#include <list>
#include <set>
#include <unordered_set>
#include <vector>

Go to the source code of this file.

Classes

struct  ObjectGuidTraits< high >
 
struct  PackedGuidReader
 
class  ObjectGuid
 
class  PackedGuid
 
class  ObjectGuidGeneratorBase
 
class  ObjectGuidGenerator< high >
 
struct  std::hash< ObjectGuid >
 

Namespaces

namespace  std
 

Macros

#define NUM_CLIENT_OBJECT_TYPES   8
 
#define GUID_TRAIT_GLOBAL(highguid)
 
#define GUID_TRAIT_MAP_SPECIFIC(highguid)
 
#define PACKED_GUID_MIN_BUFFER_SIZE   9
 

Typedefs

typedef std::set< ObjectGuidGuidSet
 
typedef std::list< ObjectGuidGuidList
 
typedef std::deque< ObjectGuidGuidDeque
 
typedef std::vector< ObjectGuidGuidVector
 
typedef std::unordered_set< ObjectGuidGuidUnorderedSet
 

Enumerations

enum  TypeID {
  TYPEID_OBJECT = 0 ,
  TYPEID_ITEM = 1 ,
  TYPEID_CONTAINER = 2 ,
  TYPEID_UNIT = 3 ,
  TYPEID_PLAYER = 4 ,
  TYPEID_GAMEOBJECT = 5 ,
  TYPEID_DYNAMICOBJECT = 6 ,
  TYPEID_CORPSE = 7
}
 
enum  TypeMask {
  TYPEMASK_OBJECT = 0x0001 ,
  TYPEMASK_ITEM = 0x0002 ,
  TYPEMASK_CONTAINER = 0x0006 ,
  TYPEMASK_UNIT = 0x0008 ,
  TYPEMASK_PLAYER = 0x0010 ,
  TYPEMASK_GAMEOBJECT = 0x0020 ,
  TYPEMASK_DYNAMICOBJECT = 0x0040 ,
  TYPEMASK_CORPSE = 0x0080 ,
  TYPEMASK_SEER = TYPEMASK_PLAYER | TYPEMASK_UNIT | TYPEMASK_DYNAMICOBJECT
}
 
enum class  HighGuid {
  Item = 0x4000 ,
  Container = 0x4000 ,
  Player = 0x0000 ,
  GameObject = 0xF110 ,
  Transport = 0xF120 ,
  Unit = 0xF130 ,
  Pet = 0xF140 ,
  Vehicle = 0xF150 ,
  DynamicObject = 0xF100 ,
  Corpse = 0xF101 ,
  Mo_Transport = 0x1FC0 ,
  Instance = 0x1F40 ,
  Group = 0x1F50
}
 

Functions

ByteBufferoperator<< (ByteBuffer &buf, ObjectGuid const &guid)
 
ByteBufferoperator>> (ByteBuffer &buf, ObjectGuid &guid)
 
ByteBufferoperator<< (ByteBuffer &buf, PackedGuid const &guid)
 
ByteBufferoperator>> (ByteBuffer &buf, PackedGuidReader const &guid)
 

Macro Definition Documentation

◆ GUID_TRAIT_GLOBAL

#define GUID_TRAIT_GLOBAL (   highguid)
Value:
template<> struct ObjectGuidTraits<highguid> \
{ \
static bool const Global = true; \
static bool const MapSpecific = false; \
};
Definition: ObjectGuid.h:76
static bool const MapSpecific
Definition: ObjectGuid.h:78
static bool const Global
Definition: ObjectGuid.h:77

◆ GUID_TRAIT_MAP_SPECIFIC

#define GUID_TRAIT_MAP_SPECIFIC (   highguid)
Value:
template<> struct ObjectGuidTraits<highguid> \
{ \
static bool const Global = false; \
static bool const MapSpecific = true; \
};

◆ NUM_CLIENT_OBJECT_TYPES

#define NUM_CLIENT_OBJECT_TYPES   8

◆ PACKED_GUID_MIN_BUFFER_SIZE

#define PACKED_GUID_MIN_BUFFER_SIZE   9

Typedef Documentation

◆ GuidDeque

typedef std::deque<ObjectGuid> GuidDeque

◆ GuidList

typedef std::list<ObjectGuid> GuidList

◆ GuidSet

typedef std::set<ObjectGuid> GuidSet

◆ GuidUnorderedSet

typedef std::unordered_set<ObjectGuid> GuidUnorderedSet

◆ GuidVector

typedef std::vector<ObjectGuid> GuidVector

Enumeration Type Documentation

◆ HighGuid

enum class HighGuid
strong
Enumerator
Item 
Container 
Player 
GameObject 
Transport 
Unit 
Pet 
Vehicle 
DynamicObject 
Corpse 
Mo_Transport 
Instance 
Group 
58{
59 Item = 0x4000, // blizz 4000
60 Container = 0x4000, // blizz 4000
61 Player = 0x0000, // blizz 0000
62 GameObject = 0xF110, // blizz F110
63 Transport = 0xF120, // blizz F120 (for GAMEOBJECT_TYPE_TRANSPORT)
64 Unit = 0xF130, // blizz F130
65 Pet = 0xF140, // blizz F140
66 Vehicle = 0xF150, // blizz F550
67 DynamicObject = 0xF100, // blizz F100
68 Corpse = 0xF101, // blizz F100
69 Mo_Transport = 0x1FC0, // blizz 1FC0 (for GAMEOBJECT_TYPE_MO_TRANSPORT)
70 Instance = 0x1F40, // blizz 1F40
71 Group = 0x1F50,
72};
Definition: Corpse.h:49
Definition: DynamicObject.h:35
Definition: GameObject.h:121
Definition: Item.h:220
Definition: Pet.h:41
Definition: Player.h:1064
Definition: Transport.h:29
Definition: Unit.h:630
Definition: Vehicle.h:28
Definition: Group.h:169

◆ TypeID

enum TypeID
Enumerator
TYPEID_OBJECT 
TYPEID_ITEM 
TYPEID_CONTAINER 
TYPEID_UNIT 
TYPEID_PLAYER 
TYPEID_GAMEOBJECT 
TYPEID_DYNAMICOBJECT 
TYPEID_CORPSE 
31{
32 TYPEID_OBJECT = 0,
33 TYPEID_ITEM = 1,
35 TYPEID_UNIT = 3,
36 TYPEID_PLAYER = 4,
40};
@ TYPEID_OBJECT
Definition: ObjectGuid.h:32
@ TYPEID_DYNAMICOBJECT
Definition: ObjectGuid.h:38
@ TYPEID_GAMEOBJECT
Definition: ObjectGuid.h:37
@ TYPEID_UNIT
Definition: ObjectGuid.h:35
@ TYPEID_CORPSE
Definition: ObjectGuid.h:39
@ TYPEID_ITEM
Definition: ObjectGuid.h:33
@ TYPEID_PLAYER
Definition: ObjectGuid.h:36
@ TYPEID_CONTAINER
Definition: ObjectGuid.h:34

◆ TypeMask

enum TypeMask
Enumerator
TYPEMASK_OBJECT 
TYPEMASK_ITEM 
TYPEMASK_CONTAINER 
TYPEMASK_UNIT 
TYPEMASK_PLAYER 
TYPEMASK_GAMEOBJECT 
TYPEMASK_DYNAMICOBJECT 
TYPEMASK_CORPSE 
TYPEMASK_SEER 
45{
46 TYPEMASK_OBJECT = 0x0001,
47 TYPEMASK_ITEM = 0x0002,
48 TYPEMASK_CONTAINER = 0x0006, // TYPEMASK_ITEM | 0x0004
49 TYPEMASK_UNIT = 0x0008, // creature
50 TYPEMASK_PLAYER = 0x0010,
51 TYPEMASK_GAMEOBJECT = 0x0020,
53 TYPEMASK_CORPSE = 0x0080,
55};
@ TYPEMASK_OBJECT
Definition: ObjectGuid.h:46
@ TYPEMASK_ITEM
Definition: ObjectGuid.h:47
@ TYPEMASK_DYNAMICOBJECT
Definition: ObjectGuid.h:52
@ TYPEMASK_SEER
Definition: ObjectGuid.h:54
@ TYPEMASK_UNIT
Definition: ObjectGuid.h:49
@ TYPEMASK_CONTAINER
Definition: ObjectGuid.h:48
@ TYPEMASK_CORPSE
Definition: ObjectGuid.h:53
@ TYPEMASK_GAMEOBJECT
Definition: ObjectGuid.h:51
@ TYPEMASK_PLAYER
Definition: ObjectGuid.h:50

Function Documentation

◆ operator<<() [1/2]

ByteBuffer & operator<< ( ByteBuffer buf,
ObjectGuid const &  guid 
)
70{
71 buf << uint64(guid.GetRawValue());
72 return buf;
73}
std::uint64_t uint64
Definition: Define.h:106

References ObjectGuid::GetRawValue().

Referenced by ByteBuffer::operator<<().

◆ operator<<() [2/2]

ByteBuffer & operator<< ( ByteBuffer buf,
PackedGuid const &  guid 
)
82{
83 buf.append(guid._packedGuid);
84 return buf;
85}
void append(T value)
Definition: ByteBuffer.h:129

◆ operator>>() [1/2]

ByteBuffer & operator>> ( ByteBuffer buf,
ObjectGuid guid 
)
76{
77 guid.Set(buf.read<uint64>());
78 return buf;
79}
void Set(uint64 guid)
Definition: ObjectGuid.h:137
T read()
Definition: ByteBuffer.h:351

References ByteBuffer::read(), and ObjectGuid::Set().

◆ operator>>() [2/2]

ByteBuffer & operator>> ( ByteBuffer buf,
PackedGuidReader const &  guid 
)
88{
89 buf.readPackGUID(reinterpret_cast<uint64&>(guid.Guid));
90 return buf;
91}
void readPackGUID(uint64 &guid)
Definition: ByteBuffer.h:387

References PackedGuidReader::Guid, and ByteBuffer::readPackGUID().