56 #define PyIncRef(op) (op)->IncRef()
57 #define PyDecRef(op) (op)->DecRef()
60 #define PySafeIncRef(op) if (op != nullptr) PyIncRef( op )
61 #define PySafeDecRef(op) if (op != nullptr) PyDecRef( op )
168 void Dump( FILE* into,
const char* pfx )
const;
388 template<
typename Iter>
436 PyString(
const char* str,
size_t len );
438 template<
typename Iter>
479 PyWString(
const char* str,
size_t len );
481 template<
typename Iter>
528 PyToken(
const char* token,
size_t len );
530 template<
typename Iter>
531 PyToken( Iter first, Iter last );
533 PyToken(
const std::string& token );
615 if (
object ==
nullptr)
646 PyList(
size_t item_count = 0 );
687 if (
object ==
nullptr)
723 class _hash :
public std::unary_function<PyRep*, size_t>
730 return (
size_t)_Keyval->
hash();
735 class _comp :
public std::binary_function<PyRep*, PyRep*, bool>
743 return ( _Arg1->
hash() == _Arg2->
hash() );
1096 template<
typename Iter>
1098 template<
typename Iter>
1100 template<
typename Iter>
1102 template<
typename Iter>
1152 #include "../../eve-core/utils/Singleton.h"
1212 #endif//EVE_PY_REP_H
const PyInt * AsInt() const
list_type::const_iterator const_list_iterator
PyWString(const char *str, size_t len)
static std::string StringContent(PyRep *pRep)
static PyTuple * _CreateHeader(PyTuple *args, PyDict *keywords, bool enclosed=false)
PyRep * Clone() const
Clones object.
void DecRef() const
Decrements reference count of object by one.
PyTuple & operator=(const PyTuple &oth)
bool visit(PyVisitor &v) const
Visits object.
PyRep * GetItem(size_t index) const
Returns Python object.
PyRep * GetItemString(const char *key) const
Obtains database entry based on given key string.
const Buffer & content() const
Get the const PyBuffer content.
bool IsChecksumedStream() const
const PyDict * AsDict() const
const PySubStruct * AsSubStruct() const
DBRowDescriptor * header() const
PyRep * Clone() const
Clones object.
const PyObjectEx * AsObjectEx() const
PyTuple * GetArgs() const
const PyNone * AsNone() const
const std::string & content() const
Get the PyWString content.
virtual PyRep * Clone() const =0
Clones object.
static PyTuple * _CreateHeader(PyToken *type, PyTuple *args, bool enclosed=false)
PyRep * Clone() const
Clones object.
PyRep * Clone() const
Clones object.
list_type::iterator list_iterator
const PyFloat * AsFloat() const
storage_type::iterator iterator
PyPackedRow & operator=(const PyPackedRow &oth)
PyNone & operator=(const PyNone &oth)=delete
storage_type::const_iterator const_iterator
void SetItemString(size_t index, const char *str)
Stores Python string.
size_t operator()(const PyRep *_Keyval) const
PyRep * Clone() const
Clones object.
std::vector< PyRep * > storage_type
PyRep * FindKeyword(const char *keyword) const
void SetItem(const char *key, PyRep *value)
A reference-counted object.
PyRep * Clone() const
Clones object.
PyObjectEx_Type2(PyTuple *args, PyDict *keywords, bool enclosed=false)
PyRep * Clone() const
Clones object.
virtual ~PyObjectEx_Type1()
storage_type::iterator iterator
bool operator()(const PyRep *_Arg1, const PyRep *_Arg2) const
Python floating point number.
storage_type *const mFields
dict_type::iterator dict_iterator
bool visit(PyVisitor &v) const
Visits object.
const_iterator begin() const
PyRep * Clone() const
Clones object.
storage_type::iterator iterator
PyObject & operator=(const PyObject &oth)
PyInt & operator=(const PyInt &oth)=delete
PyList & operator=(const PyList &oth)
storage_type::const_iterator const_iterator
static uint32 IntegerValueU32(PyRep *pRep)
const list_type & list() const
PyRep * Clone() const
Clones object.
PyRep * Clone() const
Clones object.
bool visit(PyVisitor &v) const
Visits object.
int32 hash() const
virtual function to generate a hash value of a object.
bool visit(PyVisitor &v) const
Visits object.
bool visit(PyVisitor &v) const
Visits object.
bool visit(PyVisitor &v) const
Visits object.
PyToken * GetType() const
int32 hash() const
virtual function to generate a hash value of a object.
PyList(size_t item_count=0)
void Dump(FILE *into, const char *pfx) const
Dumps object to file.
PyRep * Clone() const
Clones object.
PyChecksumedStream & operator=(const PyChecksumedStream &oth)=delete
const PyPackedRow * AsPackedRow() const
PyRep * arguments() const
virtual ~PyObjectEx_Type2()
void AddItemReal(double realval)
PyToken & operator=(const PyToken &oth)=delete
PyLong & operator=(const PyLong &oth)=delete
PyRep * GetItem(size_t index) const
Returns Python object.
void SetItemString(size_t index, const char *str)
PyRep * GetField(size_t index) const
PyString(const char *str)
PySubStream * AsSubStream()
const PyTuple * AsTuple() const
size_t size() const
Obtains length of the buffer.
PyObject(const char *type, PyRep *args)
Generic class for buffers.
PyChecksumedStream * AsChecksumedStream()
PyObjectEx_Type1(PyToken *type, PyTuple *args, bool enclosed=false)
PyRep * Clone() const
Clones object.
std::unordered_map< PyRep *, PyRep *, _hash, _comp > storage_type
Python object "blue.DBRowDescriptor".
bool visit(PyVisitor &v) const
Visits object.
bool visit(PyVisitor &v) const
Visits object.
void SetItem(size_t index, PyRep *object)
Stores Python object.
void IncRef() const
Increments reference count of object by one.
PyRep * GetItem(PyRep *key) const
Obtains a database entry based on given key object.
storage_type::const_iterator const_iterator
dict_type::const_iterator const_dict_iterator
const PyBool * AsBool() const
PySubStruct & operator=(const PySubStruct &oth)=delete
void SetItem(size_t index, PyRep *object)
Stores Python object.
int32 hash() const
virtual function to generate a hash value of a object.
const PyWString * AsWString() const
PyRep * Clone() const
Clones object.
const PyObject * AsObject() const
bool visit(PyVisitor &v) const
Visits object.
int32 hash() const
virtual function to generate a hash value of a object.
PyPackedRow * AsPackedRow()
const PyBuffer * AsBuffer() const
storage_type::iterator iterator
bool visit(PyVisitor &v) const
Visits object.
const PyList * AsList() const
PyRep * FindKeyword(const char *keyword) const
void AddItemInt(int32 intval)
virtual int32 hash() const
virtual function to generate a hash value of a object.
bool visit(PyVisitor &v) const
Visits object.
PyChecksumedStream(PyRep *t, uint32 sum)
const_iterator begin() const
int32 hash() const
virtual function to generate a hash value of a object.
PyToken(const char *token)
bool visit(PyVisitor &v) const
Visits object.
PyTuple(size_t item_count)
PyBool & operator=(const PyBool &oth)=delete
PyRep * Clone() const
Clones object.
PyDict * GetKeywords() const
int32 hash() const
virtual function to generate a hash value of a object.
PyType
Python wire object types.
PyRep * Clone() const
Clones object.
void SetItem(const char *key, const char *value)
std::vector< PyRep * > storage_type
void AddItemString(const char *str)
void SetItemInt(size_t index, int32 val)
const PyLong * AsLong() const
const std::string & content() const
Obtain token.
const_iterator begin() const
Python token (eg. class name).
const Buffer *const mValue
PyObjectEx(bool is_type_2, PyRep *header)
PyTuple * new_tuple(int64 arg1)
Wrapper class for PyObjectEx of type 1.
PySubStruct * AsSubStruct()
int32 hash() const
virtual function to generate a hash value of a object.
int32 hash() const
virtual function to generate a hash value of a object.
virtual ~PyChecksumedStream()
const_iterator end() const
PyRep * Clone() const
Clones object.
storage_type::const_iterator const_iterator
PyRep * Clone() const
Clones object.
const_iterator end() const
bool visit(PyVisitor &v) const
Visits object.
PySubStream & operator=(const PySubStream &oth)=delete
PyObjectEx & operator=(const PyObjectEx &oth)
bool SetField(uint32 index, PyRep *value)
PyTuple * GetArgs() const
PyPackedRow(DBRowDescriptor *header)
void AddItemLong(int64 intval)
Template used for singleton classes.
int32 hash() const
virtual function to generate a hash value of a object.
const std::string & content() const
Get the PyString content.
bool visit(PyVisitor &v) const
Visits object.
const_iterator end() const
const PyToken * AsToken() const
const PyString * AsString() const
PyRep * Clone() const
Clones object.
bool visit(PyVisitor &v) const
Visits object.
typeID Spawn an NPC with the specified type text Search for items matching the specified query() type() key(value)-Send an OnRemoteMessage" ) COMMAND( setbpattr
PyFloat & operator=(const PyFloat &oth)=delete
static int64 IntegerValue(PyRep *pRep)
const_iterator end() const
const dict_type & dict() const
PyDict & operator=(const PyDict &oth)
bool visit(PyVisitor &v) const
Visits object.
DBRowDescriptor *const mHeader
const PyChecksumedStream * AsChecksumedStream() const
const_iterator begin() const
PyBuffer(size_t len, const uint8 &value)
size_t size() const
Obtains length of string.
bool visit(PyVisitor &v) const
Visits object.
PyObjectEx * AsObjectEx()
void SetItem(PyRep *key, PyRep *value)
SetItem adds or sets a database entry.
bool visit(PyVisitor &v) const
Visits object.
Wrapper class for PyObjectEx of type 2.
const char * TypeString() const
const PySubStream * AsSubStream() const
PyDict * GetKeywords() const
virtual bool visit(PyVisitor &v) const =0
Visits object.
void SetItemString(const char *key, PyRep *value)
SetItemString adds or sets a database entry.
PyRep & operator=(const PyRep &oth)=default