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

Python list. More...

#include "PyRep.h"

Inheritance diagram for PyList:
Collaboration diagram for PyList:

Public Types

typedef std::vector< PyRep * > storage_type
 
typedef storage_type::iterator iterator
 
typedef
storage_type::const_iterator 
const_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...
 

Public Member Functions

 PyList (size_t item_count=0)
 
 PyList (const PyList &oth)
 
 PyList (PyList &&oth)=delete
 
PyListoperator= (const PyList &oth)
 
PyListoperator= (PyList &&oth)=delete
 
PyRepClone () const
 Clones object. More...
 
bool visit (PyVisitor &v) const
 Visits object. More...
 
const_iterator begin () const
 
const_iterator end () const
 
size_t size () const
 
bool empty () const
 
void clear ()
 
PyRepGetItem (size_t index) const
 Returns Python object. More...
 
void SetItem (size_t index, PyRep *object)
 Stores Python object. More...
 
void SetItemString (size_t index, const char *str)
 Stores Python string. More...
 
void AddItem (PyRep *i)
 
void AddItemInt (int32 intval)
 
void AddItemLong (int64 intval)
 
void AddItemReal (double realval)
 
void AddItemString (const char *str)
 
- 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 ()
 

Public Attributes

storage_type items
 

Protected Member Functions

virtual ~PyList ()
 
- 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...
 

Additional Inherited Members

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

Detailed Description

Python list.

Python's list, completely mutable.

Definition at line 639 of file PyRep.h.

Member Typedef Documentation

typedef storage_type::const_iterator PyList::const_iterator

Definition at line 644 of file PyRep.h.

typedef storage_type::iterator PyList::iterator

Definition at line 643 of file PyRep.h.

typedef std::vector<PyRep*> PyList::storage_type

Definition at line 642 of file PyRep.h.

Constructor & Destructor Documentation

PyList::PyList ( size_t  item_count = 0)

Definition at line 608 of file PyRep.cpp.

Referenced by Clone().

608 : PyRep(PyRep::PyTypeList), items(item_count, nullptr) { }
storage_type items
Definition: PyRep.h:708
PyRep(PyType t)
Definition: PyRep.cpp:73

Here is the caller graph for this function:

PyList::PyList ( const PyList oth)

Definition at line 609 of file PyRep.cpp.

609 : PyRep(PyRep::PyTypeList), items(oth.items) { }
storage_type items
Definition: PyRep.h:708
PyRep(PyType t)
Definition: PyRep.cpp:73
PyList::PyList ( PyList &&  oth)
delete
PyList::~PyList ( )
protectedvirtual

Definition at line 611 of file PyRep.cpp.

612 {
613  //for (auto cur : items)
614  // PySafeDecRef(cur);
615 }

Member Function Documentation

void PyList::AddItem ( PyRep i)
inline

Definition at line 701 of file PyRep.h.

References items.

Referenced by Client::_SendPingResponse(), AddItemInt(), AddItemLong(), AddItemReal(), AddItemString(), StaticDataMgr::CreateHeader(), DBResultToRowset(), ActiveModule::DeactivateCycle(), CorporationDB::Fetch(), SovereigntyDataMgr::GetAllianceBeacons(), SovereigntyDataMgr::GetAllianceSystems(), BookmarkDB::GetBookmarks(), BookmarkDB::GetBookmarksInFolder(), SystemManager::GetCurrentEntities(), RepairService::GetDamageReports(), SystemBubble::GetDroneState(), StructureSE::GetEffectState(), CalendarDB::GetEventList(), PlanetSE::GetExtractorsForPlanet(), BookmarkDB::GetFolders(), Agent::GetInfoServiceDetails(), InventoryItem::GetItemInfo(), ShipItem::GetLinkedWeapons(), AgentBound::GetMissionObjectiveInfo(), Colony::GetPins(), Scan::GetProbeDataForSig(), TowerSE::GetProcessInfo(), CalendarDB::GetResponsesForCharacter(), CalendarDB::GetResponsesToEvent(), Colony::GetRoutes(), CorporationDB::GetSharesForCorp(), StaticDataMgr::GetStationCount(), TowerSE::GetUsageFlagList(), AccountDB::GetWalletDivisionsInfo(), Colony::InstallProgram(), UnmarshalStream::LoadListOne(), UnmarshalStream::LoadObjectEx(), ShipSE::MakeSlimItem(), ItemSystemEntity::MakeSlimItem(), CRowSet::NewRow(), ServiceDB::PrimeOwners(), Client::QueueDestinyEvent(), Client::QueueDestinyUpdate(), SearchDB::QuickQuery(), ProbeSE::RecoverProbe(), InventoryItem::Rename(), CustomsSE::SendEffectUpdate(), StructureSE::SendEffectUpdate(), Character::SendSkillQueue(), StaticDataMgr::SetBPMatlType(), ModuleItem::SetOnline(), ShipItem::ShipGetModuleList(), Scan::ShipScanResult(), DroneSE::StateChange(), ShipItem::UnlinkWeapon(), and Agent::UpdateStandings().

