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

Base Python wire object. More...

#include "PyRep.h"

Inheritance diagram for PyRep:
Collaboration diagram for PyRep:

Public Types

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...
 

Public Member Functions

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 PyRepClone () const =0
 Clones object. More...
 
virtual bool visit (PyVisitor &v) const =0
 Visits object. 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 ()
 

Static Public Member Functions

static std::string StringContent (PyRep *pRep)
 
static int64 IntegerValue (PyRep *pRep)
 
static uint32 IntegerValueU32 (PyRep *pRep)
 

Protected Member Functions

 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 PyType mType
 
- Protected Attributes inherited from RefObject
size_t mRefCount
 Reference count of instance. More...
 
bool mDeleted
 

Detailed Description

Base Python wire object.

Definition at line 66 of file PyRep.h.

Member Enumeration Documentation

Python wire object types.

Enumerator
PyTypeMin 
PyTypeInt 
PyTypeLong 
PyTypeFloat 
PyTypeBool 
PyTypeBuffer 
PyTypeString 
PyTypeWString 
PyTypeToken 
PyTypeTuple 
PyTypeList 
PyTypeDict 
PyTypeNone 
PyTypeSubStruct 
PyTypeSubStream 
PyTypeChecksumedStream 
PyTypeObject 
PyTypeObjectEx 
PyTypePackedRow 
PyTypeError 

Definition at line 72 of file PyRep.h.

Constructor & Destructor Documentation

PyRep::PyRep ( PyType  t)
protected
Todo:
this entire class should be better thought-out for class d'tors and object lifetime however, i dont fully understand it enough to implement better memMgmt at this time -allan 10Jan19
-- possibly rewrite to use shared_ptr/unique_ptr, then we can remove the RefObject inheritance here.

Definition at line 73 of file PyRep.cpp.

73 : RefObject(1), mType( t ) { }
const PyType mType
Definition: PyRep.h:223
RefObject(size_t initRefCount)
Initializes reference count.
Definition: RefPtr.h:59
PyRep::PyRep ( const PyRep oth)
protected

Definition at line 74 of file PyRep.cpp.

74 : RefObject(1/*oth.GetCount()*/), mType(oth.mType) {}
const PyType mType
Definition: PyRep.h:223
RefObject(size_t initRefCount)
Initializes reference count.
Definition: RefPtr.h:59
PyRep::PyRep ( PyRep &&  oth)
protecteddelete
virtual PyRep::~PyRep ( )
inlineprotectedvirtual

Definition at line 221 of file PyRep.h.

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

Member Function Documentation

PyBool* PyRep::AsBool ( )
inline

Definition at line 128 of file PyRep.h.

References IsBool().

Referenced by ClientSession::EncodeChanges(), IntegerValue(), IntegerValueU32(), and MarshalStream::VisitPackedRow().

128 { assert( IsBool() ); return (PyBool*)this; }
Python boolean.
Definition: PyRep.h:323
bool IsBool() const
Definition: PyRep.h:103

Here is the call graph for this function:

Here is the caller graph for this function:

const PyBool* PyRep::AsBool ( ) const
inline

Definition at line 129 of file PyRep.h.

References IsBool().

129 { assert( IsBool() ); return (const PyBool*)this; }
Python boolean.
Definition: PyRep.h:323
bool IsBool() const
Definition: PyRep.h:103

Here is the call graph for this function:

PyBuffer* PyRep::AsBuffer ( )
inline

Definition at line 130 of file PyRep.h.

References IsBuffer().

Referenced by PyTraceLog::_logInternBufferMessage().

130 { assert( IsBuffer() ); return (PyBuffer*)this; }
bool IsBuffer() const
Definition: PyRep.h:104
Python buffer.
Definition: PyRep.h:382

Here is the call graph for this function:

Here is the caller graph for this function:

const PyBuffer* PyRep::AsBuffer ( ) const
inline

Definition at line 131 of file PyRep.h.

References IsBuffer().

