diff --git a/alib2abstraction/src/abstraction/OperationAbstraction.hpp b/alib2abstraction/src/abstraction/OperationAbstraction.hpp index 6334afdfaecdb83235aa675a4ce5c9b8ad66b89e..f5c122d6221dd0371221e9e3fcd18a8549d85044 100644 --- a/alib2abstraction/src/abstraction/OperationAbstraction.hpp +++ b/alib2abstraction/src/abstraction/OperationAbstraction.hpp @@ -29,6 +29,7 @@ public: virtual bool eval ( ) = 0; virtual unsigned numberOfParams ( ) const = 0; virtual bool cached ( ) const = 0; + virtual void reset ( ) = 0; virtual ext::type_index getParamTypeIndex ( unsigned index ) const = 0; virtual ext::type_index getReturnTypeIndex ( ) const = 0; diff --git a/alib2abstraction/src/abstraction/PackingAbstraction.hpp b/alib2abstraction/src/abstraction/PackingAbstraction.hpp index 30a416db5b9c2921accfe744ab8627d74368146a..d5981c6e4ed2d0768c7adb57c3613731d1c0805a 100644 --- a/alib2abstraction/src/abstraction/PackingAbstraction.hpp +++ b/alib2abstraction/src/abstraction/PackingAbstraction.hpp @@ -96,6 +96,11 @@ public: return m_abstractions [ m_resultId ]->cached ( ); } + virtual void reset ( ) override { + for ( std::shared_ptr < abstraction::OperationAbstraction > & abstraction : m_abstractions ) + return abstraction->reset ( ); + } + virtual ext::type_index getParamTypeIndex ( unsigned index ) const override { return m_abstractions [ m_connections.at ( index ) [ 0 ].targetId ]->getParamTypeIndex ( m_connections.at ( index ) [ 0 ].paramPosition ); } diff --git a/alib2abstraction/src/abstraction/ValueOperationAbstraction.hpp b/alib2abstraction/src/abstraction/ValueOperationAbstraction.hpp index 642da8101111f89a6ffc8150d802c7701f438920..8a022b6847a0e4deca107b4d9484d30e16d51eb4 100644 --- a/alib2abstraction/src/abstraction/ValueOperationAbstraction.hpp +++ b/alib2abstraction/src/abstraction/ValueOperationAbstraction.hpp @@ -56,6 +56,10 @@ public: virtual bool cached ( ) const override { return ( bool ) m_data; } + + virtual void reset ( ) override { + m_data.reset ( ); + } }; template < class ReturnType > @@ -92,6 +96,10 @@ public: virtual bool cached ( ) const override { return ( bool ) m_data; } + + virtual void reset ( ) override { + m_data.reset ( ); + } }; template < class ReturnType > @@ -124,6 +132,10 @@ public: virtual bool cached ( ) const override { return ( bool ) m_data; } + + virtual void reset ( ) override { + m_data.reset ( ); + } }; template < class ReturnType > @@ -162,6 +174,10 @@ public: virtual bool cached ( ) const override { return ( bool ) m_data; } + + virtual void reset ( ) override { + m_data.reset ( ); + } }; template < class ReturnType > @@ -196,6 +212,10 @@ public: virtual bool cached ( ) const override { return ( bool ) m_data; } + + virtual void reset ( ) override { + m_data.reset ( ); + } }; template < > @@ -217,6 +237,9 @@ public: virtual bool cached ( ) const override { return false; } + + virtual void reset ( ) override { + } }; } /* namespace abstraction */ diff --git a/alib2abstraction/src/abstraction/WrapperAbstraction.hpp b/alib2abstraction/src/abstraction/WrapperAbstraction.hpp index 47f050ffe7d66787d14ae514e323fad2f7db02f1..69b3c78c7cefb03f9eb5b75aca56dc2bdcd9af86 100644 --- a/alib2abstraction/src/abstraction/WrapperAbstraction.hpp +++ b/alib2abstraction/src/abstraction/WrapperAbstraction.hpp @@ -88,6 +88,10 @@ public: return ( bool ) m_abstraction && m_abstraction->cached ( ); } + virtual void reset ( ) override { + m_abstraction = nullptr; + } + virtual ext::type_index getParamTypeIndex ( unsigned index ) const override { return ParamType < ParamTypes ... >::paramType ( index ); }