One of the peculiar VIX COM API constructs is the combination that returns arrays of properties. This is done with two functions: GetNumProperties and GetNthProperties. The first returns the number of property arrays returned by the job and the second fetches a property array at a given index. The first obvious step is to wrap the functions within the job class.
We can now write such properties as RunningVirtualMachines.
This is still not good enough. Let’s combine the number of results and the results themselves in a YieldWait method.
This results in a nice improvement over the previous implementation: we’re interating over a resultset rather than calling methods for how many results are available and to fetch each result.