131 { assert( IsBuffer() ); return (const PyBuffer*)this; }
bool IsBuffer() const
Definition: PyRep.h:104
Python buffer.
Definition: PyRep.h:382

Here is the call graph for this function:

PyChecksumedStream* PyRep::AsChecksumedStream ( )
inline

Definition at line 150 of file PyRep.h.

References IsChecksumedStream().

Referenced by PyPacket::Decode().

150 { assert( IsChecksumedStream() ); return (PyChecksumedStream*)this; }
bool IsChecksumedStream() const
Definition: PyRep.h:114

Here is the call graph for this function:

Here is the caller graph for this function:

const PyChecksumedStream* PyRep::AsChecksumedStream ( ) const
inline

Definition at line 151 of file PyRep.h.

References IsChecksumedStream().

151 { assert( IsChecksumedStream() ); return (const PyChecksumedStream*)this; }
bool IsChecksumedStream() const
Definition: PyRep.h:114

Here is the call graph for this function:

PyDict* PyRep::AsDict ( )
inline

Definition at line 142 of file PyRep.h.

References IsDict().

Referenced by UserError::_GetDictKeywords(), UserError::_GetTupleKeywords(), CorporationDB::AddVoteCase(), CharacterPortrait::Build(), PyPacket::Clone(), PyCallStream::Clone(), PyObjectEx_Type1::GetKeywords(), PyObjectEx_Type2::GetKeywords(), and GPSTransportClosed::GetReasonArgs().

142 { assert( IsDict() ); return (PyDict*)this; }
Python's dictionary.
Definition: PyRep.h:719
bool IsDict() const
Definition: PyRep.h:110

Here is the call graph for this function:

Here is the caller graph for this function:

const PyDict* PyRep::AsDict ( ) const
inline

Definition at line 143 of file PyRep.h.

References IsDict().

143 { assert( IsDict() ); return (const PyDict*)this; }
Python's dictionary.
Definition: PyRep.h:719
bool IsDict() const
Definition: PyRep.h:110

Here is the call graph for this function:

PyFloat* PyRep::AsFloat ( )
inline

Definition at line 126 of file PyRep.h.

References IsFloat().

Referenced by CharacterAppearance::Build(), CharacterPortrait::Build(), IntegerValue(), IntegerValueU32(), Scan::RequestScans(), CharacterDB::SetAvatar(), CharacterDB::SetAvatarSculpts(), and MarshalStream::VisitPackedRow().

126 { assert( IsFloat() ); return (PyFloat*)this; }
Python floating point number.
Definition: PyRep.h:292
bool IsFloat() const
Definition: PyRep.h:102

Here is the call graph for this function:

Here is the caller graph for this function:

const PyFloat* PyRep::AsFloat ( ) const
inline

Definition at line 127 of file PyRep.h.

References IsFloat().

127 { assert( IsFloat() ); return (const PyFloat*)this; }
Python floating point number.
Definition: PyRep.h:292
bool IsFloat() const
Definition: PyRep.h:102

Here is the call graph for this function:

const PyInt* PyRep::AsInt ( ) const
inline

Definition at line 123 of file PyRep.h.

References IsInt().

123 { assert( IsInt() ); return (const PyInt*)this; }
Python integer.
Definition: PyRep.h:231
bool IsInt() const
Definition: PyRep.h:100

Here is the call graph for this function:

PyList* PyRep::AsList ( )
inline

Definition at line 140 of file PyRep.h.

References IsList().

Referenced by CorporationDB::AddVoteCase(), CharacterAppearance::Build(), and SetSQLDumper::VisitTuple().

140 { assert( IsList() ); return (PyList*)this; }
bool IsList() const
Definition: PyRep.h:109
Python list.
Definition: PyRep.h:639

Here is the call graph for this function:

Here is the caller graph for this function:

const PyList* PyRep::AsList ( ) const
inline

Definition at line 141 of file PyRep.h.

References IsList().

141 { assert( IsList() ); return (const PyList*)this; }
bool IsList() const
Definition: PyRep.h:109
Python list.
Definition: PyRep.h:639

Here is the call graph for this function:

PyLong* PyRep::AsLong ( )
inline

Definition at line 124 of file PyRep.h.

References IsLong().

Referenced by IntegerValue(), IntegerValueU32(), and MarshalStream::VisitPackedRow().

124 { assert( IsLong() ); return (PyLong*)this; }
bool IsLong() const
Definition: PyRep.h:101
Python long integer.
Definition: PyRep.h:261

Here is the call graph for this function:

Here is the caller graph for this function:

const PyLong* PyRep::AsLong ( ) const
inline

Definition at line 125 of file PyRep.h.

References IsLong().

125 { assert( IsLong() ); return (const PyLong*)this; }
bool IsLong() const
Definition: PyRep.h:101
Python long integer.
Definition: PyRep.h:261

Here is the call graph for this function:

PyNone* PyRep::AsNone ( )
inline

Definition at line 144 of file PyRep.h.

References IsNone().

144 { assert( IsNone() ); return (PyNone*)this; }
Python's "none".
Definition: PyRep.h:352
bool IsNone() const
Definition: PyRep.h:111

Here is the call graph for this function:

const PyNone* PyRep::AsNone ( ) const
inline

Definition at line 145 of file PyRep.h.

References IsNone().

145 { assert( IsNone() ); return (const PyNone*)this; }
Python's "none".
Definition: PyRep.h:352
bool IsNone() const
Definition: PyRep.h:111

Here is the call graph for this function:

PyObject* PyRep::AsObject ( )
inline

Definition at line 152 of file PyRep.h.

References IsObject().

Referenced by PyAddress::Decode(), and PyPacket::Decode().

152 { assert( IsObject() ); return (PyObject*)this; }
bool IsObject() const
Definition: PyRep.h:115
Python object.
Definition: PyRep.h:826

Here is the call graph for this function:

Here is the caller graph for this function:

const PyObject* PyRep::AsObject ( ) const
inline

Definition at line 153 of file PyRep.h.

References IsObject().

153 { assert( IsObject() ); return (const PyObject*)this; }
bool IsObject() const
Definition: PyRep.h:115
Python object.
Definition: PyRep.h:826

Here is the call graph for this function:

PyObjectEx* PyRep::AsObjectEx ( )
inline

Definition at line 154 of file PyRep.h.

References IsObjectEx().

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

154 { assert( IsObjectEx() ); return (PyObjectEx*)this; }
Python extended object.
Definition: PyRep.h:861
bool IsObjectEx() const
Definition: PyRep.h:116

Here is the call graph for this function:

Here is the caller graph for this function:

const PyObjectEx* PyRep::AsObjectEx ( ) const
inline

Definition at line 155 of file PyRep.h.

References IsObjectEx().

155 { assert( IsObjectEx() ); return (const PyObjectEx*)this; }
Python extended object.
Definition: PyRep.h:861
bool IsObjectEx() const
Definition: PyRep.h:116

Here is the call graph for this function:

PyPackedRow* PyRep::AsPackedRow ( )
inline

Definition at line 156 of file PyRep.h.

References IsPackedRow().

Referenced by CRowSet::GetRow(), CIndexedRowSet::GetRow(), CFilterRowSet::GetRow(), and StaticDataMgr::SetBPMatlType().

156 { assert( IsPackedRow() ); return (PyPackedRow*)this; }
bool IsPackedRow() const
Definition: PyRep.h:117
Packed row.
Definition: PyRep.h:961

Here is the call graph for this function:

Here is the caller graph for this function:

const PyPackedRow* PyRep::AsPackedRow ( ) const
inline

Definition at line 157 of file PyRep.h.

References IsPackedRow().

157 { assert( IsPackedRow() ); return (const PyPackedRow*)this; }
bool IsPackedRow() const
Definition: PyRep.h:117
Packed row.
Definition: PyRep.h:961

Here is the call graph for this function:

PyString* PyRep::AsString ( )
inline

Definition at line 132 of file PyRep.h.

References IsString().

Referenced by PyTraceLog::_logInternBufferPacket(), PyTraceLog::_logInternStringMessage(), DBRowDescriptor::GetColumnName(), UnmarshalStream::LoadObject(), StringContent(), and PyXMLGenerator::VisitDict().

132 { assert( IsString() ); return (PyString*)this; }
Python string.
Definition: PyRep.h:430
bool IsString() const
Definition: PyRep.h:105

Here is the call graph for this function:

Here is the caller graph for this function:

const PyString* PyRep::AsString ( ) const
inline

Definition at line 133 of file PyRep.h.

References IsString().

133 { assert( IsString() ); return (const PyString*)this; }
Python string.
Definition: PyRep.h:430
bool IsString() const
Definition: PyRep.h:105

Here is the call graph for this function:

PySubStream* PyRep::AsSubStream ( )
inline

Definition at line 148 of file PyRep.h.

References IsSubStream().

Referenced by PyPacket::Decode().

148 { assert( IsSubStream() ); return (PySubStream*)this; }
bool IsSubStream() const
Definition: PyRep.h:113

Here is the call graph for this function:

Here is the caller graph for this function:

const PySubStream* PyRep::AsSubStream ( ) const
inline

Definition at line 149 of file PyRep.h.

References IsSubStream().

149 { assert( IsSubStream() ); return (const PySubStream*)this; }
bool IsSubStream() const
Definition: PyRep.h:113

Here is the call graph for this function:

PySubStruct* PyRep::AsSubStruct ( )
inline

Definition at line 146 of file PyRep.h.

References IsSubStruct().

146 { assert( IsSubStruct() ); return (PySubStruct*)this; }
bool IsSubStruct() const
Definition: PyRep.h:112

Here is the call graph for this function:

const PySubStruct* PyRep::AsSubStruct ( ) const
inline

Definition at line 147 of file PyRep.h.

References IsSubStruct().

147 { assert( IsSubStruct() ); return (const PySubStruct*)this; }
bool IsSubStruct() const
Definition: PyRep.h:112

Here is the call graph for this function:

PyToken* PyRep::AsToken ( )
inline

Definition at line 136 of file PyRep.h.

References IsToken().

Referenced by PyObjectEx_Type1::GetType().

136 { assert( IsToken() ); return (PyToken*)this; }
Python token (eg. class name).
Definition: PyRep.h:522
bool IsToken() const
Definition: PyRep.h:107

Here is the call graph for this function:

Here is the caller graph for this function:

const PyToken* PyRep::AsToken ( ) const
inline

Definition at line 137 of file PyRep.h.

References IsToken().

137 { assert( IsToken() ); return (const PyToken*)this; }
Python token (eg. class name).
Definition: PyRep.h:522
bool IsToken() const
Definition: PyRep.h:107

Here is the call graph for this function:

const PyTuple* PyRep::AsTuple ( ) const
inline

Definition at line 139 of file PyRep.h.

References IsTuple().

139 { assert( IsTuple() ); return (const PyTuple*)this; }
bool IsTuple() const
Definition: PyRep.h:108
Python tuple.
Definition: PyRep.h:567

Here is the call graph for this function:

PyWString* PyRep::AsWString ( )
inline

Definition at line 134 of file PyRep.h.

References IsWString().

Referenced by PasswordString::GetPassword(), and StringContent().

134 { assert( IsWString() ); return (PyWString*)this; }
Python wide string.
Definition: PyRep.h:475
bool IsWString() const
Definition: PyRep.h:106

Here is the call graph for this function:

Here is the caller graph for this function:

const PyWString* PyRep::AsWString ( ) const
inline

Definition at line 135 of file PyRep.h.

References IsWString().

135 { assert( IsWString() ); return (const PyWString*)this; }
Python wide string.
Definition: PyRep.h:475
bool IsWString() const
Definition: PyRep.h:106

Here is the call graph for this function:

