EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
PyObject Class Reference

Python object. More...

#include "PyRep.h"

Inheritance diagram for PyObject:
Collaboration diagram for PyObject:

Public Member Functions

 PyObject (const char *type, PyRep *args)
 
 PyObject (PyString *type, PyRep *args)
 
 PyObject (const PyObject &oth)
 
 PyObject (PyObject &&oth)=delete
 
PyObjectoperator= (const PyObject &oth)
 
PyObjectoperator= (PyObject &&oth)=delete
 
PyRepClone () const
 Clones object. More...
 
bool visit (PyVisitor &v) const
 Visits object. More...
 
PyStringtype () const
 
PyReparguments () const
 
- Public Member Functions inherited from PyRep
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
 
PyIntAsInt ()
 
const PyIntAsInt () const
 
PyLongAsLong ()
 
const PyLongAsLong () const
 
PyFloatAsFloat ()
 
const PyFloatAsFloat () const
 
PyBoolAsBool ()
 
const PyBoolAsBool () const
 
PyBufferAsBuffer ()
 
const PyBufferAsBuffer () const
 
PyStringAsString ()
 
const PyStringAsString () const
 
PyWStringAsWString ()
 
const PyWStringAsWString () const
 
PyTokenAsToken ()
 
const PyTokenAsToken () const
 
PyTupleAsTuple ()
 
const PyTupleAsTuple () const
 
PyListAsList ()
 
const PyListAsList () const
 
PyDictAsDict ()
 
const PyDictAsDict () const
 
PyNoneAsNone ()
 
const PyNoneAsNone () const
 
PySubStructAsSubStruct ()
 
const PySubStructAsSubStruct () const
 
PySubStreamAsSubStream ()
 
const PySubStreamAsSubStream () const
 
PyChecksumedStreamAsChecksumedStream ()
 
const PyChecksumedStreamAsChecksumedStream () const
 
PyObjectAsObject ()
 
const PyObjectAsObject () const
 
PyObjectExAsObjectEx ()
 
const PyObjectExAsObjectEx () const
 
PyPackedRowAsPackedRow ()
 
const PyPackedRowAsPackedRow () 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...
 
virtual int32 hash () const
 virtual function to generate a hash value of a object. More...
 
- Public Member Functions inherited from RefObject
 RefObject (size_t initRefCount)
 Initializes reference count. More...
 
virtual ~RefObject ()
 Destructor; must be virtual. More...
 
size_t GetCount ()
 

Protected Member Functions

virtual ~PyObject ()
 
- Protected Member Functions inherited from PyRep
 PyRep (PyType t)
 
 PyRep (const PyRep &oth)
 
 PyRep (PyRep &&oth)=delete
 
PyRepoperator= (const PyRep &oth)=default
 
PyRepoperator= (PyRep &&oth)=default
 
virtual ~PyRep ()
 
- Protected Member Functions inherited from RefObject
void IncRef () const
 Increments reference count of object by one. More...
 
void DecRef () const
 Decrements reference count of object by one. More...
 

Protected Attributes

PyStringmType
 
PyRep *const mArguments
 
- Protected Attributes inherited from PyRep
const PyType mType
 
- Protected Attributes inherited from RefObject
size_t mRefCount
 Reference count of instance. More...
 
bool mDeleted
 

Additional Inherited Members

- Public Types inherited from PyRep
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 Public Member Functions inherited from PyRep
static std::string StringContent (PyRep *pRep)
 
static int64 IntegerValue (PyRep *pRep)
 
static uint32 IntegerValueU32 (PyRep *pRep)
 

Detailed Description

Python object.

Consists of typename (string) and arguments, which is usually PyTuple or PyDict.

Definition at line 826 of file PyRep.h.

Constructor & Destructor Documentation

PyObject::PyObject ( const char *  type,
PyRep args 
)

Definition at line 762 of file PyRep.cpp.

Referenced by Clone().

