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

Python integer. More...

#include "PyRep.h"

Inheritance diagram for PyInt:
Collaboration diagram for PyInt:

Public Member Functions

 PyInt (const int32 i)
 
 PyInt (const PyInt &oth)
 
 PyInt (PyInt &&oth)=delete
 
PyIntoperator= (const PyInt &oth)=delete
 
PyIntoperator= (PyInt &&oth)=delete
 
PyRepClone () const
 Clones object. More...
 
bool visit (PyVisitor &v) const
 Visits object. More...
 
int32 value () const
 
int32 hash () const
 virtual function to generate a hash value of a object. 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
 
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...
 
- 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 ~PyInt ()
 
- 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

const int32 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 integer.

Class representing 32-bit signed integer.

Definition at line 231 of file PyRep.h.

Constructor & Destructor Documentation

PyInt::PyInt ( const int32  i)

Definition at line 153 of file PyRep.cpp.

Referenced by Clone().

153 : PyRep( PyRep::PyTypeInt ), mValue( i ) {}
const int32 mValue
Definition: PyRep.h:253
PyRep(PyType t)
Definition: PyRep.cpp:73

Here is the caller graph for this function:

PyInt::PyInt ( const PyInt oth)

Definition at line 154 of file PyRep.cpp.

154 : PyRep( PyRep::PyTypeInt ), mValue( oth.value() ) {}
int32 value() const
Definition: PyRep.h:247
const int32 mValue
Definition: PyRep.h:253
PyRep(PyType t)
Definition: PyRep.cpp:73
PyInt::PyInt ( PyInt &&  oth)
delete
virtual PyInt::~PyInt ( )
inlineprotectedvirtual

Definition at line 252 of file PyRep.h.

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

Member Function Documentation

PyRep * PyInt::Clone ( ) const
virtual

Clones object.

Returns
Indentical copy of object.

Implements PyRep.

Definition at line 156 of file PyRep.cpp.

References PyInt().

157 {
158  return new PyInt( *this );
159 }
PyInt(const int32 i)
Definition: PyRep.cpp:153

Here is the call graph for this function:

int32 PyInt::hash ( ) const
virtual

virtual function to generate a hash value of a object.

virtual function to generate a hash value of a object to facilitate the various maps and checks.

Returns
returns a uint32 containing a hash function that represents the object.

Reimplemented from PyRep.

Definition at line 166 of file PyRep.cpp.

References mValue.

167 {
168  /* XXX If this is changed, you also need to change the way
169  * Python's long, float and complex types are hashed. */
170  int32 x = mValue;
171  if (x == -1 )
172  x = -2;
173  return x;
174 }
signed __int32 int32
Definition: eve-compat.h:49
const int32 mValue
Definition: PyRep.h:253
PyInt& PyInt::operator= ( const PyInt oth)
delete
PyInt& PyInt::operator= ( PyInt &&  oth)
delete
bool PyInt::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 161 of file PyRep.cpp.

References PyVisitor::VisitInteger().

162 {
163  return v.VisitInteger( this );
164 }
virtual bool VisitInteger(const PyInt *rep)
primitive data visitors
Definition: PyVisitor.h:55

Here is the call graph for this function:

Member Data Documentation

const int32 PyInt::mValue
protected

Definition at line 253 of file PyRep.h.

Referenced by hash(), and value().


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