SHMVAR
The SHMVAR function creates an IDL array variable that uses the memory from a current mapped memory segment created by the SHMMAP procedure. Variables created by SHMVAR are used in much the same way as any other IDL variable, and provide the IDL user with the ability to alter the contents of anonymous shared memory or memory mapped files.
By default, the variable created by SHMVAR is given the type and dimensions that were specified to SHMMAP when the memory segment was created. However, this default can be changed by SHMVAR via a variety of keywords as well as via the Di arguments. The created array can be of any type except for pointer, object reference, or string. Structure types are allowed as long as they do not contain any pointers, object references, or strings.
Note: When assigning values to the returned array variable, explicitly make the assignment to the first element of the returned array. For example, the following creates a shared memory segment of 1000000 double-precision data elements, and then fills it with a DINDGEN rampSHMMAP, 'MYSEG', /DOUBLE, 1000000z = SHMVAR('MYSEG')z[0] = DINDGEN(1000000)
This technique maintains the array variable’s connection with the shared memory segment.
Examples
See the examples given for the SHMMAPprocedure.
Syntax
Result = SHMVAR(SegmentName [, D1, ..., D8] [, /BYTE] [, /COMPLEX] [, /DCOMPLEX] [, DIMENSION=value] [, /DOUBLE] [, /FLOAT] [, /INTEGER] [, /L64] [, /LONG] [, SIZE=value] [, TEMPLATE=value] [, TYPE=value] [, /UINT] [, /UL64] [, /ULONG] )
Return Value
An IDL array variable that uses memory from the specified mapped memory segment.
Arguments
SegmentName
A scalar string supplying the IDL name for the shared memory segment, as assigned by SHMMAP.
Di
The dimensions of the result. The Di arguments can be either a single array containing the dimensions or a sequence of scalar dimensions. Up to eight dimensions can be specified. If no dimensions are specified, the parameters specified to SHMMAP are used.
Keywords
BYTE
Set this keyword to specify that the memory segment should be treated as a byte array.
COMPLEX
Set this keyword to specify that the memory segment should be treated as a complex, single-precision floating-point array.
DCOMPLEX
Set this keyword to specify that the memory segment should be treated as a complex, double-precision floating-point array.
DIMENSION
Set this keyword equal to a vector of 1 to 8 elements specifying the dimensions of the result. This is equivalent to the array form of the Di plain arguments. If no dimensions are specified, the parameters specified to SHMMAP are used.
DOUBLE
Set this keyword to specify that the memory segment should be treated as a double-precision floating-point array.
FLOAT
Set this keyword to specify that the memory segment should be treated as a single-precision floating-point array.
INTEGER
Set this keyword to specify that the memory segment should be treated as an integer array.
L64
Set this keyword to specify that the memory segment should be treated as a 64-bit integer array.
LONG
Set this keyword to specify that the memory segment should be treated as a longword integer array.
SIZE
Set this keyword equal to a size vector specifying the type and dimensions to be associated with the memory segment. The format of a size vector is given in the description of the SIZE function. If no dimensions are specified, the parameters specified to SHMMAP are used.
TEMPLATE
Set this keyword equal to a variable of the type and dimensions to be associated with the memory segment. If no dimensions are specified, the parameters specified to SHMMAP are used.
TYPE
Set this keyword to specify the type code for the memory segment. See the description of the SIZE function for a list of IDL type codes.
UINT
Set this keyword to specify that the memory segment should be treated as an unsigned integer array.
ULONG
Set this keyword to specify that the memory segment should be treated as an unsigned longword integer array.
UL64
Set this keyword to specify that the memory segment should be treated as an unsigned 64-bit integer array.
Version History
5.6 |
Introduced |