Client Interface: ================= Package/Task Management: ------------------------ vo_setPkgDir (path) # set package dir path = vo_getPkgDir () # get package dir pkg = vo_pkgList (pattern) # Get available packages len = vo_pkgLen (pkg) pkg = vo_pkgNext (pkg) str = vo_pkgAttr (pkg, attr) task = vo_taskList (taskName) # Get tasks in package len = vo_taskLen (task) str = vo_taskNext (task) task = vo_taskAttr (task, attr) pp = vo_taskParams (pkgName, taskName) # Input param defs ( see parameter handling below ) xml = vo_pkgXML (pattern) # XML serializations (opt) xml = vo_taskXML (pkgName) xml = vo_paramXML (pkgName, taskName) Task Execution: --------------- tp = vo_taskInit (pkgName, taskName) # Initialize a task vo_taskSetStringParam (tp, pname, sval) # Set input params vo_taskSetBoolParam (tp, pname, bval) vo_taskSetIntParam (tp, pname, ival) vo_taskSetRealParam (tp, pname, dval) vo_taskSetDictParam (tp, pname, dict) vo_taskSetListParam (tp, pname, list) vo_taskSetPtrParam (tp, pname, ptr, size) vo_taskSetCallback (tp, type, &func) # Set param callback rp = vo_taskExecuteSync (tp, status, msg) # Execute sync vo_taskExecuteAsync (tp) # Execute async rp = vo_taskWait (tp) # Wait for task, get RP status = vo_taskCheckError (tp, msg) # Check for any error vo_taskClose (tp) # Free task resources Parameter Handling: ------------------- Directed parameter access: int = vo_taskParamCount (rp) vo_taskGetParamInfo (rp, pnum, *name, *type, *encoding, *description) str = vo_taskGetStringParam (rp, pname, pnum) # pnum used if pname=null ival = vo_taskGetBoolParam (rp, pname, pnum) ival = vo_taskGetIntParam (rp, pname, pnum) dval = vo_taskGetRealParam (rp, pname, pnum) dict = vo_taskGetDictParam (rp, pname, pnum) dict = vo_taskGetListParam (rp, pname, pnum) void = vo_taskGetParamValue (rp, pname, pnum, size) Iterated parameter access: pp = vo_taskGetParam (rp, pname, pnum) len = vo_paramLen (pp, [typ|enc]) pp = vo_paramNext (pp, [typ|enc]) str = vo_paramAttr (pp, attr) Notes: ====== - Added set/get methods for the package directory to be searched for packages. This allows a client to point to different dirs depending on which package is being 'loaded'. - The pkgList() takes a 'pattern' param to select only files matching a specific pattern (e.g. "*.e" or "*.pkg") from the working directory. Only files matching the pattern (or all files if NULL) will be queried for metadata. This also allows for a directory to contain single-task binaries and not require a single binary for all tasks in a package. - Made pkg/task/param listings optionally XML, these are manageable by many languages but not always 'natural'. The use of iterators allows a client to traverse the metadata and request attributes w/out depending on an XML parser. - Added 'pname' to the setParam() methods to set specific params. - Added status/msg returns from sync execution - Input and output parameters share the same data structure and interface methods work on either. This means a 'blob' can now be an input param, e.g. an in-memory object (e.g. a target list or TAP ADQL string) from a client can be posted over IPC to the task. Note however this may not be implemented for current tasks. - Parameter callbacks can be set for specific parameter types - Parameter iterators allow a 'type' or 'encoding' option to find the next param of the same typ/enc. This allows a client to skip through output params to find e.g. only FITS objects or only the stdout text strings and means the callback can be tied to a parameter type easily.