EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
EVEMarshal.h File Reference
Include dependency graph for EVEMarshal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  MarshalStream
 Turns Python objects into marshal bytecode. More...
 

Functions

bool Marshal (const PyRep *rep, Buffer &into)
 
bool MarshalDeflate (const PyRep *rep, Buffer &into, const uint32 deflationLimit=0x2000)
 

Function Documentation

bool Marshal ( const PyRep rep,
Buffer into 
)

Definition at line 36 of file EVEMarshal.cpp.

References SafeDelete(), and MarshalStream::Save().

Referenced by PySubStream::EncodeData(), CachedObjectMgr::GetCacheFileName(), and MarshalDeflate().

37 {
38  MarshalStream* pMS(new MarshalStream());
39  bool ret(pMS->Save(rep, into));
40  SafeDelete(pMS);
41  return ret;
42 }
Turns Python objects into marshal bytecode.
Definition: EVEMarshal.h:59
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
Definition: SafeMem.h:83

Here is the call graph for this function:

Here is the caller graph for this function:

bool MarshalDeflate ( const PyRep rep,
Buffer into,
const uint32  deflationLimit = 0x2000 
)

Definition at line 44 of file EVEMarshal.cpp.

References Buffer::AppendSeq(), Buffer::begin(), DeflateData(), Buffer::end(), Marshal(), SafeDelete(), and Buffer::size().

Referenced by marshal_EVEMarshalTest(), EVETCPConnection::QueueRep(), and CachedObjectMgr::UpdateCache().

45 {
46  Buffer* data(new Buffer());
47  bool ret(false);
48  if (Marshal(rep, *data)) {
49  if ( data->size() >= deflationLimit ) {
50  ret = DeflateData( *data, into );
51  } else {
52  into.AppendSeq( data->begin<uint8>(), data->end<uint8>() );
53  ret = true;
54  }
55  }
56 
57  SafeDelete(data);
58  return ret;
59 }
unsigned __int8 uint8
Definition: eve-compat.h:46
bool Marshal(const PyRep *rep, Buffer &into)
Definition: EVEMarshal.cpp:36
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
Definition: SafeMem.h:83
Generic class for buffers.
Definition: Buffer.h:40
void AppendSeq(Iter first, Iter last)
Appends a sequence of elements to buffer.
Definition: Buffer.h:455
bool DeflateData(Buffer &data)
Deflates given data.
Definition: Deflate.cpp:37

Here is the call graph for this function:

Here is the caller graph for this function: