From 14cc300b86b1bf77adc8379b5ba1ddddc223e435 Mon Sep 17 00:00:00 2001 From: Marcus O'Flaherty Date: Wed, 10 Mar 2021 12:30:15 +0000 Subject: [PATCH] store pointers in Store class. --- src/Store/Store.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Store/Store.h b/src/Store/Store.h index 24948a7..5aaa793 100644 --- a/src/Store/Store.h +++ b/src/Store/Store.h @@ -55,6 +55,18 @@ class Store{ else return false; } + + template bool Get(std::string name, T* &out){ + if(m_variables.count(name)>0){ + std::stringstream stream(m_variables[name]); + intptr_t tmp; + stream>>tmp; + out = reinterpret_cast(tmp); + return true; + } + + else return false; + } /** Templated setter function to assign vairables in the Store. @@ -66,6 +78,13 @@ class Store{ stream< void Set(std::string name,T* in){ + intptr_t ptr_cast = reinterpret_cast(in); + std::stringstream stream; + stream<