EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
PyServiceMgr.h
Go to the documentation of this file.
1 /*
2  ------------------------------------------------------------------------------------
3  LICENSE:
4  ------------------------------------------------------------------------------------
5  This file is part of EVEmu: EVE Online Server Emulator
6  Copyright 2006 - 2021 The EVEmu Team
7  For the latest information visit https://evemu.dev
8  ------------------------------------------------------------------------------------
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU Lesser General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13 
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public License along with
19  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20  Place - Suite 330, Boston, MA 02111-1307, USA, or go to
21  http://www.gnu.org/copyleft/lesser.txt.
22  ------------------------------------------------------------------------------------
23  Author: Zhur
24 */
25 
26 
27 #ifndef __PYSERVICEMGR_H_INCL__
28 #define __PYSERVICEMGR_H_INCL__
29 
30 #include "eve-server.h"
31 
32 class PyService;
33 class PyCallable;
34 class PyBoundObject;
35 class PyPacket;
36 class ServiceDB;
37 class Client;
38 class PyRep;
39 class PySubStruct;
40 class EntityList;
41 class ObjCacheService;
42 class DBcore;
43 class ItemFactory;
44 
45 class LSCService;
46 
48 {
49 public:
50  struct BoundObj
51  {
52  Client* client; //we do not own this.
53  PyBoundObject* object; //we own this. PyServiceMgr deletes it
54  };
55 
56  PyServiceMgr( uint32 nodeID, EntityList& elist);
57  ~PyServiceMgr();
58 
59  void Initalize(double startTime);
60 
61  void Close();
62  void Process();
63 
64  void RegisterService(const std::string& name, PyService* svc);
65  PyService* LookupService(const std::string& name);
66 
67  uint32 GetNodeID() const { return m_nodeID; }
68 
69  //object binding, not fully understood yet.
70  PySubStruct *BindObject(Client* pClient, PyBoundObject* pObj, PyDict* dict=nullptr, PyDict *oid=nullptr);
72  void ClearBoundObject(uint32 bindID);
73 
74  //Area to access services by name. This isn't ideal, but it avoids casting.
75  //these may be NULL during service init, but should never be after that.
76  //we do not own these pointers (we do in their PyService * form though)
79 
80  // for shitz-n-giggles...command to list all bound objects in map
81  void BoundObjectVec(std::vector<BoundObj>& vec);
82 
83 protected:
84  std::map<std::string, PyService*> m_svcList; //we own these pointers.
85 
86 
87  typedef std::map<uint32, BoundObj> ObjectsBoundMap;
88  typedef ObjectsBoundMap::iterator ObjectsBoundMapItr;
89  ObjectsBoundMap m_boundObjects; // bindID/BoundObject{client/object(PyBoundObject)}
90 
93 };
94 
95 #endif
Base Python wire object.
Definition: PyRep.h:66
ObjectsBoundMap m_boundObjects
Definition: PyServiceMgr.h:89
PyBoundObject * FindBoundObject(uint32 bindID)
Python's dictionary.
Definition: PyRep.h:719
PyService * LookupService(const std::string &name)
uint32 GetNodeID() const
Definition: PyServiceMgr.h:67
ObjectsBoundMap::iterator ObjectsBoundMapItr
Definition: PyServiceMgr.h:88
void BoundObjectVec(std::vector< BoundObj > &vec)
std::map< uint32, BoundObj > ObjectsBoundMap
Definition: PyServiceMgr.h:87
PyServiceMgr(uint32 nodeID, EntityList &elist)
Definition: Client.h:66
LSCService * lsc_service
Definition: PyServiceMgr.h:77
unsigned __int32 uint32
Definition: eve-compat.h:50
Definition: dbcore.h:132
std::map< std::string, PyService * > m_svcList
Definition: PyServiceMgr.h:84
PySubStruct * BindObject(Client *pClient, PyBoundObject *pObj, PyDict *dict=nullptr, PyDict *oid=nullptr)
ObjCacheService * cache_service
Definition: PyServiceMgr.h:78
uint32 m_nodeID
Definition: PyServiceMgr.h:91
PyBoundObject * object
Definition: PyServiceMgr.h:53
void RegisterService(const std::string &name, PyService *svc)
void ClearBoundObject(uint32 bindID)
uint32 m_nextBindID
Definition: PyServiceMgr.h:92
void Initalize(double startTime)