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

#include "PyRep.h"

Inheritance diagram for PySubStream:
Collaboration diagram for PySubStream:

Public Member Functions

 PySubStream (PyRep *rep)
 
 PySubStream (PyBuffer *buffer)
 
 PySubStream (const PySubStream &oth)
 
 PySubStream (PySubStream &&oth)=delete
 
PySubStreamoperator= (const PySubStream &oth)=delete
 
PySubStreamoperator= (PySubStream &&oth)=delete
 
PyRepClone () const
 Clones object. More...
 
bool visit (PyVisitor &v) const
 Visits object. More...
 
PyBufferdata () const
 
PyRepdecoded () const
 
void EncodeData () const
 
void DecodeData () 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 ~PySubStream ()
 
- 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

PyBuffermData
 
PyRepmDecoded
 
- 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

Definition at line 1029 of file PyRep.h.

Constructor & Destructor Documentation

PySubStream::PySubStream ( PyRep rep)

Definition at line 1084 of file PyRep.cpp.

Referenced by Clone().

1084 : PyRep( PyRep::PyTypeSubStream ), mData( nullptr ), mDecoded( rep ) {}
PyBuffer * mData
Definition: PyRep.h:1060
PyRep(PyType t)
Definition: PyRep.cpp:73
PyRep * mDecoded
Definition: PyRep.h:1061

Here is the caller graph for this function:

PySubStream::PySubStream ( PyBuffer buffer)

Definition at line 1085 of file PyRep.cpp.

1085 : PyRep(PyRep::PyTypeSubStream), mData( buffer ), mDecoded( nullptr ) {}
PyBuffer * mData
Definition: PyRep.h:1060
PyRep(PyType t)
Definition: PyRep.cpp:73
PyRep * mDecoded
Definition: PyRep.h:1061
PySubStream::PySubStream ( const PySubStream oth)

Definition at line 1086 of file PyRep.cpp.

1087  mData( oth.data() == nullptr ? nullptr : new PyBuffer( *oth.data() ) ),
1088  mDecoded( oth.decoded() == nullptr ? nullptr : oth.decoded()->Clone() )
1089 {
1090 
1091 }
virtual PyRep * Clone() const =0
Clones object.
PyBuffer * data() const
Definition: PyRep.h:1047
PyRep * decoded() const
Definition: PyRep.h:1048
PyBuffer * mData
Definition: PyRep.h:1060
PyRep(PyType t)
Definition: PyRep.cpp:73
Python buffer.
Definition: PyRep.h:382
PyRep * mDecoded
Definition: PyRep.h:1061
PySubStream::PySubStream ( PySubStream &&  oth)
delete
PySubStream::~PySubStream ( )
protectedvirtual

Definition at line 1093 of file PyRep.cpp.

References mData, mDecoded, and PySafeDecRef.

1094 {
1095  PySafeDecRef( mData );
1097 }
PyBuffer * mData
Definition: PyRep.h:1060
#define PySafeDecRef(op)
Definition: PyRep.h:61
PyRep * mDecoded
Definition: PyRep.h:1061

Member Function Documentation

PyRep * PySubStream::Clone ( ) const
virtual

Clones object.

Returns
Indentical copy of object.

Implements PyRep.

Definition at line 1099 of file PyRep.cpp.

References PySubStream().

1100 {
1101  return new PySubStream( *this );
1102 }
PySubStream(PyRep *rep)
Definition: PyRep.cpp:1084

Here is the call graph for this function:

PyBuffer* PySubStream::data ( ) const
inline

Definition at line 1047 of file PyRep.h.

References mData.

Referenced by PyService::_BuildCachedReturn(), CachedObjectMgr::UpdateCacheFromSS(), PyVisitor::VisitSubStream(), and MarshalStream::VisitSubStream().

1047 { return mData; }
PyBuffer * mData
Definition: PyRep.h:1060

Here is the caller graph for this function:

PyRep* PySubStream::decoded ( ) const
inline

Definition at line 1048 of file PyRep.h.

References mDecoded.

Referenced by PyPacket::Decode(), PyCallStream::Decode(), PyCachedObjectDecoder::Decode(), PyCachedCall::Decode(), ObjectToSQL(), PyDumpVisitor::VisitSubStream(), PyVisitor::VisitSubStream(), and MarshalStream::VisitSubStream().

1048 { return mDecoded; }
PyRep * mDecoded
Definition: PyRep.h:1061

Here is the caller graph for this function:

void PySubStream::DecodeData ( ) const

Definition at line 1125 of file PyRep.cpp.

References PyBuffer::content(), mData, mDecoded, and Unmarshal().

Referenced by PyPacket::Decode(), PyCallStream::Decode(), PyCachedObjectDecoder::Decode(), PyCachedCall::Decode(), ObjectToSQL(), and PyVisitor::VisitSubStream().

1126 {
1127  if ((mData == nullptr) or (mDecoded != nullptr))
1128  return;
1129 
1130  mDecoded = Unmarshal( mData->content() );
1131 }
const Buffer & content() const
Get the const PyBuffer content.
Definition: PyRep.h:407
PyBuffer * mData
Definition: PyRep.h:1060
PyRep * Unmarshal(const Buffer &data)
Turns marshal stream into Python object.
PyRep * mDecoded
Definition: PyRep.h:1061

Here is the call graph for this function:

Here is the caller graph for this function:

void PySubStream::EncodeData ( ) const

Definition at line 1109 of file PyRep.cpp.

References Marshal(), mData, mDecoded, SafeDelete(), and sLog.

Referenced by PyService::_BuildCachedReturn(), and MarshalStream::VisitSubStream().

1110 {
1111  if ((mDecoded == nullptr) or (mData != nullptr))
1112  return;
1113 
1114  Buffer* buf = new Buffer();
1115  if (!Marshal( mDecoded, *buf ) ) {
1116  sLog.Error( "Marshal", "Failed to marshal rep %p.", mDecoded );
1117  SafeDelete( buf );
1118  return;
1119  }
1120 
1121  // Move ownership of Buffer to PyBuffer
1122  mData = new PyBuffer( &buf );
1123 }
bool Marshal(const PyRep *rep, Buffer &into)
Definition: EVEMarshal.cpp:36
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
Definition: SafeMem.h:83
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
Generic class for buffers.
Definition: Buffer.h:40
PyBuffer * mData
Definition: PyRep.h:1060
Python buffer.
Definition: PyRep.h:382
PyRep * mDecoded
Definition: PyRep.h:1061

Here is the call graph for this function:

Here is the caller graph for this function:

PySubStream& PySubStream::operator= ( const PySubStream oth)
delete
PySubStream& PySubStream::operator= ( PySubStream &&  oth)
delete
bool PySubStream::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 1104 of file PyRep.cpp.

References PyVisitor::VisitSubStream().

1105 {
1106  return v.VisitSubStream( this );
1107 }
virtual bool VisitSubStream(const PySubStream *rep)
Definition: PyVisitor.cpp:119

Here is the call graph for this function:

Member Data Documentation

PyBuffer* PySubStream::mData
mutableprotected

Definition at line 1060 of file PyRep.h.

Referenced by data(), DecodeData(), EncodeData(), and ~PySubStream().

PyRep* PySubStream::mDecoded
mutableprotected

Definition at line 1061 of file PyRep.h.

Referenced by decoded(), DecodeData(), EncodeData(), and ~PySubStream().


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