Fish - FiberLib for VISH 0.3
Fish - The Fiber Bundle API for the Vish Visualization Shell
Fiber::AsynchronCreator Class Reference

A Creator object that generates its content on demand. More...

#include <AsynchronCreator.hpp>

Inheritance diagram for Fiber::AsynchronCreator:
MemCore::AlzheimerCreator< MemBase, CreativeArrayBase > MemCore::Creator< RefType, MyCreatorBase > MemCore::CreatorBase< Domain > AnalyticCreator< KerrMetric > AnalyticCreator< Formula > Fiber::TypedAsynchronCreator< Type >

Public Member Functions

 AsynchronCreator (const std::function< DataPtr_t(const std::atomic< bool > &) > &CreationFunctor, const RefPtr< MemCore::Cache > &theCache=MemCore::Cache::MemCache())
void setup (const DynamicSize &theSize, const RefPtr< FiberTypeBase > &MyFiberType)
const type_infogetType () override
RefPtr< MemBaseproduce () override
bool request (const result &R) override
bool isUnderCreation () const override
bool discardCreation () override
Creature::ReasonForReleasal release () override
Public Member Functions inherited from MemCore::Creator< RefType, MyCreatorBase >
 Creator (const RefPtr< RefType > &D, const WCachePtr &MyCache)
RefPtr< RefType > get () const override
CacheablePtr getCacheable () const override
const type_info & getType () override
bool hasData () const override
Creature::ReasonForReleasal release () override
bool supersede (const RefPtr< Domain > &NewData, bool CreateAsOld=false)
RefPtr< RefType > take () override
Public Member Functions inherited from MemCore::CreatorBase< Domain >
RefPtr< Domain > create (bool CreateAsOld=false)
RefPtr< Domain > createAsOld ()
 CreatorBase (const WCachePtr &theCache)
RefPtr< Domain > get_or_request (const result &R=nullptr)
bool isUnderCreation () const override
virtual bool request (const result &R=nullptr)

Protected Types

typedef AlzheimerCreator< MemBase, CreativeArrayBaseBase_t

Protected Member Functions

DataPtr_t create_data () const
Protected Member Functions inherited from MemCore::Creator< RefType, MyCreatorBase >
RefPtr< RefType > produce () override

Static Protected Member Functions

static bool createData (const MemCore::WeakPtr< AsynchronCreator > &TheCreator, const result &R)

Protected Attributes

volatile long NumberOfLoadingOperations { 0 }
std::atomic< bool > isLoading { false }
std::atomic< bool > discardCreationFlag { false }
std::mutex CreationMutex
std::mutex LoadingFlagMutex
std::function< DataPtr_t(const std::atomic< bool > &Stop) > myDataCreator
std::future< bool > AsynchroneouslyComputedData

Detailed Description

A Creator object that generates its content on demand.

Provide a lambda function to the constructor and all is set.

Member Function Documentation

◆ getType()

const type_info & Fiber::AsynchronCreator::getType ( )
overridevirtual