|
The Vish Visualization Shell 0.3
Vish
|
The Operator Cache is used to memorize the result of some update() operation, and to provide it to other routines knowing the same value pool context. More...
#include <ocean/plankton/VOperatorCache.hpp>
Classes | |
| struct | Cache |
| A Cache object, that assigns an OperatorCache with each VObject. More... | |
Public Member Functions | |
| bool | unchanged (const RefPtr< ValueSet > &VS) |
| Compare and assign a set of variable values. | |
| VOperatorCache () | |
| Constructor. | |
Public Member Functions inherited from MemCore::ReferenceBase< VOperatorCache< OperatorData > > | |
| auto | getObjectCountID () const noexcept |
| Get a unique ID for this object in the given domain. | |
| bool | isIdentical (const WeakPtr< VOperatorCache< OperatorData >, VOperatorCache< OperatorData > > &PossibleSelf) const noexcept |
| Check if this object is identical to the one used by the given pointer. | |
| void | mkAutoDestructive () |
| Marks this object as being automatically destructed, e.g. | |
| refcount_t | refcount () const noexcept |
| The strong reference count. | |
| ReferenceBase (VOperatorCache< OperatorData > *that) noexcept | |
| Constructor, initializes reference counter to zero. | |
| const auto & | self () const |
| Return weak pointer to the object self. | |
| refcount_t | wrefcount () const noexcept |
| The weak reference count. | |
Public Member Functions inherited from MemCore::Intercube | |
| void | addInterface (const RefPtr< InterfaceBase > &I) const |
| Add an interface class object. | |
| template<class Data > | |
| void | addInterfaceData (const Data &D) |
| Add data via an interface class object. | |
| template<class Data , typename TypeSelector > | |
| void | addInterfaceData (const Data &D) |
| Add data via an interface class object. | |
| void | clearInterfaces () |
| Remove all interfaces. | |
| bool | const_iterateInterfaces (const RefPtr< InterfaceIterationParameter > &IIP) const |
| Constant iterator. | |
| virtual RefPtr< InterfaceBase > | createInterface (const type_info &) const |
| Virtual function which allows derived objects to create Interface objects on demand. | |
| RefPtr< InterfaceBase > | findInterface (const type_info &t) const |
| Find a certain interface of specified type. | |
| RefPtr< InterfaceBase > | getInterface (const type_info &t) |
| Retrieve an interface object from a certain type. | |
| std::string | getInterfaceNames (const char delim=';') const |
| Debug function retrieving all interfaces as human-readable string. | |
| template<class Data > | |
| bool | gotNewInterfaceData (const Data &D) |
| Check whether data on the given interface have changed, and if so, set new data as interface. | |
| template<class Data > | |
| bool | gotNewInterfaceData (mutex &M, const Data &D) |
| Check whether interface data have changed, if so, then set new interface data and return true. | |
| template<class Data , typename Selector > | |
| bool | gotNewInterfaceData (mutex &M, const Data &D) |
| Check whether interface data have changed, if so, then set new interface data and return true. | |
| template<class Data , typename Selector > | |
| bool | gotNewInterfaceData (mutex &M, const Data &D, const Selector &S) |
| Check whether interface data have changed, if so, then set new interface data and return true. | |
| template<class Data , typename Selector > | |
| bool | gotNewInterfaceData (mutex &M, const Data &D, const Selector *S) |
| Check whether interface data have changed, if so, then set new interface data and return true. | |
| template<class Data > | |
| bool | hasChangedInterfaceData (const Data &D) const |
| Check whether interface data have changed. | |
| template<class Data , typename Selector > | |
| bool | hasChangedInterfaceData (const Data &D) const |
| Check whether interface data have changed. | |
| template<class Data , typename Selector > | |
| bool | hasChangedInterfaceData (const Data &D, const Selector &) const |
| Check whether interface data have changed. | |
| template<class Data , typename Selector > | |
| bool | hasChangedInterfaceData (const Data &D, const Selector *) const |
| Check whether interface data have changed. | |
| bool | hasInterface (const type_info &t) const |
| Check if some Interface might exist. | |
| Intercube () | |
| Constructor. | |
| bool | iterateInterfaces (const RefPtr< InterfaceIterationParameter > &IIP) |
| Modifyable iterator. | |
| void | printInterfaces () const |
| Debug function that prints the names of all interfaces. | |
| void | registerInterface (const type_info &t) |
| Register an interface type; when the interface is actually required, the virtual createInterface() function will be called. | |
| template<class InterfaceType > | |
| void | removeInterface () |
| Remove an interface. | |
| void | removeInterfaceBase (const type_info &InterfaceBaseID) |
| Remove an interface. | |
| virtual | ~Intercube () |
| Destructor. | |
Static Public Member Functions | |
| static Cache & | retrieve (Intercube &IC) |
| Create a Cache object that is associated with an arbitrary Intercube. | |
Public Attributes | |
| RefPtr< ValueSet > | Changeables |
| The set of associated variable values. | |
Additional Inherited Members | |
Public Types inherited from MemCore::ReferenceBase< VOperatorCache< OperatorData > > | |
| using | reference_domain_t = VOperatorCache< OperatorData > |
| The type of the base class. | |
| using | SelfPtr_t = WeakPtr< VOperatorCache< OperatorData >, VOperatorCache< OperatorData > > |
| Type for a pointer to this object itself. | |
Protected Member Functions inherited from MemCore::ReferenceBase< VOperatorCache< OperatorData > > | |
| virtual void | extremeUnction () |
| A virtual function that will be called just before the object is destroyed. | |
| ReferenceBase & | operator= (const ReferenceBase &R) |
| Protected assignment operator (should not be called). | |
| void | suicide () |
| Delete this. | |
| virtual | ~ReferenceBase () |
| Virtual destructor. | |
The Operator Cache is used to memorize the result of some update() operation, and to provide it to other routines knowing the same value pool context.
Provided we want to memorize a vector of doubles, then we simply instantiatee the OperatorCache template over this data type:
Now in the update() function we may get an operator cache given some Intercube object - for instance some field from the FiberLib2 library - (which relates to some driving input data) and a self() pointer:
The OperatorCache contains a set of variable values, i.e. a ValueSet. The purpose is to associate the OperatorCache with such a set of values. If any of these values has changed since the last update() call, then the OperatorCache needs to be filled with data from a new computation. A ValueSet that contains the parameters of such a compuation is easily created by providing an evaluation context (via the &-operator) and then add VSlot's (via the += and comma operator). The unchanged() member function checks if any differences among the values stored with the OperatorCache and the current values had occured:
If there had been changes, they are implicitely assigned by the unchanged() member function and the following code is supposed to compute new data.
@TODO Redesign to take care of local variable values implicitely.
|
inlinestatic |
Create a Cache object that is associated with an arbitrary Intercube.
If the Intercube goes away, to will this Cache object. If the given Intercube doesn't have a Cache object yet, one will be created.
A typical application example is a time-dependend field, where each time slice of the field is an Intercube, such that an operator cache can be associated with it.
References MemCore::Intercube::addInterface().
|
inline |
Compare and assign a set of variable values.
References Wizt::VOperatorCache< OperatorData >::Changeables.