#include <IpCachedResults.hpp>
It stores the result (of type T), together with its dependencies (vector of TaggedObjects and vector of Numbers). It also stores a priority.
Public Member Functions | |
bool | DependentsIdentical (const std::vector< const TaggedObject * > &dependents, const std::vector< Number > &scalar_dependents) const |
This method returns true if the dependencies provided to this function are identical to the ones stored with the DependentResult. | |
void | DebugPrint () const |
Print information about this DependentResults. | |
Constructor, Destructors | |
DependentResult (const T &result, const std::vector< const TaggedObject * > &dependents, const std::vector< Number > &scalar_dependents) | |
Constructor, given all information about the result. | |
~DependentResult () | |
Destructor. | |
Accessor method. | |
bool | IsStale () const |
This returns true, if the DependentResult is no longer valid. | |
void | Invalidate () |
Invalidates the cached result. | |
const T & | GetResult () const |
Returns the cached result. | |
Protected Member Functions | |
virtual void | RecieveNotification (NotifyType notify_type, const Subject *subject) |
This method is overloading the pure virtual method from the Observer base class. |
DependentResult | ( | const T & | result, | |
const std::vector< const TaggedObject * > & | dependents, | |||
const std::vector< Number > & | scalar_dependents | |||
) | [inline] |
Constructor, given all information about the result.
References DBG_START_METH, fkinkryx::i, Observer::NT_Changed, and Observer::RequestAttach().
~DependentResult | ( | ) | [inline] |
bool IsStale | ( | ) | const [inline] |
This returns true, if the DependentResult is no longer valid.
void Invalidate | ( | ) | [inline] |
Invalidates the cached result.
const T & GetResult | ( | ) | const [inline] |
bool DependentsIdentical | ( | const std::vector< const TaggedObject * > & | dependents, | |
const std::vector< Number > & | scalar_dependents | |||
) | const [inline] |
This method returns true if the dependencies provided to this function are identical to the ones stored with the DependentResult.
References DBG_ASSERT, DBG_START_METH, and fkinkryx::i.
void DebugPrint | ( | ) | const [inline] |
void RecieveNotification | ( | NotifyType | notify_type, | |
const Subject * | subject | |||
) | [inline, protected, virtual] |
This method is overloading the pure virtual method from the Observer base class.
This method is called when a Subject registered for this Observer sends a notification. In this particular case, if this method is called with notify_type==NT_Changed or NT_BeingDeleted, then this results is marked as stale.
Implements Observer.
References DBG_START_METH, Observer::NT_BeingDestroyed, and Observer::NT_Changed.