From cf5562d509f9c42db049c2223a8dc1d8494c83b5 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Sat, 14 Jan 2023 02:00:14 -0800 Subject: [PATCH] Match and link CFactoryStore in a really dumb way Former-commit-id: ad212023401cf03272a89ba59bfd78b9a73ebff0 --- configure.py | 2 +- include/Kyoto/CSimplePool.hpp | 2 +- include/Kyoto/CVParamTransfer.hpp | 5 +++-- include/Kyoto/IObjectStore.hpp | 1 + src/Kyoto/CFactoryStore.cpp | 8 ++++++++ 5 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 src/Kyoto/CFactoryStore.cpp diff --git a/configure.py b/configure.py index 302fcc9f..213f8b5e 100755 --- a/configure.py +++ b/configure.py @@ -610,7 +610,7 @@ LIBS = [ ["Kyoto/Streams/CZipInputStream", True], ["Kyoto/Streams/CZipOutputStream", True], ["Kyoto/Streams/CZipSupport", True], - "Kyoto/CFactoryStore", + ["Kyoto/CFactoryStore", True], ["Kyoto/CObjectReference", True], "Kyoto/CSimplePool", ["Kyoto/CToken", True], diff --git a/include/Kyoto/CSimplePool.hpp b/include/Kyoto/CSimplePool.hpp index 29302093..5cd60592 100644 --- a/include/Kyoto/CSimplePool.hpp +++ b/include/Kyoto/CSimplePool.hpp @@ -12,7 +12,7 @@ class IFactory; class CSimplePool : public IObjectStore { public: - CSimplePool(IFactory& factory); + CSimplePool(IFactory& factory) : x18_factory(factory) {} ~CSimplePool(); virtual CToken GetObj(const SObjectTag& tag, CVParamTransfer xfer); diff --git a/include/Kyoto/CVParamTransfer.hpp b/include/Kyoto/CVParamTransfer.hpp index 1d884fd9..9f3945db 100644 --- a/include/Kyoto/CVParamTransfer.hpp +++ b/include/Kyoto/CVParamTransfer.hpp @@ -10,10 +10,11 @@ template < typename T > class TObjOwnerParam : public IVParamObj { public: ~TObjOwnerParam() {} - T* GetData() const { return static_cast(x4_data); } + TObjOwnerParam(T data) : x4_data(data) {} + T GetData() const { return static_cast(x4_data); } private: - T* x4_data; + T x4_data; }; class CVParamTransfer { diff --git a/include/Kyoto/IObjectStore.hpp b/include/Kyoto/IObjectStore.hpp index b673f9d3..3a03193f 100644 --- a/include/Kyoto/IObjectStore.hpp +++ b/include/Kyoto/IObjectStore.hpp @@ -11,6 +11,7 @@ class IFactory; class IObjectStore { public: + IObjectStore() {} virtual CToken GetObj(const SObjectTag& tag, CVParamTransfer xfer) = 0; virtual CToken GetObj(const SObjectTag& tag) = 0; virtual CToken GetObj(const char* name) = 0; diff --git a/src/Kyoto/CFactoryStore.cpp b/src/Kyoto/CFactoryStore.cpp new file mode 100644 index 00000000..fcb2a3c3 --- /dev/null +++ b/src/Kyoto/CFactoryStore.cpp @@ -0,0 +1,8 @@ +#include "Kyoto/CSimplePool.hpp" +#include "Kyoto/CResFactory.hpp" + +TObjOwnerParam DumbTest() { + CResFactory tmp; + CSimplePool pool(tmp); + return TObjOwnerParam(&pool); +}