701 { items.push_back( i ); }
storage_type items
Definition: PyRep.h:708
void PyList::AddItemInt ( int32  intval)
inline

Definition at line 702 of file PyRep.h.

References AddItem().

Referenced by DBResultToIntIntlistDict(), FleetService::GetAvailableFleets(), FleetService::GetFleetAdvert(), TargetManager::GetTargeters(), TargetManager::GetTargets(), Character::SkillQueueLoop(), and DroneSE::StateChange().

702 { AddItem( new PyInt( intval ) ); }
void AddItem(PyRep *i)
Definition: PyRep.h:701
Python integer.
Definition: PyRep.h:231

Here is the call graph for this function:

Here is the caller graph for this function:

void PyList::AddItemLong ( int64  intval)
inline

Definition at line 703 of file PyRep.h.

References AddItem().

703 { AddItem( new PyLong( intval ) ); }
void AddItem(PyRep *i)
Definition: PyRep.h:701
Python long integer.
Definition: PyRep.h:261

Here is the call graph for this function:

void PyList::AddItemReal ( double  realval)
inline

Definition at line 704 of file PyRep.h.

References AddItem().

704 { AddItem( new PyFloat( realval ) ); }
Python floating point number.
Definition: PyRep.h:292
void AddItem(PyRep *i)
Definition: PyRep.h:701

Here is the call graph for this function:

void PyList::AddItemString ( const char *  str)
inline

Definition at line 705 of file PyRep.h.

References AddItem().

705 { AddItem( new PyString( str ) ); }
Python string.
Definition: PyRep.h:430
void AddItem(PyRep *i)
Definition: PyRep.h:701

Here is the call graph for this function:

void PyList::clear ( )

Definition at line 627 of file PyRep.cpp.

References end(), items, and PySafeDecRef.

Referenced by Client::_SendQueuedUpdates(), PyPackedRow::clear(), Colony::GetPins(), and operator=().

628 {
629  iterator cur = items.begin(), end = items.end();
630  for (; cur != end; ++cur)
631  PySafeDecRef( *cur );
632 
633  items.clear();
634 }
storage_type::iterator iterator
Definition: PyRep.h:643
storage_type items
Definition: PyRep.h:708
const_iterator end() const
Definition: PyRep.h:661
#define PySafeDecRef(op)
Definition: PyRep.h:61

Here is the call graph for this function:

Here is the caller graph for this function:

PyRep * PyList::Clone ( ) const
virtual

Clones object.

Returns
Indentical copy of object.

Implements PyRep.

Definition at line 617 of file PyRep.cpp.

References PyList().

618 {
619  return new PyList( *this );
620 }
PyList(size_t item_count=0)
Definition: PyRep.cpp:608

Here is the call graph for this function:

bool PyList::empty ( ) const
inline

Definition at line 664 of file PyRep.h.

References items.

Referenced by Client::_SendQueuedUpdates(), Client::FlushQueue(), Client::QueueDestinyUpdate(), Character::SkillQueueLoop(), PyDumpVisitor::VisitList(), and PyDumpVisitor::VisitObjectEx().

664 { return items.empty(); }
storage_type items
Definition: PyRep.h:708

Here is the caller graph for this function:

PyRep* PyList::GetItem ( size_t  index) const
inline

Returns Python object.

Parameters
[in]indexIndex at which is the desired object.
Returns
Python object.

Definition at line 674 of file PyRep.h.

References items.

Referenced by CorporationDB::AddVoteCase(), Colony::CreateRoute(), PyPackedRow::GetField(), RowsetReader::iterator::GetRep(), TuplesetReader::iterator::GetRep(), CRowSet::GetRow(), and UnmarshalStream::GetStoredObject().

