2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2015-08-17 20:33:58 +00:00
|
|
|
|
2016-02-05 01:27:03 +00:00
|
|
|
#include <unordered_map>
|
2019-09-23 19:00:23 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "Runtime/IObjectStore.hpp"
|
|
|
|
#include "Runtime/IVParamObj.hpp"
|
|
|
|
#include "Runtime/RetroTypes.hpp"
|
2015-08-18 05:54:43 +00:00
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce {
|
2016-02-05 01:27:03 +00:00
|
|
|
class CObjectReference;
|
2019-09-23 19:00:23 +00:00
|
|
|
class IFactory;
|
2015-08-17 22:05:00 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CSimplePool : public IObjectStore {
|
2016-04-05 01:51:25 +00:00
|
|
|
protected:
|
2018-12-08 05:30:43 +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:
|
2018-12-08 05:30:43 +00:00
|
|
|
CSimplePool(IFactory& factory);
|
2019-08-09 12:45:18 +00:00
|
|
|
~CSimplePool() override;
|
|
|
|
CToken GetObj(const SObjectTag&, const CVParamTransfer&) override;
|
|
|
|
CToken GetObj(const SObjectTag&) override;
|
|
|
|
CToken GetObj(std::string_view) override;
|
|
|
|
CToken GetObj(std::string_view, const CVParamTransfer&) override;
|
|
|
|
bool HasObject(const SObjectTag&) const override;
|
|
|
|
bool ObjectIsLive(const SObjectTag&) const override;
|
|
|
|
IFactory& GetFactory() const override { return x18_factory; }
|
|
|
|
void Flush() override;
|
|
|
|
void ObjectUnreferenced(const SObjectTag&) override;
|
2018-12-08 05:30:43 +00:00
|
|
|
std::vector<SObjectTag> GetReferencedTags() const;
|
2019-12-14 23:50:29 +00:00
|
|
|
size_t GetLiveObjects() const { return x8_resources.size(); }
|
2015-08-17 20:33:58 +00:00
|
|
|
};
|
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce
|