void PyRep::Dump ( FILE *  into,
const char *  pfx 
) const

Dumps object to file.

Parameters
[in]intoFile into which dump should be written.
[in]pfxPrefix which is put in front of each line.

Definition at line 84 of file PyRep.cpp.

References visit().

Referenced by EVEClientSession::_HandleCommand(), Client::_SendQueuedUpdates(), Client::_VerifyFuncResult(), CorporationDB::AddVoteCase(), PyCallable::Call(), EntityService::CreateBoundObject(), FleetObject::CreateBoundObject(), PosMgr::CreateBoundObject(), AggressionMgrService::CreateBoundObject(), PlanetORB::CreateBoundObject(), RepairService::CreateBoundObject(), SkillMgrService::CreateBoundObject(), PlanetMgrService::CreateBoundObject(), JumpCloneService::CreateBoundObject(), ShipService::CreateBoundObject(), KeeperService::CreateBoundObject(), CharMgrService::CreateBoundObject(), PyAddress::Decode(), PyCallStream::Decode(), EVENotificationStream::Decode(), PyCallArgs::Dump(), PyCachedObject::Dump(), PyCachedObjectDecoder::Dump(), PyCachedCall::Dump(), FleetService::FleetBroadcast(), LiveUpdateDB::GenerateUpdates(), AllianceDB::GetApplications(), CorporationDB::GetApplications(), FleetService::GetAvailableFleets(), Colony::GetColony(), AllianceDB::GetContacts(), CorporationDB::GetContacts(), PlanetSE::GetExtractorsForPlanet(), Agent::GetInfoServiceDetails(), ShipItem::GetLinkedWeapons(), AllianceDB::GetMembers(), AgentBound::GetMissionObjectiveInfo(), AllianceDB::GetMyApplications(), CorporationDB::GetMyApplications(), MarketMgr::GetNewPriceHistory(), MarketMgr::GetOldPriceHistory(), MarketDB::GetOrders(), PlanetSE::GetPlanetInfo(), PlanetSE::GetPlanetResourceInfo(), TowerSE::GetProcessInfo(), PlanetSE::GetResourceData(), ShipItem::GetShipInfo(), AccountDB::GetWalletDivisionsInfo(), FleetService::GetWings(), Inventory::List(), CharacterDB::ListStationBlueprintItems(), CharacterDB::ListStationItems(), CharacterDB::ListStations(), CustomsSE::MakeSlimItem(), StructureSE::MakeSlimItem(), WreckSE::MakeSlimItem(), marshal_EVEMarshalTest(), CachedObjectMgr::OIDToString(), Scan::ProbeScanResult(), Client::QueueDestinyUpdate(), AttributeMap::SendChanges(), FleetService::SendFleetUpdate(), InventoryItem::SendItemChange(), Scan::ShipScanResult(), ActiveModule::ShowEffect(), Scan::SystemScanStarted(), UnmarshalLogText(), and Agent::UpdateStandings().

85 {
86  PyFileDumpVisitor dumper( into, pfx );
87  visit( dumper );
88 }
virtual bool visit(PyVisitor &v) const =0
Visits object.

Here is the call graph for this function:

void PyRep::Dump ( LogType  type,
const char *  pfx 
) const

Dumps object to console.

Parameters
[in]typeLog type to use for dump.
[in]pfxPrefix which is put in front of each line.

Definition at line 90 of file PyRep.cpp.

References visit().

91 {
92  PyLogDumpVisitor dumper( type, type, pfx );
93  visit( dumper );
94 }
virtual bool visit(PyVisitor &v) const =0
Visits object.

Here is the call graph for this function:

PyType PyRep::GetType ( ) const
inline

Definition at line 98 of file PyRep.h.

References mType.

Referenced by PyTraceLog::_logInternBufferPacket(), and PyRowsetReader::iterator::GetType().

98 { return mType; }
const PyType mType
Definition: PyRep.h:223

Here is the caller graph for this function:

