Fish - FiberLib for VISH 0.3
Fish - The Fiber Bundle API for the Vish Visualization Shell

An interface telling size and dimensionality of a dataset, a refcounted version of DynamicSize. More...

#include <DynamicSize.hpp>

Inheritance diagram for Fiber::SizeInterface:
MemCore::Interface< SizeInterface > Fiber::DynamicSize MemCore::InterfaceBase MemCore::ReferenceBase< InterfaceBase > Fiber::FragmentedSizeInterface

Public Member Functions

 SizeInterface (int rank, const SizeInterface &L, const SizeInterface &R)
 Summation constructor.
template<int N>
 SizeInterface (const MultiIndex< N > &MI)
 Create from multidimensional index.
 SizeInterface (const DynamicSize &DS)
 Create from given dynamic size.
template<class T>
 SizeInterface (int N, const T values[])
 Assign values from arbitrary type that is convertible into integers.
 SizeInterface (int N)
 Create size interface of N dimensions with zero extension.
 SizeInterface ()
 Default constructor.
 SizeInterface (const SizeInterface &DS)
 Copy constructor.
index_t operator[] (int i) const
 Element access operator.
bool operator!= (const DynamicSize &DS) const noexcept
 Unequality Comparison.
DynamicSizeoperator= (const DynamicSize &DS)
 Assignment.
Public Member Functions inherited from MemCore::Interface< SizeInterface >
const type_info & getInterfaceDomain () const
Public Member Functions inherited from MemCore::InterfaceBase
virtual bool apply (Intercube &I, const RefPtr< InterfaceIterationParameter > &)
virtual bool apply_const (const Intercube &I, const RefPtr< InterfaceIterationParameter > &)
Public Member Functions inherited from MemCore::ReferenceBase< InterfaceBase >
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 Fiber::DynamicSize
template<Dims_t N>
 DynamicSize (const MultiIndex< N > &MI)
 Initialize from a MultiIndex of certain dimension.
template<class T>
 DynamicSize (Dims_t N, const T values[])
 Assign values from arbitrary type that is convertible into integers.
 DynamicSize (Dims_t N, index_t NValue)
 Construct a dynamic size of N dimensions, but all extensions set to the given value.
 DynamicSize ()=default
 Empty default constructor, zero rank.
 DynamicSize (const DynamicSize &DS)
 Copy constructor.
 DynamicSize (index_t SubDimension, const DynamicSize &DS)
 Construct a size of one dimension higher.
 DynamicSize (int N, const DynamicSize &L, const DynamicSize &R)
 Addition constructor.
 ~DynamicSize ()
 Destructor.
DynamicSizeoperator= (const DynamicSize &DS)
 Assignment.
bool operator!= (const DynamicSize &DS) const noexcept
 Unequality Comparison.
bool operator== (const DynamicSize &DS) const noexcept
 Equality Comparison.
template<class T>
DynamicSizesetSize (int N, const T values[])
 Assign values from arbitrary type that is convertible into integers.
template<Dims_t N>
DynamicSizeresize (const MultiIndex< N > &MI)
 Set a new size from the given MultiIndex.
bool hasIncompatibleLowerDims (const DynamicSize &DS) const noexcept
bool hasIncompatibleHigherDims (const DynamicSize &DS) const noexcept
bool hasCompatibleHigherDims (const DynamicSize &DS) const noexcept
size_t getElementArraySize (const DynamicSize &DataFragmentDims) const noexcept
 Given a base space (this), return the number of elements provided by the given data dims, if it is a multidimensional size of just one dimension higher.
bool hasCompatibleLowerDims (const DynamicSize &DS) const noexcept
index_t nElements () const
 How many elements here?
index_t getNumberOfElements () const
rank_t Rank () const
 Dimensionality of the domain (same as rank).
rank_t getRank () const
 Dimensionality of the domain (same as rank).
rank_t dimensionality () const
 Dimensionality of the domain (same as rank).
index_t operator[] (int i) const
 Element access operator.
const index_tdims_ptr () const
 Return c pointer to dimension storage.
bool isValid () const
 Check if some size has been defined here.
bool setSize (int i, index_t what)
 Set the extension of this dimensional size in a certain dimension.