674 { return items.at( index ); }
storage_type items
Definition: PyRep.h:708

Here is the caller graph for this function:

PyList & PyList::operator= ( const PyList oth)

Definition at line 637 of file PyRep.cpp.

References begin(), clear(), end(), items, and size().

638 {
639  clear();
640  items.resize( oth.size() );
641  iterator cur = items.begin(), end = items.end();
642  const_iterator cur_oth = oth.begin(), oth_end = oth.end();
643  for (; cur != end && cur_oth != oth_end; ++cur, ++cur_oth)
644  {
645  if (*cur_oth == nullptr )
646  *cur = nullptr;
647  else
648  *cur = (*cur_oth)->Clone();
649  }
650 
651  return *this;
652 }
const_iterator begin() const
Definition: PyRep.h:660
storage_type::iterator iterator
Definition: PyRep.h:643
storage_type::const_iterator const_iterator
Definition: PyRep.h:644
storage_type items
Definition: PyRep.h:708
void clear()
Definition: PyRep.cpp:627
const_iterator end() const
Definition: PyRep.h:661
size_t size() const
Definition: PyRep.h:663

Here is the call graph for this function:

PyList& PyList::operator= ( PyList &&  oth)
delete
void PyList::SetItem ( size_t  index,
PyRep object 
)
inline

Stores Python object.

Parameters
[in]indexIndex at which the object should be stored.
[in]objectObject to be stored.

Definition at line 682 of file PyRep.h.

References items, PyIncRef, and PySafeDecRef.

Referenced by DBResultToIndexRowset(), DBResultToPackedRowList(), DBResultToPackedRowListTuple(), DBResultToRowset(), DBResultToTupleSet(), DBRowToRow(), LiveUpdateDB::GenerateUpdates(), TowerSE::GetDeployFlags(), SystemBubble::GetDroneState(), TowerSE::GetUsageFlagList(), UnmarshalStream::LoadList(), PyPackedRow::SetField(), SetItemString(), and UnmarshalStream::StoreObject().

683  {
684  PyRep** rep = &items.at( index );
685 
686  PySafeDecRef( *rep );
687  if (object == nullptr)
688  *rep = new PyNone();
689  else
690  *rep = object;
691  PyIncRef( *rep );
692  }
Base Python wire object.
Definition: PyRep.h:66
Python's "none".
Definition: PyRep.h:352
storage_type items
Definition: PyRep.h:708
#define PyIncRef(op)
Definition: PyRep.h:56
#define PySafeDecRef(op)
Definition: PyRep.h:61

Here is the caller graph for this function:

void PyList::SetItemString ( size_t  index,
const char *  str 
)
inline

Stores Python string.

Parameters
[in]indexIndex at which the object should be stored.
[in]strString to be stored.

Definition at line 699 of file PyRep.h.

References SetItem().

Referenced by DBResultToIndexRowset(), DBResultToRowList(), DBResultToRowset(), DBResultToTupleSet(), DBRowToRow(), TowerSE::GetDeployFlags(), SystemBubble::GetDroneState(), and TowerSE::GetUsageFlagList().

699 { SetItem( index, new PyString( str ) ); }
Python string.
Definition: PyRep.h:430
void SetItem(size_t index, PyRep *object)
Stores Python object.
Definition: PyRep.h:682

Here is the call graph for this function:

Here is the caller graph for this function:

size_t PyList::size ( ) const
inline

Definition at line 663 of file PyRep.h.

References items.

Referenced by Colony::CreateRoute(), PIDataMgr::GetProgramResultInfo(), CRowSet::GetRowCount(), CIndexedRowSet::GetRowCount(), operator=(), Character::SkillQueueLoop(), PyDumpVisitor::VisitList(), PyXMLGenerator::VisitList(), and MarshalStream::VisitList().

663 { return items.size(); }
storage_type items
Definition: PyRep.h:708

Here is the caller graph for this function:

bool PyList::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 622 of file PyRep.cpp.

References PyVisitor::VisitList().

623 {
624  return v.VisitList( this );
625 }
virtual bool VisitList(const PyList *rep)
Definition: PyVisitor.cpp:47

Here is the call graph for this function:

Member Data Documentation


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