int32 PyRep::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 in PyPackedRow, PyTuple, PyWString, PyString, PyBuffer, PyNone, PyFloat, PyLong, and PyInt.

Definition at line 96 of file PyRep.cpp.

References sLog, and TypeString().

Referenced by ClientSession::_Set(), PyFloat::hash(), PyPackedRow::hash(), PyDict::_hash::operator()(), PyDict::_comp::operator()(), and PyDict::SetItem().

97 {
98  sLog.Error( "Hash", "Unhashable type: '%s'", TypeString() );
99  return -1;
100 }
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
const char * TypeString() const
Definition: PyRep.cpp:76

Here is the call graph for this function:

Here is the caller graph for this function:

int64 PyRep::IntegerValue ( PyRep pRep)
static

Definition at line 118 of file PyRep.cpp.

References AsBool(), AsFloat(), AsInt(), AsLong(), IsBool(), IsFloat(), IsInt(), IsLong(), PyInt::value(), PyLong::value(), PyFloat::value(), and PyBool::value().

Referenced by PyAddress::_DecodeCallID(), PyAddress::_DecodeObjectID(), CorporationDB::AddVoteCase(), CharacterAppearance::Build(), CharacterPortrait::Build(), AllianceRegistry::CreateBoundObject(), CorpRegistryService::CreateBoundObject(), Colony::CreateRoute(), PyAddress::Decode(), PyPacket::Decode(), PyCallStream::Decode(), EVENotificationStream::Decode(), ClientSession::GetCurrentInt(), ClientSession::GetCurrentLong(), ClientSession::GetLastInt(), ClientSession::GetLastLong(), CorpRegistryBound::GetSearchValues(), PlanetMgr::KillExtractorHead(), PlanetMgr::RemoveLink(), PlanetMgr::RemovePin(), PlanetMgr::RemoveRoute(), PlanetMgr::SetLinkLevel(), PlanetMgr::SetSchematic(), and PlanetMgr::UpgradeCommandCenter().

119 {
120  if (pRep == nullptr)
121  return 0;
122  else if (pRep->IsInt())
123  return pRep->AsInt()->value();
124  else if (pRep->IsLong())
125  return pRep->AsLong()->value();
126  else if (pRep->IsFloat())
127  return pRep->AsFloat()->value();
128  else if (pRep->IsBool())
129  return pRep->AsBool()->value();
130 
131  return 0;
132 }
double value() const
Definition: PyRep.h:309
int32 value() const
Definition: PyRep.h:247
PyBool * AsBool()
Definition: PyRep.h:128
bool value() const
Definition: PyRep.h:340
PyLong * AsLong()
Definition: PyRep.h:124
int64 value() const
Definition: PyRep.h:278
bool IsBool() const
Definition: PyRep.h:103
bool IsLong() const
Definition: PyRep.h:101
bool IsFloat() const
Definition: PyRep.h:102
bool IsInt() const
Definition: PyRep.h:100
PyFloat * AsFloat()
Definition: PyRep.h:126
PyInt * AsInt()
Definition: PyRep.h:122

Here is the call graph for this function:

Here is the caller graph for this function:

uint32 PyRep::IntegerValueU32 ( PyRep pRep)
static

Definition at line 134 of file PyRep.cpp.

References AsBool(), AsFloat(), AsInt(), AsLong(), IsBool(), IsFloat(), IsInt(), IsLong(), PyInt::value(), PyLong::value(), PyFloat::value(), and PyBool::value().

Referenced by _IoN(), PlanetMgr::CreatePin(), and Scan::RequestScans().

