2016-02-13 09:02:47 +00:00
|
|
|
#ifndef __PSHAG_CFACTORYMGR_HPP__
|
|
|
|
#define __PSHAG_CFACTORYMGR_HPP__
|
2015-08-23 06:42:29 +00:00
|
|
|
|
|
|
|
#include <unordered_map>
|
|
|
|
#include "RetroTypes.hpp"
|
|
|
|
|
2016-02-13 09:02:47 +00:00
|
|
|
namespace pshag
|
2015-08-23 06:42:29 +00:00
|
|
|
{
|
|
|
|
class SObjectTag;
|
|
|
|
class CVParamTransfer;
|
|
|
|
class CInputStream;
|
|
|
|
|
|
|
|
typedef void(*CFactoryFnReturn)(const SObjectTag&, CInputStream&, const CVParamTransfer&);
|
|
|
|
|
|
|
|
class CFactoryMgr
|
|
|
|
{
|
|
|
|
std::unordered_map<u32, CFactoryFnReturn> m_factories;
|
|
|
|
public:
|
|
|
|
MakeObjectFromMemory(const SObjectTag&, void*, int, bool, const CVParamTransfer&);
|
|
|
|
void AddFactory(FourCC key, CFactoryFnReturn func)
|
|
|
|
{
|
|
|
|
m_factories[key] = func;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-02-13 09:02:47 +00:00
|
|
|
#endif // __PSHAG_CFACTORYMGR_HPP__
|