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

Wrapper class for PyObjectEx of type 2. More...

#include "PyRep.h"

Inheritance diagram for PyObjectEx_Type2:
Collaboration diagram for PyObjectEx_Type2:

Public Member Functions

 PyObjectEx_Type2 (PyTuple *args, PyDict *keywords, bool enclosed=false)
 
 PyObjectEx_Type2 (PyToken *args, PyDict *keywords, bool enclosed=false)
 
PyTupleGetArgs () const
 
PyDictGetKeywords () const
 
PyRepFindKeyword (const char *keyword) const
 
- Public Member Functions inherited from PyObjectEx
 PyObjectEx (bool is_type_2, PyRep *header)
 
 PyObjectEx (const PyObjectEx &oth)
 
 PyObjectEx (PyObjectEx &&oth)=delete
 
PyObjectExoperator= (const PyObjectEx &oth)
 
PyObjectExoperator= (PyObjectEx &&oth)=delete
 
PyRepClone () const
 Clones object. More...
 
bool visit (PyVisitor &v) const
 Visits object. More...
 
PyRepheader () const
 
bool isType2 () const
 
list_typelist ()
 
const list_typelist () const
 
dict_typedict ()
 
const dict_typedict () 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 ~PyObjectEx_Type2 ()
 
- Protected Member Functions inherited from PyObjectEx
virtual ~PyObjectEx ()
 
- 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...
 

Static Protected Member Functions

static PyTuple_CreateHeader (PyTuple *args, PyDict *keywords, bool enclosed=false)
 
static PyTuple_CreateHeader (PyToken *args, PyDict *keywords, bool enclosed=false)
 

Additional Inherited Members

- Public Types inherited from PyObjectEx
typedef PyList list_type
 
typedef list_type::iterator list_iterator
 
typedef list_type::const_iterator const_list_iterator
 
typedef PyDict dict_type
 
typedef dict_type::iterator dict_iterator
 
typedef dict_type::const_iterator const_dict_iterator
 
- 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)
 
- Protected Attributes inherited from PyObjectEx
PyRep *const mHeader
 
const bool mIsType2
 
list_type *const mList
 
dict_type *const mDict
 
- Protected Attributes inherited from PyRep
const PyType mType
 
- Protected Attributes inherited from RefObject
size_t mRefCount
 Reference count of instance. More...
 
bool mDeleted
 

Detailed Description

Wrapper class for PyObjectEx of type 2.

Author
Bloody.Rabbit

Definition at line 938 of file PyRep.h.

Constructor & Destructor Documentation

PyObjectEx_Type2::PyObjectEx_Type2 ( PyTuple args,
PyDict keywords,
bool  enclosed = false 
)

Definition at line 942 of file PyRep.cpp.

943 : PyObjectEx( true, _CreateHeader( args, keywords, enclosed)) { }
static PyTuple * _CreateHeader(PyTuple *args, PyDict *keywords, bool enclosed=false)
Definition: PyRep.cpp:971
PyObjectEx(bool is_type_2, PyRep *header)
Definition: PyRep.cpp:786
PyObjectEx_Type2::PyObjectEx_Type2 ( PyToken args,
PyDict keywords,
bool  enclosed = false 
)

Definition at line 944 of file PyRep.cpp.

945 : PyObjectEx( true, _CreateHeader( args, keywords, enclosed)) { }
static PyTuple * _CreateHeader(PyTuple *args, PyDict *keywords, bool enclosed=false)
Definition: PyRep.cpp:971
PyObjectEx(bool is_type_2, PyRep *header)
Definition: PyRep.cpp:786
virtual PyObjectEx_Type2::~PyObjectEx_Type2 ( )
inlineprotectedvirtual

Definition at line 950 of file PyRep.h.

950 { /* do we need to do anything here? */ }

Member Function Documentation

PyTuple * PyObjectEx_Type2::_CreateHeader ( PyTuple args,
PyDict keywords,
bool  enclosed = false 
)
staticprotected

Definition at line 971 of file PyRep.cpp.

References PyTuple::SetItem().

