TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
UpdateData Class Reference

#include <UpdateData.h>

Public Member Functions

 UpdateData (uint32 map)
 
 UpdateData (UpdateData &&right)
 
void AddOutOfRangeGUID (GuidSet &guids)
 
void AddOutOfRangeGUID (ObjectGuid guid)
 
void AddUpdateBlock (const ByteBuffer &block)
 
bool BuildPacket (WorldPacket *packet)
 
bool HasData () const
 
void Clear ()
 
GuidSet constGetOutOfRangeGUIDs () const
 

Protected Member Functions

 UpdateData (UpdateData const &right)=delete
 
UpdateDataoperator= (UpdateData const &right)=delete
 

Protected Attributes

uint32 m_map
 
uint32 m_blockCount
 
GuidSet m_outOfRangeGUIDs
 
ByteBuffer m_data
 

Constructor & Destructor Documentation

UpdateData::UpdateData ( uint32  map)
25 : m_map(map), m_blockCount(0) { }
uint32 m_map
Definition: UpdateData.h:79
uint32 m_blockCount
Definition: UpdateData.h:80
UpdateData::UpdateData ( UpdateData &&  right)
inline
63  : m_map(right.m_map), m_blockCount(right.m_blockCount),
64  m_outOfRangeGUIDs(std::move(right.m_outOfRangeGUIDs)),
65  m_data(std::move(right.m_data))
66  {
67  }
uint32 m_map
Definition: UpdateData.h:79
ByteBuffer m_data
Definition: UpdateData.h:82
uint32 m_blockCount
Definition: UpdateData.h:80
GuidSet m_outOfRangeGUIDs
Definition: UpdateData.h:81
UpdateData::UpdateData ( UpdateData const right)
protecteddelete

Member Function Documentation

void UpdateData::AddOutOfRangeGUID ( GuidSet guids)
28 {
29  m_outOfRangeGUIDs.insert(guids.begin(), guids.end());
30 }
GuidSet m_outOfRangeGUIDs
Definition: UpdateData.h:81

+ Here is the caller graph for this function:

void UpdateData::AddOutOfRangeGUID ( ObjectGuid  guid)
33 {
34  m_outOfRangeGUIDs.insert(guid);
35 }
GuidSet m_outOfRangeGUIDs
Definition: UpdateData.h:81
void UpdateData::AddUpdateBlock ( const ByteBuffer block)
38 {
39  m_data.append(block);
40  ++m_blockCount;
41 }
void append(T value)
Definition: ByteBuffer.h:143
ByteBuffer m_data
Definition: UpdateData.h:82
uint32 m_blockCount
Definition: UpdateData.h:80

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool UpdateData::BuildPacket ( WorldPacket packet)
44 {
45  ASSERT(packet->empty()); // shouldn't happen
46  packet->Initialize(SMSG_UPDATE_OBJECT, 2 + 4 + (m_outOfRangeGUIDs.empty() ? 0 : 1 + 4 + 9 * m_outOfRangeGUIDs.size()) + m_data.wpos());
47 
48  *packet << uint32(m_blockCount);
49  *packet << uint16(m_map);
50 
51  if (packet->WriteBit(!m_outOfRangeGUIDs.empty()))
52  {
53  *packet << uint16(0);
54  *packet << uint32(m_outOfRangeGUIDs.size());
55 
56  for (GuidSet::const_iterator i = m_outOfRangeGUIDs.begin(); i != m_outOfRangeGUIDs.end(); ++i)
57  *packet << *i;
58  }
59 
60  *packet << uint32(m_data.size());
61  packet->append(m_data);
62  return true;
63 }
uint32 m_map
Definition: UpdateData.h:79
uint16_t uint16
Definition: g3dmath.h:166
bool WriteBit(uint32 bit)
Definition: ByteBuffer.h:170
size_t wpos() const
Definition: ByteBuffer.h:454
bool empty() const
Definition: ByteBuffer.h:588
size_t size() const
Definition: ByteBuffer.h:587
void append(T value)
Definition: ByteBuffer.h:143
ByteBuffer m_data
Definition: UpdateData.h:82
Definition: Opcodes.h:1601
uint32 m_blockCount
Definition: UpdateData.h:80
#define ASSERT
Definition: Errors.h:55
void Initialize(uint32 opcode, size_t newres=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
Definition: WorldPacket.h:71
uint32_t uint32
Definition: g3dmath.h:168
GuidSet m_outOfRangeGUIDs
Definition: UpdateData.h:81

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void UpdateData::Clear ( )
66 {
67  m_data.clear();
68  m_outOfRangeGUIDs.clear();
69  m_blockCount = 0;
70  m_map = 0;
71 }
uint32 m_map
Definition: UpdateData.h:79
ByteBuffer m_data
Definition: UpdateData.h:82
uint32 m_blockCount
Definition: UpdateData.h:80
GuidSet m_outOfRangeGUIDs
Definition: UpdateData.h:81
void clear()
Definition: ByteBuffer.h:134

+ Here is the call graph for this function:

GuidSet const& UpdateData::GetOutOfRangeGUIDs ( ) const
inline
76 { return m_outOfRangeGUIDs; }
GuidSet m_outOfRangeGUIDs
Definition: UpdateData.h:81
bool UpdateData::HasData ( ) const
inline
73 { return m_blockCount > 0 || !m_outOfRangeGUIDs.empty(); }
uint32 m_blockCount
Definition: UpdateData.h:80
GuidSet m_outOfRangeGUIDs
Definition: UpdateData.h:81

+ Here is the caller graph for this function:

UpdateData& UpdateData::operator= ( UpdateData const right)
protecteddelete

Member Data Documentation

uint32 UpdateData::m_blockCount
protected
ByteBuffer UpdateData::m_data
protected
uint32 UpdateData::m_map
protected
GuidSet UpdateData::m_outOfRangeGUIDs
protected

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