Function
Applies a function to every constituent Field (part) of a specified Object.
Syntax
#include <dx/dx.h>
Object DXProcessParts(Object object, Field (*process)(Field, Pointer, int),
Pointer args, int size, int copy, int preserve)
Functional Details
If the input Object is a Field, this routine returns the result of the process function on that Field.
If the input Object is a Group and copy is 1, this routine recursively makes a copy of the Group and all subgroups. In this case, the order of the Fields in the Groups is preserved if preserve is 1. If this is not required, set preserve to 0 and a more efficient traversal algorithm will be used.
If the input Object is a Group and copy is 0, it operates directly on the Groups of the input object.
In either case, for every Field f that is a member of a Group, it makes a call of the form process(f, args, size) and places the result of that call in the output in place of f. The process function is intended to return a Field which is the processed version of input Field f.
Regardless of the value of the copy parameter, the Field passed to the process function is the Field from the original Object and not a copy.
The size parameter specifies the size of the block pointed to by args. If size is nonzero, it makes a copy of the argument block and places it in global memory before passing it to process. The argument must be in global memory because DXProcessParts may run in parallel; however, if the pointer passed is, for example, just a pointer to an Object that is already in global memory, then size can be given as 0. args should not contain pointers to local memory.
If the process function returns NULL, and preserve is 1 or the Field was part of a Series Group or was the entire input Object, the NULL return value is replaced with an empty Field.
Return Value
Returns the Object, a copy of the Object, or a processed version of it, depending on the parameters; otherwise, it returns NULL and sets an error code.
See Also
DXGetPart, DXGetPartClass, DXSetPart