|
The Vish Visualization Shell 0.3
Vish
|
A Domain-related abstract base class for reference-counted objects which occupy some memory but are able to release it on demand. More...
#include <elementary/memcore/CreatorBase.hpp>
Classes | |
| struct | Exception |
| Associated Exception class. More... | |
| class | Producer |
| Interface class for Creatures that allow on-demand creation of Creatures. More... | |
Public Member Functions | |
| RefPtr< Domain > | create (bool CreateAsOld=false) |
| Actually create the object, using an existing one if existent via the get() function, otherwise calling the virtual produce() function. | |
| RefPtr< Domain > | createAsOld () |
| Get and possibly create data here without touching it, which is useful if the data is required only temporary. | |
| CreatorBase (const WCachePtr &theCache) | |
| Construct with Cache object given. | |
| virtual RefPtr< Domain > | get () const =0 |
| Try to get data if possible. | |
| RefPtr< Domain > | get_or_request (const result &R=nullptr) |
| Asynchronous data access: Get the data if available, otherwise request them if possible and return nullptr. | |
| virtual const type_info & | getType ()=0 |
| Query the associated value type of this creator object. | |
| bool | isUnderCreation () const override |
| return true while a request issued by the producer is still ongoing | |
| virtual bool | request (const result &R=nullptr) |
| Asynchron mode: Request data to be created. | |
| virtual RefPtr< Domain > | take () |
| Take the data out of this creator and yield it as return value. | |
A Domain-related abstract base class for reference-counted objects which occupy some memory but are able to release it on demand.
|
inline |
Construct with Cache object given.
Note that enableCaching() has to be called explicitly later once a Creator has been associated with this Creature.
|
inline |
Get and possibly create data here without touching it, which is useful if the data is required only temporary.
It will not be marked as "important" and will be removed from memory as soon as possible if memory is tight.
References create().
|
inline |
|
pure virtual |
Query the associated value type of this creator object.
This type information can possibly be determined without actually loading any data. Whether or not this is the case is up to the implementation of the child class.
Implemented in MemCore::Creator< RefType, MyCreatorBase >, MemCore::Creator< ::Data, CreatorBase<::Data > >, MemCore::Creator< Object, CreatorBase< Object > >, MyOnDemandDataCreator, Wizt::DisplayListCreator, Wizt::TextureCreator, and Wizt::VBOCreator.
|
inlinevirtual |
Asynchron mode: Request data to be created.
Returns false if that is not possible. If create() returned false, and this request() as well, then we have a problem.
Referenced by get_or_request().
|
inlinevirtual |
Take the data out of this creator and yield it as return value.
This function implies a release() once the strong reference pointer to the data object is gone. This creator will no longer keep the data alive.
Reimplemented in MemCore::Creator< RefType, MyCreatorBase >, MemCore::Creator< ::Data, CreatorBase<::Data > >, and MemCore::Creator< Object, CreatorBase< Object > >.