diff --git a/src/sim/proxy_ptr.hh b/src/sim/proxy_ptr.hh index 968c1560cb..cd0d409ed2 100644 --- a/src/sim/proxy_ptr.hh +++ b/src/sim/proxy_ptr.hh @@ -251,7 +251,8 @@ class ProxyPtr : public ConstProxyPtr explicit ProxyPtr(Args&&... args) : CPP(0, args...) {} template ::value>> + typename std::enable_if_t::value && + !std::is_same::value>> ProxyPtr(const ProxyPtr &other) : CPP(other) {} ProxyPtr(const PP &other) : CPP(other) {} @@ -322,6 +323,30 @@ class ProxyPtr : public ConstProxyPtr } }; +template +class ProxyPtr +{ + protected: + Addr _addr; + + public: + ProxyPtr(Addr new_addr, ...) : _addr(new_addr) {} + + template + ProxyPtr(const ProxyPtr &other) : _addr(other.addr()) {} + + ProxyPtr & + operator = (Addr new_addr) + { + _addr = new_addr; + return *this; + } + + operator Addr() const { return _addr; } + + Addr addr() const { return _addr; } +}; + template typename std::enable_if_t::value, ProxyPtr> operator + (A a, const ProxyPtr &other) @@ -368,7 +393,7 @@ class SETranslatingPortProxy; template using ConstVPtr = ConstProxyPtr; -template +template using VPtr = ProxyPtr; #endif // __SIM_PROXY_PTR_HH__