FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Fiber::FiberTypeBase Class Referenceabstract

Abstract procedural description of a data element which may be used to construct arrays and fields. More...

#include <FiberTypeBase.hpp>

Inheritance diagram for Fiber::FiberTypeBase:
Fiber::FiberTypeIndex MemCore::ReferenceBase< FiberTypeBase > Fiber::FiberType< T >

Public Types

using WeakPtr_t = MemCore::WeakPtr< FiberTypeBase, FiberTypeBase >
 
- Public Types inherited from MemCore::ReferenceBase< FiberTypeBase >
typedef Object reference_domain_t
 
typedef WeakPtr< Object, Object > SelfPtr_t
 

Public Member Functions

 FiberTypeBase (const FiberTypeIndex &FTI)
 
bool remember ()
 
virtual const std::type_infogetType () const =0
 Type ID for this type.
 
virtual bool isType (const std::type_info &theType) const =0
 
template<class ... T>
bool isType () const
 
virtual MemCore::RefPtr< MemCore::ChunkBasenewChunk (size_t N) const =0
 Allocate a MemCore::Chunk with the given number of elements.
 
unsigned multiplicity () const
 How many atomic elements construct this type.
 
unsigned mem_size () const
 How many bytes this object occupies in memory.
 
int rank () const
 For tensorial objects, specify the rank.
 
int grade () const
 Grade of multivectors.
 
virtual int element_index (const int i[]) const =0
 Information about the organization of elements of a multi-ranked object.
 
unsigned array_element_size () const
 The size of an array element in memory if this type is an array.
 
virtual WeakPtr_t element_type () const =0
 
virtual std::string coordinate_component_name (int i) const =0
 Return the textual naming scheme of the ith coordinate.
 
virtual const std::type_infochart_type () const =0
 
std::string chart_name () const
 
std::string component_name (unsigned ComponentId) const
 A textual description for each member, as derived from the coordinate's component names, the indexing scheme and the grade-.
 
int chart_dimension () const
 
virtual int indexing_scheme (int i) const =0
 
bool is_lower_index (int i) const
 
bool is_upper_index (int i) const
 
virtual const charnontensor () const =0
 
std::string description () const
 
const FiberTypeIndexgetFiberTypeIndex () const
 
auto operator<=> (const FiberTypeBase &FTB) const
 
auto operator== (const FiberTypeBase &FTB) const
 
void speak () const
 
auto value_type_size () const
 How many bytes this object occupies in memory.
 
- Public Member Functions inherited from MemCore::ReferenceBase< FiberTypeBase >
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
 

Static Public Member Functions

static WeakPtr_t find (const FiberTypeIndex &FTI)
 
static WeakPtr_t find (const std::type_info &T)
 

Additional Inherited Members

- Protected Types inherited from MemCore::ReferenceBase< FiberTypeBase >
typedef Object reference_domain_t
 
typedef WeakPtr< Object, Object > SelfPtr_t
 
- Protected Member Functions inherited from Fiber::FiberTypeIndex
auto operator<=> (const FiberTypeIndex &) const =default
 https://en.cppreference.com/w/cpp/language/default_comparisons https://devblogs.microsoft.com/cppblog/simplify-your-code-with-rocket-science-c20s-spaceship-operator/
 
std::string description () const
 
auto value_type_size () const
 
- Protected Member Functions inherited from MemCore::ReferenceBase< FiberTypeBase >
virtual void extremeUnction ()
 
ReferenceBaseoperator= (const ReferenceBase &R)
 
void suicide ()
 
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
 
- Protected Attributes inherited from Fiber::FiberTypeIndex
unsigned multiplicity = 0
 How many atomic elements construct this type.
 
unsigned mem_size = 0
 How many bytes this object occupies in memory.
 
int rank = 0
 For tensorial objects, specify the rank.
 
int grade = 0
 Grade of multivectors.
 
unsigned array_element_size = 0
 The size of an array element in memory if the type is an array.
 
std::string type_name
 
std::string element_type_name
 
std::string chart_name
 Return the textual naming scheme of the ith coordinate.
 
