metaforce/Runtime/CSimplePool.hpp

37 lines
977 B
C++
Raw Normal View History

2016-02-13 09:02:47 +00:00
#ifndef __PSHAG_CSIMPLEPOOL_HPP__
#define __PSHAG_CSIMPLEPOOL_HPP__
2015-08-17 20:33:58 +00:00
2015-08-22 01:58:41 +00:00
#include "IObjectStore.hpp"
#include "RetroTypes.hpp"
#include "IVParamObj.hpp"
#include <unordered_map>
2015-08-18 05:54:43 +00:00
2016-03-04 23:04:53 +00:00
namespace urde
{
2015-08-22 01:58:41 +00:00
class IFactory;
class CObjectReference;
2015-08-18 05:54:43 +00:00
class CSimplePool : public IObjectStore
2015-08-17 20:33:58 +00:00
{
protected:
std::list<std::pair<SObjectTag, CObjectReference*>> x4_resources;
//std::unordered_map<SObjectTag, CObjectReference*> x4_resources;
IFactory& x30_factory;
CVParamTransfer x34_paramXfer;
2015-08-18 05:54:43 +00:00
public:
CSimplePool(IFactory& factory);
CToken GetObj(const SObjectTag&, const CVParamTransfer&);
CToken GetObj(const SObjectTag&);
2016-04-11 03:59:54 +00:00
CToken GetObj(const char*);
CToken GetObj(const char*, const CVParamTransfer&);
bool HasObject(const SObjectTag&) const;
bool ObjectIsLive(const SObjectTag&) const;
IFactory& GetFactory() const {return x30_factory;}
void Flush();
void ObjectUnreferenced(const SObjectTag&);
2015-08-17 20:33:58 +00:00
};
}
2016-02-13 09:02:47 +00:00
#endif // __PSHAG_CSIMPLEPOOL_HPP__