18 #ifndef PacketUtilities_h__
19 #define PacketUtilities_h__
41 data << v.
x << v.
y << v.
z;
47 data >> v.
x >> v.
y >> v.
z;
58 std::ostringstream builder;
59 builder <<
"Attempted to read more array elements from packet " << requestedSize <<
" than allowed " << sizeLimit;
60 message().assign(builder.str());
67 template<
typename T, std::size_t N = 1000 >
76 typedef typename storage_type::iterator
iterator;
132 template <
typename T>
197 template <
typename T>
198 ByteBuffer& operator<<(ByteBuffer& data, CompactArray<T>
const& v)
200 uint32 mask = v.GetMask();
202 for (
size_t i = 0; i < v.GetSize(); ++i)
211 template <
typename T>
217 for (
size_t index = 0; mask != 0; mask >>= 1, ++index)
231 #endif // PacketUtilities_h__
storage_type::reference reference
Definition: PacketUtilities.h:74
const_iterator begin() const
Definition: PacketUtilities.h:84
uint32 _mask
Definition: PacketUtilities.h:193
bool empty() const
Definition: PacketUtilities.h:90
float x
Definition: Vector3.h:62
reference operator[](size_type i)
Definition: PacketUtilities.h:92
size_t GetSize() const
Definition: PacketUtilities.h:164
Definition: ByteBuffer.h:70
iterator begin()
Definition: PacketUtilities.h:83
CompactArray & operator=(CompactArray const &right)
Definition: PacketUtilities.h:147
void push_back(value_type const &value)
Definition: PacketUtilities.h:111
size_type _limit
Definition: PacketUtilities.h:129
std::string & message()
Definition: ByteBuffer.h:48
storage_type::const_reference const_reference
Definition: PacketUtilities.h:75
std::vector< T > storage_type
Definition: PacketUtilities.h:70
storage_type::value_type value_type
Definition: PacketUtilities.h:72
bool operator!=(CompactArray const &r) const
Definition: PacketUtilities.h:190
float y
Definition: Vector3.h:62
Definition: PacketUtilities.h:133
void push_back(value_type &&value)
Definition: PacketUtilities.h:119
storage_type::const_iterator const_iterator
Definition: PacketUtilities.h:77
float y
Definition: Vector2.h:50
ByteBuffer & operator<<(ByteBuffer &data, G3D::Vector2 const &v)
Definition: PacketUtilities.h:27
const_iterator end() const
Definition: PacketUtilities.h:87
PacketArrayMaxCapacityException(std::size_t requestedSize, std::size_t sizeLimit)
Definition: PacketUtilities.h:56
uint32 GetMask() const
Definition: PacketUtilities.h:162
CompactArray(CompactArray &&right)
Definition: PacketUtilities.h:141
CompactArray(CompactArray const &right)
Definition: PacketUtilities.h:138
T const & operator[](size_t index) const
Definition: PacketUtilities.h:163
uint32_t uint32
Definition: Define.h:150
void Insert(size_t index, T const &value)
Definition: PacketUtilities.h:166
float x
Definition: Vector2.h:49
void resize(size_type newSize)
Definition: PacketUtilities.h:95
storage_type::size_type size_type
Definition: PacketUtilities.h:73
Definition: PacketUtilities.h:53
void reserve(size_type newSize)
Definition: PacketUtilities.h:103
Definition: BattlegroundMgr.h:57
std::vector< T > _contents
Definition: PacketUtilities.h:194
ByteBuffer & operator>>(ByteBuffer &data, CompactArray< T > &v)
Definition: PacketUtilities.h:212
const_reference operator[](size_type i) const
Definition: PacketUtilities.h:93
bool operator==(CompactArray const &r) const
Definition: PacketUtilities.h:182
float z
Definition: Vector3.h:62
CompactArray()
Definition: PacketUtilities.h:136
Array(size_type limit)
Definition: PacketUtilities.h:81
Definition: ByteBuffer.h:40
#define ASSERT
Definition: Errors.h:55
const FieldDescriptor value
Definition: descriptor.h:1522
uint32_t uint32
Definition: g3dmath.h:168
Array()
Definition: PacketUtilities.h:80
storage_type _storage
Definition: PacketUtilities.h:128
ByteBuffer & operator>>(ByteBuffer &data, G3D::Vector2 &v)
Definition: PacketUtilities.h:33
storage_type::iterator iterator
Definition: PacketUtilities.h:76
iterator end()
Definition: PacketUtilities.h:86
void Clear()
Definition: PacketUtilities.h:176
size_type size() const
Definition: PacketUtilities.h:89
Definition: PacketUtilities.h:68