Python string.
Definition: PyRep.h:430
PyString * mType
Definition: PyRep.h:850
PyRep *const mArguments
Definition: PyRep.h:851
PyString * type() const
Definition: PyRep.h:844
PyRep(PyType t)
Definition: PyRep.cpp:73

Here is the caller graph for this function:

PyObject::PyObject ( PyString type,
PyRep args 
)

Definition at line 760 of file PyRep.cpp.

761 : PyRep(PyRep::PyTypeObject), mType(type), mArguments(args) { }
PyString * mType
Definition: PyRep.h:850
PyRep *const mArguments
Definition: PyRep.h:851
PyRep(PyType t)
Definition: PyRep.cpp:73
PyObject::PyObject ( const PyObject oth)

Definition at line 764 of file PyRep.cpp.

765 : PyRep(PyRep::PyTypeObject), mType(new PyString(*oth.type())), mArguments(oth.arguments()) { }
Python string.
Definition: PyRep.h:430
PyString * mType
Definition: PyRep.h:850
PyRep * arguments() const
Definition: PyRep.h:845
PyRep *const mArguments
Definition: PyRep.h:851
PyString * type() const
Definition: PyRep.h:844
PyRep(PyType t)
Definition: PyRep.cpp:73
PyObject::PyObject ( PyObject &&  oth)
delete
PyObject::~PyObject ( )
protectedvirtual

Definition at line 767 of file PyRep.cpp.

References mArguments, mType, and PyDecRef.

768 {
769  PyDecRef( mType );
770  PyDecRef( mArguments );
771 }
PyString * mType
Definition: PyRep.h:850
PyRep *const mArguments
Definition: PyRep.h:851
#define PyDecRef(op)
Definition: PyRep.h:57

Member Function Documentation

PyRep* PyObject::arguments ( ) const
inline

Definition at line 845 of file PyRep.h.

References mArguments.

Referenced by PyAddress::Decode(), PyPacket::Decode(), PyCachedObjectDecoder::Decode(), PyDumpVisitor::VisitObject(), and PyVisitor::VisitObject().

845 { return mArguments; }
PyRep *const mArguments
Definition: PyRep.h:851

Here is the caller graph for this function:

PyRep * PyObject::Clone ( ) const
virtual

Clones object.

Returns
Indentical copy of object.

Implements PyRep.

Definition at line 773 of file PyRep.cpp.

References PyObject().

Referenced by CachedObjectMgr::CacheRecord::EncodeHint().

774 {
775  return new PyObject( *this );
776 }
PyObject(const char *type, PyRep *args)
Definition: PyRep.cpp:762

Here is the call graph for this function:

Here is the caller graph for this function:

PyObject& PyObject::operator= ( const PyObject oth)
PyObject& PyObject::operator= ( PyObject &&  oth)
delete
PyString* PyObject::type ( ) const
inline

Definition at line 844 of file PyRep.h.

References mType.

Referenced by PyPacket::Decode(), PyDumpVisitor::VisitObject(), PyVisitor::VisitObject(), and SetSQLDumper::VisitObject().

844 { return mType; }
PyString * mType
Definition: PyRep.h:850

Here is the caller graph for this function:

bool PyObject::visit ( PyVisitor v) const
virtual

Visits object.

Parameters
[in]vVisitor to be used for visiting.
Return values
trueVisit successful.
falseError during visit.

Implements PyRep.

Definition at line 778 of file PyRep.cpp.

References PyVisitor::VisitObject().

779 {
780  return v.VisitObject( this );
781 }
virtual bool VisitObject(const PyObject *rep)
Object type visitor.
Definition: PyVisitor.cpp:69

Here is the call graph for this function:

Member Data Documentation

PyRep* const PyObject::mArguments
protected

Definition at line 851 of file PyRep.h.

Referenced by arguments(), and ~PyObject().

PyString* PyObject::mType
protected

Definition at line 850 of file PyRep.h.

Referenced by type(), and ~PyObject().


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