FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Related Symbols | List of all members
Fiber::CreativeArrayBase Class Reference

Base class for multidimensional arrays that employ deferred storage, i.e. More...

#include <CreativeArrayBase.hpp>

Inheritance diagram for Fiber::CreativeArrayBase:
MemCore::CreatorBase< MemBase > Fiber::Ownable< CreativeArrayBase, CreativeArrayBaseContainerBase > Fiber::SaveableAttributes MemCore::Creature Fiber::OwnerBase MemCore::Attributes MemCore::ReferenceBase< Creature > MemCore::Intercube MemCore::Ageable Fiber::OnDemandCreator< Computer, Rank, result_value_type >

Public Types

enum class  CreationFailure {
  None , OutOfMemory , CannotOpen , CannotRead ,
  CannotSave , Timeout , Unknown
}
 
- Public Types inherited from MemCore::ReferenceBase< Creature >
typedef Object reference_domain_t
 
typedef WeakPtr< Object, Object > SelfPtr_t
 
- Public Types inherited from Fiber::OwnerBase
template<class ItemType >
using Item = MemCore::InterfaceData< ItemType >
 An optional convenience class that allows to easily add arbitrary types to Intercubes .
 

Public Member Functions

 CreativeArrayBase (const MemCore::WCachePtr &theCache)
 
Ageabletouch () throw ()
 
const AgeabletouchAttributes () const
 
const AgeableupdateAttributeAge (const Ageable &A) const
 
void extremeUnction ()
 
bool needsSaving () const
 Check if the data here need to be saved, i.e.
 
void hasBeenSaved () const
 Indicate that this dataset has been saved and does not need to be saved again.
 
void addDataMetaInfo (const MemCore::RefPtr< MemBase > &D)
 Set the type and size interfaces according to the given data.
 
const FiberTypeIndexgetFiberTypeIndex () const
 
auto value_type_size () const
 How many bytes this object occupies in memory.
 
RefPtr< FiberTypeBasegetFiberType () const
 
void setFiberType (const RefPtr< FiberTypeBase > &FTB)
 
template<class ... T>
bool isType () const
 
void addMetaInfo (const DynamicSize &theSize, const RefPtr< FiberTypeBase > &theDataType)
 
void addMetaInfo (int nDimensions, const RefPtr< FiberTypeBase > &theDataType)
 
RefPtr< BinderBasegetBinder () const
 Get the Binder from the Bundle where this Creator is contained, processing via Bundle::processOwnership(), which may be relatively slow.
 
void save (const MemCore::RefPtr< MemBase > &D) const
 Passes the data object backwards through the ownership hierarchy, ultimately calling Bundle::processOwnership() which in turn calls Binder::save().
 
- Public Member Functions inherited from MemCore::CreatorBase< MemBase >
RefPtr< Domain > create (bool CreateAsOld=false)
 
RefPtr< Domain > createAsOld ()
 
 CreatorBase (const WCachePtr &theCache)
 
virtual RefPtr< Domain > get () const =0
 
RefPtr< Domain > get_or_request (const result &R=nullptr)
 
virtual const type_info & getType ()=0
 
std::string hasProducer () const override
 
bool isReproducible () const override
 
bool isUnderCreation () const override
 
const WCachePtr & myCache () const
 
virtual bool request (const result &R=nullptr)
 
virtual RefPtr< Domain > take ()
 
- Public Member Functions inherited from MemCore::Creature
std::string addrstr () const
 
stringappendProvenance (const RefPtr< Provenance > &P)
 
stringappendProvenance (const string &s)
 
 Creature (const WCachePtr &myCache)
 
virtual bool discardCreation ()
 
void enableCaching (bool CreateAsOld=false) const
 
virtual CacheablePtr getCacheable () const=0
 
RefPtr< ProvenancegetFirstCreationSource () const
 
virtual bool hasData () const
 
const WCachePtr & myCache () const
 
virtual ReasonForReleasal release ()=0
 
ReasonForReleasal releasePtr (RefPtr< RefType > &Data) const
 
void resetStatistics ()
 
stringsetProvenance (const RefPtr< Provenance > &P)
 
stringsetProvenance (const string &s)
 
- Public Member Functions inherited from MemCore::ReferenceBase< Creature >
auto getObjectCountID () const noexcept
 
bool isIdentical (const WeakPtr< Object, Object > &PossibleSelf) const noexcept
 
void mkAutoDestructive ()
 
refcount_t refcount () const noexcept
 
 ReferenceBase (Object *that) noexcept
 
const auto & self () const
 
refcount_t wrefcount () const noexcept
 
- Public Member Functions inherited from MemCore::Intercube
void addInterface (const RefPtr< InterfaceBase > &I) const
 
void addInterfaceData (const Data &D)
 