134  {
135  if (pRep == nullptr)
136  return 0;
137  else if (pRep->IsInt())
138  return pRep->AsInt()->value();
139  else if (pRep->IsLong())
140  return pRep->AsLong()->value();
141  else if (pRep->IsFloat())
142  return pRep->AsFloat()->value();
143  else if (pRep->IsBool())
144  return pRep->AsBool()->value();
145 
146  return 0;
147 }
double value() const
Definition: PyRep.h:309
int32 value() const
Definition: PyRep.h:247
PyBool * AsBool()
Definition: PyRep.h:128
bool value() const
Definition: PyRep.h:340
PyLong * AsLong()
Definition: PyRep.h:124
int64 value() const
Definition: PyRep.h:278
bool IsBool() const
Definition: PyRep.h:103
bool IsLong() const
Definition: PyRep.h:101
bool IsFloat() const
Definition: PyRep.h:102
bool IsInt() const
Definition: PyRep.h:100
PyFloat * AsFloat()
Definition: PyRep.h:126
PyInt * AsInt()
Definition: PyRep.h:122

Here is the call graph for this function:

Here is the caller graph for this function:

bool PyRep::IsBool ( ) const
inline

Definition at line 103 of file PyRep.h.

References mType, and PyTypeBool.

Referenced by AsBool(), DBTYPE_IsCompatible(), IntegerValue(), and IntegerValueU32().

103 { return mType == PyTypeBool; }
const PyType mType
Definition: PyRep.h:223

Here is the caller graph for this function:

bool PyRep::IsBuffer ( ) const
inline

Definition at line 104 of file PyRep.h.

References mType, and PyTypeBuffer.

Referenced by AsBuffer(), and DBTYPE_IsCompatible().

104 { return mType == PyTypeBuffer; }
const PyType mType
Definition: PyRep.h:223

Here is the caller graph for this function:

bool PyRep::IsChecksumedStream ( ) const
inline

Definition at line 114 of file PyRep.h.

References mType, and PyTypeChecksumedStream.

Referenced by AsChecksumedStream(), and PyPacket::Decode().

114 { return mType == PyTypeChecksumedStream; }
const PyType mType
Definition: PyRep.h:223

Here is the caller graph for this function:

bool PyRep::IsDict ( ) const
inline

Definition at line 110 of file PyRep.h.

References mType, and PyTypeDict.

Referenced by AsDict(), and PyCachedCall::Decode().

110 { return mType == PyTypeDict; }
const PyType mType
Definition: PyRep.h:223

Here is the caller graph for this function:

bool PyRep::IsFloat ( ) const
inline

Definition at line 102 of file PyRep.h.

References mType, and PyTypeFloat.

Referenced by AsFloat(), IntegerValue(), IntegerValueU32(), and CharacterDB::SetAvatarSculpts().

102 { return mType == PyTypeFloat; }
const PyType mType
Definition: PyRep.h:223

Here is the caller graph for this function:

bool PyRep::IsList ( ) const
inline

Definition at line 109 of file PyRep.h.

References mType, and PyTypeList.

Referenced by CorporationDB::AddVoteCase(), AsList(), and SetSQLDumper::VisitTuple().

109 { return mType == PyTypeList; }
const PyType mType
Definition: PyRep.h:223

Here is the caller graph for this function:

bool PyRep::IsLong ( ) const
inline

Definition at line 101 of file PyRep.h.

References mType, and PyTypeLong.

Referenced by AsLong(), IntegerValue(), and IntegerValueU32().

101 { return mType == PyTypeLong; }
const PyType mType
Definition: PyRep.h:223

Here is the caller graph for this function:

bool PyRep::IsNone ( ) const
inline

Definition at line 111 of file PyRep.h.

References mType, and PyTypeNone.

Referenced by AsNone(), DBTYPE_IsCompatible(), StringContent(), and MarshalStream::VisitPackedRow().

111 { return mType == PyTypeNone; }
const PyType mType
Definition: PyRep.h:223

Here is the caller graph for this function:

bool PyRep::IsObject ( ) const
inline

Definition at line 115 of file PyRep.h.

References mType, and PyTypeObject.

Referenced by AsObject(), PyAddress::Decode(), PyPacket::Decode(), and PyCachedObjectDecoder::Decode().

115 { return mType == PyTypeObject; }
const PyType mType
Definition: PyRep.h:223

Here is the caller graph for this function:

bool PyRep::IsObjectEx ( ) const
inline

