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

A collection of fragment identifiers with bijective mapping to an integer fragment number. More...

#include <FragmentIDCollection.hpp>

Inheritance diagram for Fiber::FragmentIDCollection:
MemCore::ReferenceBase< FragmentIDCollection >

Public Types

using FragmentNames_t = std::unordered_map< std::string, FragmentIndex_t >
 
using FragmentIDs_t = std::vector< RefPtr< FragmentID > >
 
- Public Types inherited from MemCore::ReferenceBase< FragmentIDCollection >
typedef Object reference_domain_t
 
typedef WeakPtr< Object, Object > SelfPtr_t
 

Public Member Functions

 FragmentIDCollection (const RefPtr< TypedArray< string > > &FragmentNameArray)
 
RefPtr< TypedArray< RefPtr< FragmentID > > > getFragmentIDArray () const
 
const FragmentIDs_tgetFragmentIDs () const
 get a vector of fragment id's
 
RefPtr< FragmentIDfindFragmentID (FragmentIndex_t) const
 
FragmentIndex_t getID (const RefPtr< FragmentID > &fID)
 Enforce getting a fragment ID contained in this collection.
 
FragmentIndex_t findID (const RefPtr< FragmentID > &fID) const
 Find a fragment ID's numerical identifier, returning 0 if the ID is a null ptr, and a negative number if it is not contained here.
 
RefPtr< FragmentIDfindFragmentIDByName (const string &Name) const
 
size_t NumberOfFragmentIDs () const
 Get the number of fragment ID's managed here.
 
const DynamicSizegetFragmentLayout () const
 Get the current fragment layout.
 
bool isDense () const
 
template<Dims_t DIMS>
bool setFragmentLayout (const MultiIndex< DIMS > &NumberOfFragments, const string &FragmentNamePrefix)
 Set the fragment layout.
 
template<Dims_t DIMS>
 FragmentIDCollection (const MultiIndex< DIMS > &NumberOfFragments, const string &FragmentNamePrefix)
 
RefPtr< FragmentID > & makeFragmentID (const string &Name)
 Create a new fragment ID and assign a unique integer to it.
 
FragmentIndex_t findNumericalIDByName (const string &Name) const
 
string xml () const
 
unsigned iterate (const std::function< bool(const RefPtr< FragmentID > &, int, const std::string &)> &F) const
 Iterate over all fragments that are managed by this collection.
 
- Public Member Functions inherited from MemCore::ReferenceBase< FragmentIDCollection >
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
 

Additional Inherited Members

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

Detailed Description

A collection of fragment identifiers with bijective mapping to an integer fragment number.

Member Function Documentation

◆ getID()

FragmentIndex_t Fiber::FragmentIDCollection::getID ( const RefPtr< FragmentID > &  fID)

Enforce getting a fragment ID contained in this collection.

It searches for the ID to see if it's already here, if not, then it will be added here and the fragment ID's numerical identifier will be overwritten with the fragment number in here.

References MemCore::breakpoint(), and size().

◆ makeFragmentID()

RefPtr< FragmentID > & Fiber::FragmentIDCollection::makeFragmentID ( const string &  Name)

Create a new fragment ID and assign a unique integer to it.

It will be the next available number.

References size().

◆ setFragmentLayout()

template<Dims_t DIMS>
bool Fiber::FragmentIDCollection::setFragmentLayout ( const MultiIndex< DIMS > &  NumberOfFragments,
const string &  FragmentNamePrefix 
)
inline

Set the fragment layout.

This can be done only once.

References Fiber::DynamicSize::isValid(), and Fiber::DynamicSize::resize().