EvEmu
0.8.4
11 September 2021
|
Python buffer. More...
#include "PyRep.h"
Public Member Functions | |
PyBuffer (size_t len, const uint8 &value) | |
template<typename Iter > | |
PyBuffer (Iter first, Iter last) | |
PyBuffer (const Buffer &buffer) | |
PyBuffer (Buffer **buffer) | |
PyBuffer (const PyString &str) | |
PyBuffer (const PyBuffer &oth) | |
PyRep * | Clone () const |
Clones object. More... | |
bool | visit (PyVisitor &v) const |
Visits object. More... | |
const Buffer & | content () const |
Get the const PyBuffer content. More... | |
int32 | hash () const |
virtual function to generate a hash value of a object. More... | |
size_t | size () const |
Obtains length of the buffer. More... | |
![]() | |
PyType | GetType () const |
bool | IsInt () const |
bool | IsLong () const |
bool | IsFloat () const |
bool | IsBool () const |
bool | IsBuffer () const |
bool | IsString () const |
bool | IsWString () const |
bool | IsToken () const |
bool | IsTuple () const |
bool | IsList () const |
bool | IsDict () const |
bool | IsNone () const |
bool | IsSubStruct () const |
bool | IsSubStream () const |
bool | IsChecksumedStream () const |
bool | IsObject () const |
bool | IsObjectEx () const |
bool | IsPackedRow () const |
const char * | TypeString () const |
PyInt * | AsInt () |
const PyInt * | AsInt () const |
PyLong * | AsLong () |
const PyLong * | AsLong () const |
PyFloat * | AsFloat () |
const PyFloat * | AsFloat () const |
PyBool * | AsBool () |
const PyBool * | AsBool () const |
PyBuffer * | AsBuffer () |
const PyBuffer * | AsBuffer () const |
PyString * | AsString () |
const PyString * | AsString () const |
PyWString * | AsWString () |
const PyWString * | AsWString () const |
PyToken * | AsToken () |
const PyToken * | AsToken () const |
PyTuple * | AsTuple () |
const PyTuple * | AsTuple () const |
PyList * | AsList () |
const PyList * | AsList () const |
PyDict * | AsDict () |
const PyDict * | AsDict () const |
PyNone * | AsNone () |
const PyNone * | AsNone () const |
PySubStruct * | AsSubStruct () |
const PySubStruct * | AsSubStruct () const |
PySubStream * | AsSubStream () |
const PySubStream * | AsSubStream () const |
PyChecksumedStream * | AsChecksumedStream () |
const PyChecksumedStream * | AsChecksumedStream () const |
PyObject * | AsObject () |
const PyObject * | AsObject () const |
PyObjectEx * | AsObjectEx () |
const PyObjectEx * | AsObjectEx () const |
PyPackedRow * | AsPackedRow () |
const PyPackedRow * | AsPackedRow () const |
void | Dump (FILE *into, const char *pfx) const |
Dumps object to file. More... | |
void | Dump (LogType type, const char *pfx) const |
Dumps object to console. More... | |
![]() | |
RefObject (size_t initRefCount) | |
Initializes reference count. More... | |
virtual | ~RefObject () |
Destructor; must be virtual. More... | |
size_t | GetCount () |
Protected Member Functions | |
virtual | ~PyBuffer () |
![]() | |
PyRep (PyType t) | |
PyRep (const PyRep &oth) | |
PyRep (PyRep &&oth)=delete | |
PyRep & | operator= (const PyRep &oth)=default |
PyRep & | operator= (PyRep &&oth)=default |
virtual | ~PyRep () |
![]() | |
void | IncRef () const |
Increments reference count of object by one. More... | |
void | DecRef () const |
Decrements reference count of object by one. More... | |
Protected Attributes | |
const Buffer *const | mValue |
int32 | mHashCache |
![]() | |
const PyType | mType |
![]() | |
size_t | mRefCount |
Reference count of instance. More... | |
bool | mDeleted |
Additional Inherited Members | |
![]() | |
enum | PyType { PyTypeMin = 0, PyTypeInt = 1, PyTypeLong = 2, PyTypeFloat = 3, PyTypeBool = 4, PyTypeBuffer = 5, PyTypeString = 6, PyTypeWString = 7, PyTypeToken = 8, PyTypeTuple = 9, PyTypeList = 10, PyTypeDict = 11, PyTypeNone = 12, PyTypeSubStruct = 13, PyTypeSubStream = 14, PyTypeChecksumedStream = 15, PyTypeObject = 16, PyTypeObjectEx = 17, PyTypePackedRow = 18, PyTypeError = 19 } |
Python wire object types. More... | |
![]() | |
static std::string | StringContent (PyRep *pRep) |
static int64 | IntegerValue (PyRep *pRep) |
static uint32 | IntegerValueU32 (PyRep *pRep) |
Python buffer.
Usual binary buffer. This buffer has immutable content; once allocated, it cannot be changed.
PyBuffer::PyBuffer | ( | size_t | len, |
const uint8 & | value | ||
) |
Calls Buffer::Buffer( size_t, const uint8& ).
Definition at line 359 of file PyRep.cpp.
Referenced by Clone().
|
inline |
PyBuffer::PyBuffer | ( | const Buffer & | buffer | ) |
Calls Buffer::Buffer( const Buffer& ).
Definition at line 361 of file PyRep.cpp.
PyBuffer::PyBuffer | ( | Buffer ** | buffer | ) |
Takes ownership of a passed Buffer.
Definition at line 364 of file PyRep.cpp.
PyBuffer::PyBuffer | ( | const PyString & | str | ) |
Copy constructor.
Definition at line 366 of file PyRep.cpp.
PyBuffer::PyBuffer | ( | const PyBuffer & | oth | ) |
Copy constructor.
Definition at line 368 of file PyRep.cpp.
|
protectedvirtual |
|
virtual |
Clones object.
Implements PyRep.
Definition at line 376 of file PyRep.cpp.
References PyBuffer().
|
inline |
Get the const PyBuffer content.
Definition at line 407 of file PyRep.h.
References mValue.
Referenced by PyService::_BuildCachedReturn(), PyTraceLog::_logInternBufferMessage(), CachedObjectMgr::_UpdateCache(), PySubStream::DecodeData(), hash(), size(), PyDumpVisitor::VisitBuffer(), MarshalStream::VisitBuffer(), and MarshalStream::VisitSubStream().
|
virtual |
virtual function to generate a hash value of a object.
virtual function to generate a hash value of a object to facilitate the various maps and checks.
Reimplemented from PyRep.
Definition at line 386 of file PyRep.cpp.
References content(), mHashCache, and Buffer::size().
size_t PyBuffer::size | ( | ) | const |
Obtains length of the buffer.
Definition at line 422 of file PyRep.cpp.
References content(), and Buffer::size().
Referenced by PyTraceLog::_logInternBufferMessage().
|
virtual |
Visits object.
[in] | v | Visitor to be used for visiting. |
true | Visit successful. |
false | Error during visit. |
Implements PyRep.
Definition at line 381 of file PyRep.cpp.
References PyVisitor::VisitBuffer().
|
mutableprotected |
|
protected |
Definition at line 421 of file PyRep.h.
Referenced by content(), and ~PyBuffer().