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

Python token (eg. class name). More...

#include "PyRep.h"

Inheritance diagram for PyToken:
Collaboration diagram for PyToken:

Public Member Functions

 PyToken (const char *token)
 
 PyToken (const char *token, size_t len)
 
template<typename Iter >
 PyToken (Iter first, Iter last)
 
 PyToken (const std::string &token)
 
 PyToken (const PyString &token)
 
 PyToken (const PyToken &oth)
 
 PyToken (PyToken &&oth)=delete
 
PyToken & operator= (const PyToken &oth)=delete
 
PyToken & operator= (PyToken &&oth)=delete
 
PyRep * Clone () const
 Clones object. More...
 
bool visit (PyVisitor &v) const
 Visits object. More...
 
const std::string & content () const
 Obtain token. More...
 
- 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
 
PyInt * AsInt ()
 
const PyInt * AsInt () const
 
PyLong * AsLong ()
 
const PyLong * AsLong () const
 
PyFloat * AsFloat ()
 
const PyFloat * AsFloat () const
 
PyBool * AsBool ()
 
const PyBool * AsBool () const
 
PyBuffer * AsBuffer ()
 
const PyBuffer * AsBuffer () const
 
PyString * AsString ()
 
const PyString * AsString () const
 
PyWString * AsWString ()
 
const PyWString * AsWString () const
 
PyToken * AsToken ()
 
const PyToken * AsToken () const
 
PyTuple * AsTuple ()
 
const PyTuple * AsTuple () const
 
PyList * AsList ()
 
const PyList * AsList () const
 
PyDict * AsDict ()
 
const PyDict * AsDict () const
 
PyNone * AsNone ()
 
const PyNone * AsNone () const
 
PySubStruct * AsSubStruct ()
 
const PySubStruct * AsSubStruct () const
 
PySubStream * AsSubStream ()
 
const PySubStream * AsSubStream () const
 
PyChecksumedStream * AsChecksumedStream ()
 
const PyChecksumedStream * AsChecksumedStream () const
 
PyObject * AsObject ()
 
const PyObject * AsObject () const
 
PyObjectEx * AsObjectEx ()
 
const PyObjectEx * AsObjectEx () const
 
PyPackedRow * AsPackedRow ()
 
const PyPackedRow * AsPackedRow () 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 ~PyToken ()
 
- Protected Member Functions inherited from PyRep
 PyRep (PyType t)
 
 PyRep (const PyRep &oth)
 
 PyRep (PyRep &&oth)=delete
 
PyRep & operator= (const PyRep &oth)=default
 
PyRep & operator= (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

const std::string mValue
 
- 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 token (eg. class name).

Usually part of PyObject or PyObjectEx.

Definition at line 522 of file PyRep.h.

Constructor & Destructor Documentation

PyToken::PyToken ( const char *  token)

Calls std::string( const char* ).

Definition at line 517 of file PyRep.cpp.

Referenced by Clone().

517 : PyRep( PyRep::PyTypeToken ), mValue( token ) {}
const std::string mValue
Definition: PyRep.h:559
PyRep(PyType t)
Definition: PyRep.cpp:73

Here is the caller graph for this function:

PyToken::PyToken ( const char *  token,
size_t  len 
)

Calls std::string( const char*, size_t ).

Definition at line 518 of file PyRep.cpp.

518 : PyRep( PyRep::PyTypeToken ), mValue( token, len ) {}
const std::string mValue
Definition: PyRep.h:559
PyRep(PyType t)
Definition: PyRep.cpp:73
template<typename Iter >
PyToken::PyToken ( Iter  first,
Iter  last 
)
inline

Calls std::string( Iter, Iter ).

Definition at line 1103 of file PyRep.h.

1103 : PyRep( PyRep::PyTypeToken ), mValue( first, last ) {}
const std::string mValue
Definition: PyRep.h:559
PyRep(PyType t)
Definition: PyRep.cpp:73
PyToken::PyToken ( const std::string &  token)

Calls std::string( const std::string& ).

Definition at line 519 of file PyRep.cpp.

519 : PyRep( PyRep::PyTypeToken ), mValue( token ) {}
const std::string mValue
Definition: PyRep.h:559
PyRep(PyType t)
Definition: PyRep.cpp:73
PyToken::PyToken ( const PyString &  token)

Copy constructor.

Definition at line 521 of file PyRep.cpp.

521 : PyRep( PyRep::PyTypeToken ), mValue( token.content() ) {}
const std::string mValue
Definition: PyRep.h:559
PyRep(PyType t)
Definition: PyRep.cpp:73
const std::string & content() const
Get the PyString content.
Definition: PyRep.h:458
PyToken::PyToken ( const PyToken &  oth)

Copy constructor.

Definition at line 522 of file PyRep.cpp.

522 : PyRep( PyRep::PyTypeToken ), mValue( oth.content() ) {}
const std::string mValue
Definition: PyRep.h:559
const std::string & content() const
Obtain token.
Definition: PyRep.h:555
PyRep(PyType t)
Definition: PyRep.cpp:73
PyToken::PyToken ( PyToken &&  oth)
delete
virtual PyToken::~PyToken ( )
inlineprotectedvirtual

Definition at line 558 of file PyRep.h.

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

Member Function Documentation

PyRep * PyToken::Clone ( ) const
virtual

Clones object.

Returns
Indentical copy of object.

Implements PyRep.

Definition at line 524 of file PyRep.cpp.

References PyToken().

525 {
526  return new PyToken( *this );
527 }
PyToken(const char *token)
Definition: PyRep.cpp:517

Here is the call graph for this function:

const std::string& PyToken::content ( ) const
inline

Obtain token.

Returns
Token.

Definition at line 555 of file PyRep.h.

References mValue.

Referenced by PyDumpVisitor::VisitToken(), and MarshalStream::VisitToken().

555 { return mValue; }
const std::string mValue
Definition: PyRep.h:559

Here is the caller graph for this function:

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

References PyVisitor::VisitToken().

530 {
531  return v.VisitToken( this );
532 }
virtual bool VisitToken(const PyToken *rep)
Definition: PyVisitor.h:63

Here is the call graph for this function:

Member Data Documentation

const std::string PyToken::mValue
protected

Definition at line 559 of file PyRep.h.

Referenced by content().


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