metaforce/Runtime/CSimplePool.hpp

36 lines
909 B
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
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
2018-12-08 05:30:43 +00:00
namespace urde {
2015-08-22 01:58:41 +00:00
class IFactory;
class CObjectReference;
2018-12-08 05:30:43 +00:00
class CSimplePool : public IObjectStore {
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);
~CSimplePool();
CToken GetObj(const SObjectTag&, const CVParamTransfer&);
CToken GetObj(const SObjectTag&);
CToken GetObj(std::string_view);
CToken GetObj(std::string_view, const CVParamTransfer&);
bool HasObject(const SObjectTag&) const;
bool ObjectIsLive(const SObjectTag&) const;
IFactory& GetFactory() const { return x18_factory; }
void Flush();
void ObjectUnreferenced(const SObjectTag&);
std::vector<SObjectTag> GetReferencedTags() const;
2015-08-17 20:33:58 +00:00
};
2018-12-08 05:30:43 +00:00
} // namespace urde