FiberVISH  0.2
Fish-TheFiberBundleAPIfortheVishVisualizationShell
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
Fiber::Slice Class Reference

Information per time slice, mainly a set of Grid objects that are accessed via GridID objects. More...

#include <Slice.hpp>

Inheritance diagram for Fiber::Slice:
Fiber::Ownable< Slice > MemCore::Intercube Fiber::SaveableAttributes Fiber::OwnerBase MemCore::Attributes

Classes

class  Loader
 An loader object that may be associated with each Slice, such that data can created on access. More...
 

Public Types

enum  LoaderPriority { HDF5, COMPUTED_GRID }
 Enums specifying the priority for various loaders.
 
typedef map< RefPtr< GridID >
, RefPtr< Grid > > 
grids_t
 
typedef std::multimap
< LoaderPriority, RefPtr
< Loader > > 
DeferredLoader_t
 
typedef GridIterator Iterator
 

Public Member Functions

RefPtr< GridListgetIDList () const
 
bool accessSlice () const
 Access a slice and loads its data, if they are not loaded yet.
 
bool isNotYetLoaded () const
 
bool isLoaded () const
 
 Slice (const OwnerOf< Slice > &SliceOwner, const RefPtr< GlobalCharts > &Atlas)
 Construct Slice object.
 
 ~Slice ()
 Destruct Slice object.
 
void extremeUnction () override
 
GridnewGrid (const string &gridname)
 Create a new Grid object, overwriting an existing one.
 
GridnewGrid (const string &gridname, const string &ParentGridName)
 Create a new Grid object as a child relationship to an existing one, overwriting an existing one. More...
 
bool insert (const string &gridname, const RefPtr< Grid > &G)
 Insert a Grid object under the given name in this slice, eventually overwriting an existing Grid.
 
Gridoperator[] (const string &gridname)
 Retrieve a grid from a textual description, creating one, if desired. More...
 
Gridoperator[] (const RefPtr< GridID > &gridname)
 Retrieve an existing grid, possibly creating one.
 
RefPtr< GridIDmakeGridID (const string &gridname)
 Get a Grid for the given textual description.
 
RefPtr< GridIDfindGridID (const string &gridname)
 Find a grid ID for a given string.
 
RefPtr< Gridoperator() (const string &gridname)
 Find a Grid object from its textual description.
 
grids_t::value_type getUniqueGrid ()
 
RefPtr< Gridoperator() (const RefPtr< GridID > &gridname)
 Find a grid via a grid identifier.
 
int iterate (GridIterator &GI, const RefPtr< MemCore::StringList > &TheseGridsOnly=NullPtr())
 Iterate over all or a subset of grids on this slice. More...
 
template<class Functor >
int iterate_grids (const Functor &F) const
 
       Lambda iterator for bundles, provides Slices:

iterate_grids( [](const GridID&GId, const Grid&G) { Verbose(0) << " Grid " << GId.Name(); return true; } );

 
int getMemoryUsage (memsize_t &UsedMemory, memsize_t &WantedMemory) const
 Memory usage.
 
string xml () const
 
- Public Member Functions inherited from Fiber::Ownable< Slice >
void 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::SaveableAttributes
void attributesHaveBeenSaved () const
 
bool attributesNeedSaving () const
 
- Public Member Functions inherited from MemCore::Attributes
MemCore::RefPtr
< MemCore::ChunkBase
getAttribute (const std::string &name) const
 
attributes_t & getAttributeValues ()
 
const attributes_t & getAttributeValues () const
 
size_t getNumberOfAttributes () const
 
bool hasAttribute (const std::string &name) const
 
int iterate (Iterator &it) const
 
int Iterate (const Functor &L) 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)
 
string toString () const
 
const AgeabletouchAttributes () const
 
const AgeableupdateAttributeAge (const Ageable &A) const
 

Public Attributes

DeferredLoader_t DeferredLoader
 An optionally associated loader map. More...
 
- Public Attributes inherited from Fiber::Ownable< Slice >
std::unordered_set
< MemCore::WeakPtr< Container > > 
Owners
 The (internal) list of owners. More...
 
- Public Attributes inherited from Fiber::SaveableAttributes
MemCore::Ageable LastSavedAttributes
 

Detailed Description

Information per time slice, mainly a set of Grid objects that are accessed via GridID objects.

A slice in the fiber bundle data model hierarchy.

Examples:
trimesh.cpp.

Member Function Documentation

int Slice::iterate ( GridIterator GI,
const RefPtr< MemCore::StringList > &  TheseGridsOnly = NullPtr() 
)

Iterate over all or a subset of grids on this slice.

Note
Even when iterating just over a subset of grids, inter-grid information will still be visible, such as a relative representation of one Grid in another Grid (known as interpolation weights).

References accessSlice(), and Fiber::GridIterator::apply().

Grid & Slice::newGrid ( const string &  gridname,
const string &  ParentGridName 
)

Create a new Grid object as a child relationship to an existing one, overwriting an existing one.

Note
The grid relationship will be global, independently of the specific Grid object created at this certain time slice.

References accessSlice(), findGridID(), and makeGridID().

Grid & Slice::operator[] ( const string &  gridname)

Retrieve a grid from a textual description, creating one, if desired.

A GridID is reused or created.

Note
Use the newGrid() functor to create a new grid, thereby replacing an old one existing under the same name.

References accessSlice(), and makeGridID().

Member Data Documentation

DeferredLoader_t Fiber::Slice::DeferredLoader
mutable

An optionally associated loader map.

The integer part contains the priority of the loaders and the Loaders contains the references to the loader objects. Priorities are like the nice value, lower the value higher the priority. If it's size is not zero, it will be called upon each slice access.

Referenced by accessSlice().