Getting dynamic object from iterator

Primary tabs

Is there a way to get dynamic object from iterator?

set arr=[1,2,3]
set iter=arr.%GetIterator()

I pass iterator several frames down and I'd rather avoid passing both the array and iterator, but for debugging I need to access original object in a situation where only iterator is available.

Is there a way to do it?

Answers

Looks like there's a pvaoref property that points to the original instance as you can see below:

Method %OnNew(oref As %Library.DynamicAbstractObject) As %Status [ Private, ProcedureBlock = 1, ServerOnly = 1 ]
{
    set i%pointer = -1
    set ..pvaoref = oref
    return $$$OK
}

And it seems to work:

USER>set a = []

USER>set it = a.%GetIterator()

USER>w it.pvaoref
1@%Library.DynamicArray
USER>

I get this error on access:

<PRIVATE PROPERTY>

And the property is indeed marked as private.

sighs

I should have expected that much. Which version are you using?