Fish is the Fiber Bundle VISH interface. More...
Fish is the Fiber Bundle VISH interface.
It provides certain types and respective VISH slots (VSlots) to retrieve, communicate and provide Fiber Bundle object properties, such as Grid and Field objects.
These Fish slots can be used directly like any VISH slot, but there are also some building blocks defined that implicitely implement these slots. These building blocks are used via the Fish<> template class and called the "Fish Scales". A Fish Scale is used as a base class from which a Vish Object is derived.
For instance, a Vish Object may request a Field as input. It may then requiest a Field as a usual TypedSlot:
struct MyObject : VObject { TypedSlot<Field> MyInputField; MyObject(...) : VObject(...) , MyInputField(this, "inputfield") {} };
This mechanism will just work. Note that Fields are communicated among Vish Objects in the form of FieldSelectors, not as actual Fields. In contrast to a Fields, a FieldSelectordescribes the means on how to get a Field, but does not load or create any data by itself. To get the actual Field, one must apply the various member functions of the FieldSelector. For the purpose of connecting objects, the FieldSelector is equipped with the functionality on how to describe Fields, such as its possible types. This is used to determine if objects may be connected at all, without having to load or create any data yet.
However, alternatively to using a TypedSlot<Field>, one can use the method of Fish Scales:
struct MyObject : VObject, Fish<Field> { MyObject(...) : VObject(...) , Fish<VObject>(this) , Fish<Field>("inputfield") {} };
As a Fish Scale, the newly defined object will be equipped with convenient membet functions to operate on the available data. See class Fish<Field> for further details. Note that class Fish<Field> only supports input of a single Field; so if multiple input Fields are required, the child class still needs to make use of TypedSlot<Field> members.
If a Vish object wishes to provide a Field as output, this is done the standard way:
struct MyObject : VObject { VOutput<Field> Result; bool update(const VContext&Context, double precision( { FieldSelector FS; // initialize FS Result << Context << FS; return true; } };
Remember, Fields are communicated in Fish as FieldSelectors;
Similarly to Fields, also Grids and Bundles can be communicated among Vish Objects. For Grids, communication will be done via the GridSelector, for Bundles it will be via a BundlePtr.