template<Dims_t N>
bool changeSize (const MultiIndex< N > &MI)
 Adjust size for lowest matching dimensions.
bool increment_dims (int incr)
 Increment each dimensional element by the same value.
bool multiply_dims (int incr)
 Multiply each dimensional element by the same factor.
DynamicSizeincrement (const DynamicSize &D)
DynamicSizeoperator+= (const DynamicSize &D)
bool setSize (const DynamicSize &D, int FillUp=1) const
 Set the size from another DynamicSize without changing the rank of this DynamicSize, possible using the FillUp value if the given DynamicSize is smaller than the assigned DynamicSize.
template<typename T>
rank_t getDims (T *Dims, int MaxEntries) const
template<typename T, int N>
rank_t getDims (T(&Dims)[N]) const
template<Dims_t N>
bool get (MultiIndex< N > &MI) const
 Retrieve a dynamic size into a multidimensional index.
template<Dims_t N>
MultiIndex< N > getSize () const
 Provide the size stored here as a MultiIndex.
std::string str () const
 Create textual version of this string.

Protected Member Functions

 ~SizeInterface ()
 Destructor.
Protected Member Functions inherited from MemCore::ReferenceBase< InterfaceBase >
virtual void extremeUnction ()
ReferenceBaseoperator= (const ReferenceBase &R)
void suicide ()

Friends

MemCore::RefPtr< SizeInterfaceoperator+ (const MemCore::RefPtr< SizeInterface > &L, const MemCore::RefPtr< SizeInterface > &R)
 Compute the sum of two size interfaces.
MemCore::RefPtr< SizeInterfaceoperator+= (const MemCore::RefPtr< SizeInterface > &L, const MemCore::RefPtr< SizeInterface > &R)

(Note that these are not member symbols.)

template<Dims_t N>
void setSizeInterface (const RefPtr< CreativeArrayBase > &CAB, const MultiIndex< N > &FragmentSize)
 Set the size interface to a CreativeArrayBase.
template<Dims_t N>
void setSizeInterface (CreativeArrayBase &CAB, const MultiIndex< N > &FragmentSize)
 Set the size interface to a CreativeArrayBase.
int getRank (const RefPtr< CreativeArrayBase > &CAB)
 Get the rank of a CreativeArrayBase.
FIELD_API RefPtr< SizeInterfacegetSize (const CreativeArrayBase &CAB)
 Get the size interface of a CreativeArrayBase.
RefPtr< SizeInterfacegetSize (const RefPtr< CreativeArrayBase > &CAB)
 Get the size interface of a CreativeArrayBase.
index_t getNumberOfElements (const RefPtr< CreativeArrayBase > &CAB)
 Get the number of elements of a CreativeArrayBase if a SizeInterface is available.
index_t getNumberOfElements (CreativeArrayBase &CAB)
 Get the number of elements of a CreativeArrayBase if a SizeInterface is available.
template<Dims_t N>
bool getDimensions (MultiIndex< N > &MI, const RefPtr< CreativeArrayBase > &CAB)
 Get the dimensions of CreativeArrayBase, if the rank is already known.
FIELD_API MemCore::memsize_t getMemoryUsage (const CreativeArrayBase &CAB)
 Determine memory usage (in bytes) of this CreativeArrayBase object.

Additional Inherited Members

Public Types inherited from MemCore::Interface< SizeInterface >
typedef Domain InterfaceDomain_t
Public Types inherited from MemCore::ReferenceBase< InterfaceBase >
typedef Object reference_domain_t
typedef WeakPtr< Object, Object > SelfPtr_t
Public Types inherited from Fiber::DynamicSize
using rank_t = int

Detailed Description

An interface telling size and dimensionality of a dataset, a refcounted version of DynamicSize.

Such interfaces are attached to CreativeArrayBase objects, i.e. to metadata, and may be queried without loading the data itself.

See also
getSize(), getRank(), setSizeInterface()

, CreativeArrayBase

Member Function Documentation

◆ operator[]()

index_t Fiber::DynamicSize::operator[] ( int i) const
inline

Element access operator.

Returns zero if no dimensions have been defined at all, or 1 if the coordinate range is beyond the defined dimensionality.

◆ operator+

Compute the sum of two size interfaces.

Returns
Will return a NullPtr() if the dimensions don't match.