Definition at line 116 of file PyRep.h.

References mType, and PyTypeObjectEx.

Referenced by AsObjectEx().

116 { return mType == PyTypeObjectEx; }
const PyType mType
Definition: PyRep.h:223

Here is the caller graph for this function:

bool PyRep::IsPackedRow ( ) const
inline

Definition at line 117 of file PyRep.h.

References mType, and PyTypePackedRow.

Referenced by AsPackedRow().

117 { return mType == PyTypePackedRow; }
const PyType mType
Definition: PyRep.h:223

Here is the caller graph for this function:

bool PyRep::IsString ( ) const
inline

Definition at line 105 of file PyRep.h.

References mType, and PyTypeString.

Referenced by AsString(), UnmarshalStream::LoadObject(), and StringContent().

105 { return mType == PyTypeString; }
const PyType mType
Definition: PyRep.h:223

Here is the caller graph for this function:

bool PyRep::IsSubStream ( ) const
inline

Definition at line 113 of file PyRep.h.

References mType, and PyTypeSubStream.

Referenced by AsSubStream(), and PyPacket::Decode().

113 { return mType == PyTypeSubStream; }
const PyType mType
Definition: PyRep.h:223

Here is the caller graph for this function:

bool PyRep::IsSubStruct ( ) const
inline

Definition at line 112 of file PyRep.h.

References mType, and PyTypeSubStruct.

Referenced by AsSubStruct().

112 { return mType == PyTypeSubStruct; }
const PyType mType
Definition: PyRep.h:223

Here is the caller graph for this function:

bool PyRep::IsToken ( ) const
inline

Definition at line 107 of file PyRep.h.

References mType, and PyTypeToken.

Referenced by AsToken().

107 { return mType == PyTypeToken; }
const PyType mType
Definition: PyRep.h:223

Here is the caller graph for this function:

bool PyRep::IsTuple ( ) const
inline
bool PyRep::IsWString ( ) const
inline

Definition at line 106 of file PyRep.h.

References mType, and PyTypeWString.

Referenced by AsWString(), DBTYPE_IsCompatible(), and StringContent().

106 { return mType == PyTypeWString; }
const PyType mType
Definition: PyRep.h:223

Here is the caller graph for this function:

PyRep& PyRep::operator= ( const PyRep oth)
protecteddefault
PyRep& PyRep::operator= ( PyRep &&  oth)
protecteddefault
std::string PyRep::StringContent ( PyRep pRep)
static

Definition at line 103 of file PyRep.cpp.

References _log, AsString(), AsWString(), PyString::content(), PyWString::content(), IsNone(), IsString(), IsWString(), and TypeString().

Referenced by PyAddress::_DecodeService(), CorporationDB::AddVoteCase(), PyAddress::Decode(), PyCallStream::Decode(), EVENotificationStream::Decode(), ClientSession::GetCurrentString(), ClientSession::GetLastString(), and CorpRegistryBound::GetSearchValues().

104 {
105  if (pRep == nullptr)
106  return "";
107  else if (pRep->IsString())
108  return pRep->AsString()->content();
109  else if (pRep->IsWString())
110  return pRep->AsWString()->content();
111  else if (pRep->IsNone())
112  return "";
113 
114  _log(COMMON__ERROR, "PyRep::StringContent() - Expected PyString or PyWString but got %s.", pRep->TypeString());
115  return "";
116 }
#define _log(type, fmt,...)
Definition: logsys.h:124
const std::string & content() const
Get the PyWString content.
Definition: PyRep.h:499
bool IsString() const
Definition: PyRep.h:105
PyString * AsString()
Definition: PyRep.h:132
bool IsNone() const
Definition: PyRep.h:111
const std::string & content() const
Get the PyString content.
Definition: PyRep.h:458
const char * TypeString() const
Definition: PyRep.cpp:76
PyWString * AsWString()
Definition: PyRep.h:134
bool IsWString() const
Definition: PyRep.h:106

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation


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