TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
WorldPackets::CompactArray< T > Class Template Reference

#include <PacketUtilities.h>

Public Member Functions

 CompactArray ()
 
 CompactArray (CompactArray const &right)
 
 CompactArray (CompactArray &&right)
 
CompactArrayoperator= (CompactArray const &right)
 
CompactArrayoperator= (CompactArray &&right)
 
uint32 GetMask () const
 
T constoperator[] (size_t index) const
 
size_t GetSize () const
 
void Insert (size_t index, T const &value)
 
void Clear ()
 
bool operator== (CompactArray const &r) const
 
bool operator!= (CompactArray const &r) const
 

Private Attributes

uint32 _mask
 
std::vector< T > _contents
 

Constructor & Destructor Documentation

template<typename T>
WorldPackets::CompactArray< T >::CompactArray ( )
inline
136 : _mask(0) { }
uint32 _mask
Definition: PacketUtilities.h:193
template<typename T>
WorldPackets::CompactArray< T >::CompactArray ( CompactArray< T > const right)
inline
139  : _mask(right._mask), _contents(right._contents) { }
uint32 _mask
Definition: PacketUtilities.h:193
std::vector< T > _contents
Definition: PacketUtilities.h:194
template<typename T>
WorldPackets::CompactArray< T >::CompactArray ( CompactArray< T > &&  right)
inline
142  : _mask(right._mask), _contents(std::move(right._contents))
143  {
144  right._mask = 0;
145  }
uint32 _mask
Definition: PacketUtilities.h:193
std::vector< T > _contents
Definition: PacketUtilities.h:194

Member Function Documentation

template<typename T>
void WorldPackets::CompactArray< T >::Clear ( )
inline
177  {
178  _mask = 0;
179  _contents.clear();
180  }
uint32 _mask
Definition: PacketUtilities.h:193
std::vector< T > _contents
Definition: PacketUtilities.h:194
template<typename T>
uint32 WorldPackets::CompactArray< T >::GetMask ( ) const
inline
162 { return _mask; }
uint32 _mask
Definition: PacketUtilities.h:193
template<typename T>
size_t WorldPackets::CompactArray< T >::GetSize ( ) const
inline
164 { return _contents.size(); }
std::vector< T > _contents
Definition: PacketUtilities.h:194
template<typename T>
void WorldPackets::CompactArray< T >::Insert ( size_t  index,
T const value 
)
inline
167  {
168  ASSERT(index < 0x20);
169 
170  _mask |= 1 << index;
171  if (_contents.size() <= index)
172  _contents.resize(index + 1);
173  _contents[index] = value;
174  }
uint32 _mask
Definition: PacketUtilities.h:193
std::vector< T > _contents
Definition: PacketUtilities.h:194
#define ASSERT
Definition: Errors.h:55
const FieldDescriptor value
Definition: descriptor.h:1522

+ Here is the caller graph for this function:

template<typename T>
bool WorldPackets::CompactArray< T >::operator!= ( CompactArray< T > const r) const
inline
190 { return !(*this == r); }
template<typename T>
CompactArray& WorldPackets::CompactArray< T >::operator= ( CompactArray< T > const right)
inline
148  {
149  _mask = right._mask;
150  _contents = right._contents;
151  return *this;
152  }
uint32 _mask
Definition: PacketUtilities.h:193
std::vector< T > _contents
Definition: PacketUtilities.h:194
template<typename T>
CompactArray& WorldPackets::CompactArray< T >::operator= ( CompactArray< T > &&  right)
inline
155  {
156  _mask = right._mask;
157  right._mask = 0;
158  _contents = std::move(right._contents);
159  return *this;
160  }
uint32 _mask
Definition: PacketUtilities.h:193
std::vector< T > _contents
Definition: PacketUtilities.h:194
template<typename T>
bool WorldPackets::CompactArray< T >::operator== ( CompactArray< T > const r) const
inline
183  {
184  if (_mask != r._mask)
185  return false;
186 
187  return _contents == r._contents;
188  }
uint32 _mask
Definition: PacketUtilities.h:193
std::vector< T > _contents
Definition: PacketUtilities.h:194
template<typename T>
T const& WorldPackets::CompactArray< T >::operator[] ( size_t  index) const
inline
163 { return _contents.at(index); }
std::vector< T > _contents
Definition: PacketUtilities.h:194

Member Data Documentation

template<typename T>
std::vector<T> WorldPackets::CompactArray< T >::_contents
private
template<typename T>
uint32 WorldPackets::CompactArray< T >::_mask
private

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