void addInterfaceData (const Data &D)
 
void clearInterfaces ()
 
bool const_iterateInterfaces (const RefPtr< InterfaceIterationParameter > &IIP) const
 
virtual RefPtr< InterfaceBasecreateInterface (const type_info &) const
 
RefPtr< InterfaceBasefindInterface (const type_info &t) const
 
RefPtr< InterfaceBasegetInterface (const type_info &t)
 
std::string getInterfaceNames (const char delim=';') const
 
bool gotNewInterfaceData (const Data &D)
 
bool gotNewInterfaceData (mutex &M, const Data &D)
 
bool gotNewInterfaceData (mutex &M, const Data &D)
 
bool gotNewInterfaceData (mutex &M, const Data &D, const Selector &S)
 
bool gotNewInterfaceData (mutex &M, const Data &D, const Selector *S)
 
bool hasChangedInterfaceData (const Data &D) const
 
bool hasChangedInterfaceData (const Data &D) const
 
bool hasChangedInterfaceData (const Data &D, const Selector &) const
 
bool hasChangedInterfaceData (const Data &D, const Selector *) const
 
bool hasInterface (const type_info &t) const
 
bool iterateInterfaces (const RefPtr< InterfaceIterationParameter > &IIP)
 
void printInterfaces () const
 
void registerInterface (const type_info &t)
 
void removeInterface ()
 
void removeInterfaceBase (const type_info &InterfaceBaseID)
 
- Public Member Functions inherited from MemCore::Ageable
constexpr Ageable (age_t t) noexcept
 
constexpr Ageable (const Ageable &A) noexcept
 
 Ageable (const volatile Ageable &A) noexcept
 
constexpr const AgeablegetAge () const
 
bool isNewerThan (const Ageable &a) const noexcept
 
bool isOlderThan (const Ageable &a) const noexcept
 
bool isYoungerThan (const Ageable &a) const noexcept
 
bool operator!= (const Ageable &a) const noexcept
 
bool operator< (const Ageable &a) const noexcept
 
bool operator<= (const Ageable &a) const noexcept
 
bool operator<= (const volatile Ageable &a) const volatile noexcept
 
bool operator== (const Ageable &a) const noexcept
 
bool operator> (const Ageable &a) const noexcept
 
bool operator> (const volatile Ageable &a) const volatile
 
bool operator>= (const Ageable &a) const noexcept
 
bool operator>= (const volatile Ageable &a) const volatile noexcept
 
constexpr void resetAge () noexcept
 
void setInfinitelyNew () noexcept
 
age_t time_value () const noexcept
 
age_t time_value () const volatile noexcept
 
Ageabletouch () noexcept
 
age_t update (age_t age) noexcept
 
age_t update (const Ageable &Other) noexcept
 
age_t update (const volatile Ageable &Other) volatile noexcept
 
- Public Member Functions inherited from Fiber::Ownable< CreativeArrayBase, CreativeArrayBaseContainerBase >
void x_updateOwnershipAge (const MemCore::Ageable &theNewAge) override
 Forward some age to all Owners.
 
void insertOwner (const Container &theOwner)
 Add some owner.
 
bool insertOwner (const MemCore::WeakPtr< Container > &theOwner)
 Add some owner.
 
void addOwner (const Container &theOwner, const MemCore::Ageable &theNewAge)
 Add some owner and broadcast a new age to all Ownerrs.
 
void addOwner (const MemCore::WeakPtr< Container > &theOwner, const MemCore::Ageable &theNewAge)
 Add some owner and broadcast a new age to all Ownerrs.
 
 Ownable ()
 Default constructor, empty Ownership list.
 
 Ownable (const Ownable &)
 Copy constructor, does NOT copy any ownership information, the new Ownable will be unowned.
 
 Ownable (const MemCore::WeakPtr< Container > &theOwner, const MemCore::Ageable &theNewAge)
 Construct an Ownable with an initial owner.
 
 Ownable (const Container &theOwner, const MemCore::Ageable &theNewAge)
 Construct an Ownable with an initial owner.
 
Ownableoperator= (const Ownable &)
 Assignment, does NOT copy any ownership information, the assigned Ownable will retain all its ownership information.
 
MemCore::WeakPtr< Container > getPrimaryOwner () const
 Get the first valid owner.
 
size_t getNumberOfValidOwners () const
 Get the first valid owner.
 
bool processOwnership (MemCore::Intercube &Output, const MemCore::Intercube &Input) const override
 Process some ownership action.
 
- Public Member Functions inherited from Fiber::OwnerBase
bool processOwnership (MemCore::Intercube &OutputAndInput) const
 Process ownership where the input information is shared with the output information in the same Intercube.
 
- Public Member Functions inherited from Fiber::SaveableAttributes
void attributesHaveBeenSaved () const
 
