NAME
my_path -- provide path name for this level
PROTOTYPE
unitptr my_path( int iMaxPathLen, char *pcName, unitptr uHost)
ARGUMENTS
- int iMaxPathLen
- max nr path elements, 0 for no restriction
- char *pcName
- (may be NULL) optional name to be appended to path. If necessary, a colon will be inserted. Leading blanks are ignored.
- unitptr uHost
- host unit
RETURN VALUE:
A pointer to the created unit or NULL in the case of an error.
INTERFACE OF CREATED UNIT:
- out_0[]:
- (text output field 0) the path for this unit
DESCRIPTION:
Several NST objects (named units and variable sets) can be referenced
by text names. If the object foo (which can be a named unit or a
variable set of a var unit) is located in a named container inner,
which itself is contained in another named container outer, it
can be referenced from the level of outer by the name outer:inner:foo.
The present unit provides at its output the "path" (which would be
outer:inner in the example above) for referencing named units at
its (the present unit's) nesting level. This allows to
build NST container units that export via some output pin
the path for accessing their named subunits. Wires from such pins can,
therefore, transport access information about entire NST objects
and, thereby, simulate the "transport by wire" of such objects.
Non-zero values of iMaxPathLen allow to restrict the returned
path name to its maximally iMaxPathLen last elements (i.e.,
iMaxPathLen=1 in the above example would yield only inner)
iMaxPathLen=0 always returns the entire path.
NOTE:
The maximal length of the returned path is always given by the number
of consecutive named container units of the present unit, i.e.,
any unnamed container unit in the upward hierarchy chain of container
units will end the path (in the above example, if iMaxPathLen=0 [no
length restriction], but outer is not a name but just a label, the
returned path will be only inner).
EXAMPLES:
The NST data mining folder offers examples of the use of the
my_path unit.
SEE ALSO:
use_named, var_units
FILE
/amnt/loge/users/nistaff02/nistaff/rhaschke/nst7/man/../o.linux//../nstsrc/nst_misc.c