2016-04-13 06:07:23 +00:00
|
|
|
#ifndef __URDE_CSIMPLEPOOL_HPP__
|
|
|
|
#define __URDE_CSIMPLEPOOL_HPP__
|
2015-08-17 20:33:58 +00:00
|
|
|
|
2015-08-22 01:58:41 +00:00
|
|
|
#include "IObjectStore.hpp"
|
2016-02-05 01:27:03 +00:00
|
|
|
#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-17 22:05:00 +00:00
|
|
|
{
|
2015-08-22 01:58:41 +00:00
|
|
|
class IFactory;
|
2016-02-05 01:27:03 +00:00
|
|
|
class CObjectReference;
|
2015-08-17 22:05:00 +00:00
|
|
|
|
2015-08-18 05:54:43 +00:00
|
|
|
class CSimplePool : public IObjectStore
|
2015-08-17 20:33:58 +00:00
|
|
|
{
|
2016-04-05 01:51:25 +00:00
|
|
|
protected:
|
2017-01-22 04:32:53 +00:00
|
|
|
u8 x4_;
|
|
|
|
u8 x5_;
|
|
|
|
std::unordered_map<SObjectTag, CObjectReference*> x8_resources;
|
|
|
|
IFactory& x18_factory;
|
|
|
|
CVParamTransfer x1c_paramXfer;
|
2015-08-18 05:54:43 +00:00
|
|
|
public:
|
2016-02-05 01:27:03 +00:00
|
|
|
CSimplePool(IFactory& factory);
|
2018-05-20 06:14:57 +00:00
|
|
|
~CSimplePool();
|
2016-02-05 01:27:03 +00:00
|
|
|
CToken GetObj(const SObjectTag&, const CVParamTransfer&);
|
|
|
|
CToken GetObj(const SObjectTag&);
|
2017-11-13 06:19:18 +00:00
|
|
|
CToken GetObj(std::string_view);
|
|
|
|
CToken GetObj(std::string_view, const CVParamTransfer&);
|
2016-02-05 05:52:05 +00:00
|
|
|
bool HasObject(const SObjectTag&) const;
|
|
|
|
bool ObjectIsLive(const SObjectTag&) const;
|
2017-01-22 04:32:53 +00:00
|
|
|
IFactory& GetFactory() const {return x18_factory;}
|
2016-02-05 01:27:03 +00:00
|
|
|
void Flush();
|
|
|
|
void ObjectUnreferenced(const SObjectTag&);
|
2017-02-12 03:17:18 +00:00
|
|
|
std::vector<SObjectTag> GetReferencedTags() const;
|
2015-08-17 20:33:58 +00:00
|
|
|
};
|
|
|
|
|
2015-08-17 22:05:00 +00:00
|
|
|
}
|
|
|
|
|
2016-04-13 06:07:23 +00:00
|
|
|
#endif // __URDE_CSIMPLEPOOL_HPP__
|