972 {
973  assert( args != nullptr );
974  if (keywords == nullptr )
975  keywords = new PyDict();
976 
977  PyTuple* body = new PyTuple( 2 );
978  body->SetItem( 0, args );
979  body->SetItem( 1, keywords );
980  /*
981  if (enclosed) {
982  PyTuple* head = new PyTuple( 1 );
983  head->SetItem( 0, body );
984  } */
985 
986  return body; // head;
987 }
Python's dictionary.
Definition: PyRep.h:719
Python tuple.
Definition: PyRep.h:567
void SetItem(size_t index, PyRep *object)
Stores Python object.
Definition: PyRep.h:610

Here is the call graph for this function:

PyTuple * PyObjectEx_Type2::_CreateHeader ( PyToken args,
PyDict keywords,
bool  enclosed = false 
)
staticprotected

Definition at line 989 of file PyRep.cpp.

References PyTuple::SetItem().

990 {
991  assert( args != nullptr );
992  if (keywords == nullptr )
993  keywords = new PyDict();
994 
995  PyTuple* body = new PyTuple( 2 );
996  body->SetItem( 0, args );
997  body->SetItem( 1, keywords );
998 
999  if (enclosed) {
1000  PyTuple* head = new PyTuple( 1 );
1001  head->SetItem( 0, body );
1002  }
1003 
1004  return body; // head;
1005 }
Python's dictionary.
Definition: PyRep.h:719
Python tuple.
Definition: PyRep.h:567
void SetItem(size_t index, PyRep *object)
Stores Python object.
Definition: PyRep.h:610

Here is the call graph for this function:

PyRep * PyObjectEx_Type2::FindKeyword ( const char *  keyword) const

Definition at line 959 of file PyRep.cpp.

References PyDict::begin(), PyDict::end(), and GetKeywords().

Referenced by CRowSet::_GetRowDesc(), CIndexedRowSet::_GetRowDesc(), and CFilterRowSet::_GetRowDesc().

960 {
961  PyDict* kw = GetKeywords();
962  PyDict::const_iterator cur = kw->begin();
963  for (; cur != kw->end(); ++cur)
964  if ( cur->first->IsString() )
965  if ( cur->first->AsString()->content() == keyword )
966  return cur->second;
967 
968  return nullptr;
969 }
Python's dictionary.
Definition: PyRep.h:719
PyDict * GetKeywords() const
Definition: PyRep.cpp:953
const_iterator begin() const
Definition: PyRep.h:766
storage_type::const_iterator const_iterator
Definition: PyRep.h:750
const_iterator end() const
Definition: PyRep.h:767

Here is the call graph for this function:

Here is the caller graph for this function:

PyTuple * PyObjectEx_Type2::GetArgs ( ) const

Definition at line 947 of file PyRep.cpp.

References PyRep::AsTuple(), PyTuple::GetItem(), and PyObjectEx::header().

Referenced by CharacterAppearance::Build(), and PasswordString::GetPassword().

948 {
949  assert( header() != nullptr );
950  return header()->AsTuple()->GetItem( 0 )->AsTuple();
951 }
PyTuple * AsTuple()
Definition: PyRep.h:138
PyRep * GetItem(size_t index) const
Returns Python object.
Definition: PyRep.h:602
PyRep * header() const
Definition: PyRep.h:886

Here is the call graph for this function:

Here is the caller graph for this function:

PyDict * PyObjectEx_Type2::GetKeywords ( ) const

Definition at line 953 of file PyRep.cpp.

References PyRep::AsDict(), PyRep::AsTuple(), PyTuple::GetItem(), and PyObjectEx::header().

Referenced by FindKeyword().

954 {
955  assert( header() != nullptr );
956  return header()->AsTuple()->GetItem( 1 )->AsDict();
957 }
PyTuple * AsTuple()
Definition: PyRep.h:138
PyRep * GetItem(size_t index) const
Returns Python object.
Definition: PyRep.h:602
PyDict * AsDict()
Definition: PyRep.h:142
PyRep * header() const
Definition: PyRep.h:886

Here is the call graph for this function:

Here is the caller graph for this function:


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