Pointers
Stated simply, a pointer is nothing more than a variable that holds an address in the computer memory. In other words, a pointer points at a specific location in memory.
A pointer may refer to no object, or be null. If an object is deleted or destroyed, all FISH symbols that point to that object will be set to null. You can use the intrinsic function null to test for null pointer values.
FISH pointer objects are typed, and the type is available with the intrinsic type.pointer
. This function returns a string identifying the object pointed to.
When FISH pointer values are printed they generally show the type name of the object they refer to along with the ID number of the object.
When seen as part of a FISH intrinsic argument specification, pointer types are indicated with a trailing _pnt. The leading parts of that word should indicate the type of object that it is a pointer to. For example: zone_pnt.
Certain FISH intrinsics return pointers to containers of objects, or pointers to object lists. These library functions end in .list. For example, zone.list
in FLAC3D or ball.list
in PFC.
These specific pointers may be directly converted into a list type with the list
library function, the result of which is a list that contains a pointer to each object in the container.
Pointers to containers are an iterable type. This means you can use it as the target of a loop foreach statement (see Loop ForEach and can be split (see Splitting). Each object in the container is iterated through in order.
Was this helpful? ... | 3DEC © 2019, Itasca | Updated: Feb 25, 2024 |