int chart_dimension = 0
 A textual description for each member, as derived from the coordinate's component names, the indexing scheme and the grade-.
 

Detailed Description

Abstract procedural description of a data element which may be used to construct arrays and fields.

This is an object-oriented version of the generic MetaInfo class.

Constructor & Destructor Documentation

◆ FiberTypeBase()

Fiber::FiberTypeBase::FiberTypeBase ( const FiberTypeIndex FTI)
inline
Parameters
isStaticObjectSpecifies when this object is actually a static object, not a dynamically allocated one (which is essential for reference counting).

Member Function Documentation

◆ array_element_size()

unsigned Fiber::FiberTypeBase::array_element_size ( ) const
inline

The size of an array element in memory if this type is an array.

References Fiber::FiberTypeIndex::array_element_size.

◆ chart_type()

virtual const std::type_info & Fiber::FiberTypeBase::chart_type ( ) const
pure virtual

Implemented in Fiber::FiberType< T >.

◆ component_name()

string Fiber::FiberTypeBase::component_name ( unsigned  ComponentId) const

A textual description for each member, as derived from the coordinate's component names, the indexing scheme and the grade-.

Parameters
ComponentIdAn integer between 0 and multiplicity();

This is a temporary workaround until the full notation of the aforementioned paper is implemented here procedurally. This will require implementing and working with the epsilon-tensor to compute permutations. WB 11.12.2014

References coordinate_component_name(), getType(), grade(), indexing_scheme(), is_lower_index(), is_upper_index(), multiplicity(), rank(), and MemCore::Typename().

Referenced by std::to_string().

◆ coordinate_component_name()

virtual std::string Fiber::FiberTypeBase::coordinate_component_name ( int  i) const
pure virtual

Return the textual naming scheme of the ith coordinate.

Parameters
avalue beteen 0 and char_dimension()

Implemented in Fiber::FiberType< T >.

References Fiber::FiberTypeIndex::chart_name.

Referenced by component_name(), and std::to_string().

◆ element_index()

virtual int Fiber::FiberTypeBase::element_index ( const int  i[]) const
pure virtual

Information about the organization of elements of a multi-ranked object.

The index i must be smaller than rank().

Implemented in Fiber::FiberType< T >.

◆ getType()

virtual const std::type_info & Fiber::FiberTypeBase::getType ( ) const
pure virtual

Type ID for this type.

Implemented in Fiber::FiberType< T >.

Referenced by component_name(), and std::to_string().

◆ indexing_scheme()

virtual int Fiber::FiberTypeBase::indexing_scheme ( int  i) const
pure virtual
Parameters
iThe index number, between 0 and rank()

Implemented in Fiber::FiberType< T >.

Referenced by component_name(), and std::to_string().

◆ is_lower_index()

bool Fiber::FiberTypeBase::is_lower_index ( int  i) const
inline
Parameters
iThe index number, between 0 and rank()

Referenced by component_name().

◆ is_upper_index()

bool Fiber::FiberTypeBase::is_upper_index ( int  i) const
inline
Parameters
iThe index number, between 0 and rank()

Referenced by component_name().

◆ multiplicity()

unsigned Fiber::FiberTypeBase::multiplicity ( ) const
inline

How many atomic elements construct this type.

Note that in memory there might be more than that due to alignment issues, see mem_size().

References Fiber::FiberTypeIndex::multiplicity.

Referenced by component_name(), and std::to_string().

◆ newChunk()

virtual MemCore::RefPtr< MemCore::ChunkBase > Fiber::FiberTypeBase::newChunk ( size_t  N) const
pure virtual

Allocate a MemCore::Chunk with the given number of elements.

Implemented in Fiber::FiberType< T >.

◆ rank()

int Fiber::FiberTypeBase::rank ( ) const
inline

For tensorial objects, specify the rank.

A matrix has rank two, a vector has rank one. Scalars have rank zero. The number of elements (multiplicity() ) can at most be chart_dimension() to the power of rank().

References Fiber::FiberTypeIndex::rank.

Referenced by component_name(), and std::to_string().

◆ value_type_size()

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

How many bytes this object occupies in memory.

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