bool attributesNeedSaving () const
 
- Public Member Functions inherited from MemCore::Attributes
MemCore::RefPtr< MemCore::ChunkBasegetAttribute (const std::string &name) const
 
const AgeablegetAttributeAge () const
 
std::pair< bool, T > getAttributeValue (const string &AttributeName, size_t ElementNumber=0) const
 
attributes_t & getAttributeValues ()
 
const attributes_t & getAttributeValues () const
 
size_t getNumberOfAttributes () const
 
bool hasAttribute (const std::string &name) const
 
int Iterate (const Functor &L) const
 
int iterate (Iterator &it) const
 
int iterate_attributes (const Functor &L) const
 
size_t NumberOfAttributes () const
 
void setAttribute (const std::string &name, const MemCore::RefPtr< MemCore::ChunkBase > &AttribData)
 
ResizableChunk< T > & setAttributeValue (const std::string &name, const T &AttribData)
 
ResizableChunk< T > & setAttributeValues (const std::string &name, const std::initializer_list< T > &AttribData)
 
const T & setValue (const T &AttribData, const std::string &name)
 
const T & setValue (const T &AttribData, const std::string &name, const std::string &Comment, const std::string &CommentPrefix="Comment")
 
string toString () const
 
const AgeabletouchAttributes () const
 
const AgeableupdateAttributeAge (const Ageable &A) const
 

Static Public Member Functions

static bool retryCreation (CreativeArrayBase &)
 
- Static Public Member Functions inherited from MemCore::Ageable
static const AgeableInfinitelyNew () noexcept
 
static constexpr const AgeableInfinitelyOld () noexcept
 
static age_t now () noexcept
 

Public Attributes

AgeRelativeToBinder LastSavedTimes
 
enum Fiber::CreativeArrayBase::CreationFailure Error = CreationFailure::None
 
- Public Attributes inherited from MemCore::Creature
std::string creationError
 
double LastCreationTime
 
std::list< RefPtr< Provenance > > myCreationSources
 
double TotalCreationTime
 
- Public Attributes inherited from Fiber::Ownable< CreativeArrayBase, CreativeArrayBaseContainerBase >
std::unordered_set< MemCore::WeakPtr< Container > > Owners
 The (internal) list of owners.
 
- Public Attributes inherited from Fiber::SaveableAttributes
MemCore::Ageable LastSavedAttributes
 

Protected Attributes

FiberTypeIndex myFiberTypeIndex
 
MemCore::WeakPtr< FiberTypeBasemyFiberTypeBase
 

Related Symbols

(Note that these are not member symbols.)

Ageable LastSaved
 The age when the data contained here had been saved last. (), CreatorConstructionContext.
 

Additional Inherited Members

- Protected Member Functions inherited from MemCore::ReferenceBase< Creature >
ReferenceBaseoperator= (const ReferenceBase &R)
 
void suicide ()
 

Detailed Description

Base class for multidimensional arrays that employ deferred storage, i.e.

they do not reside in memory all time, but are created on demand. Child classes must implement the virtual functions

Member Function Documentation

◆ extremeUnction()

void Fiber::CreativeArrayBase::extremeUnction ( )
virtual

◆ getBinder()

RefPtr< BinderBase > Fiber::CreativeArrayBase::getBinder ( ) const

Get the Binder from the Bundle where this Creator is contained, processing via Bundle::processOwnership(), which may be relatively slow.

Use this function to determine whether a Creator needs to be saved at all. This information is not available from the Creator itself because it may change depending on the containing bundle and whether that one is bound to a file or not. If a Creator is contained in multiple bundles, then this information is no longer unique and depends on what processOwnership() yields.

◆ hasBeenSaved()

void Fiber::CreativeArrayBase::hasBeenSaved ( ) const
inline

Indicate that this dataset has been saved and does not need to be saved again.

The LastSaved date is updated to the same age as the Creator's age.

References MemCore::Ageable::update().

◆ needsSaving()

bool Fiber::CreativeArrayBase::needsSaving ( ) const
inline

Check if the data here need to be saved, i.e.

the modification date of this creator is younger than the last save date.

◆ save()

void Fiber::CreativeArrayBase::save ( const MemCore::RefPtr< MemBase > &  D) const

Passes the data object backwards through the ownership hierarchy, ultimately calling Bundle::processOwnership() which in turn calls Binder::save().

The intercubes as provided to the processOwnership() call will be equipped with two interfaces:

An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34

which allow to extract the saving information in the Binder::save() implementation.

◆ value_type_size()

auto Fiber::CreativeArrayBase::value_type_size ( ) const
inline

How many bytes this object occupies in memory.

Alias for mem_size(), for compatiblity with Chunk::value_type_size().